Looking forward to the merged backport then for I even consider doing anything related to that.
I'm also currently observing very occasional lockups that then prevent further DRM page flips as something runs into a timeout. I'm not sure yet as I've only ever seen this happen three times while playing a 3 second video in an endless loop, each time opening a new ffmpeg decoder instance within my program. Here's the only time I got a backtrace:
I can't yet tell if this is somehow related with my mailbox calls. Is there anything I have to be careful about? My IOCTL_MBOX_PROPERTY ioctl call is serialized by a lock as I figured I wouldn't get any benefit, even if it would be somehow possible to call this from multiple threads. In my assembly code I use r0 - r7 and store r6-r7 using stm r6-r7,(--sp) and restore them before returning with rts using ldm r6-r7,(sp++).
Maybe my reimport of an existing dma buf, provided by ffmpeg's AVDRMObjectDescriptor's fd, using VC_SM_CMA_IOCTL_MEM_IMPORT_DMABUF somehow messes things up? I'm using this to get the firmware side address of the dma buf using the returned value in import.dma_addr. Is there another way?
I'm also currently observing very occasional lockups that then prevent further DRM page flips as something runs into a timeout. I'm not sure yet as I've only ever seen this happen three times while playing a 3 second video in an endless loop, each time opening a new ffmpeg decoder instance within my program. Here's the only time I got a backtrace:
Code:
<3>[ 5205.051620] vc_sm_cma_vchi_rx_ack: received response 1911329, throw away...<3>[13297.674190] vc_sm_cma_vchi_rx_ack: received response 4892582, throw away...<3>[16272.155888] vc_sm_cma_vchi_rx_ack: received response 5988225, throw away...<3>[17001.134223] vc_sm_cma_vchi_rx_ack: received response 6256649, throw away...<3>[22829.255877] vc_sm_cma_vchi_rx_ack: received response 8403019, throw away...<3>[42513.538676] vc_sm_vpu_event: VC released a buffer that is already released, kernel_id 3<3>[47671.562081] bcm2835-codec bcm2835-codec: bcm2835_codec_flush_buffers: Timeout waiting for buffers to be returned - 0 outstanding<1>[65628.826853] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000008<1>[65628.826948] Mem abort info:<1>[65628.826954] ESR = 0x0000000096000046<1>[65628.826965] EC = 0x25: DABT (current EL), IL = 32 bits<1>[65628.826977] SET = 0, FnV = 0<1>[65628.826982] EA = 0, S1PTW = 0<1>[65628.826988] FSC = 0x06: level 2 translation fault<1>[65628.826997] Data abort info:<1>[65628.827009] ISV = 0, ISS = 0x00000046, ISS2 = 0x00000000<1>[65628.827019] CM = 0, WnR = 1, TnD = 0, TagAccess = 0<1>[65628.827027] GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0<1>[65628.827041] user pgtable: 4k pages, 39-bit VAs, pgdp=00000000483a6000<1>[65628.827056] [0000000000000008] pgd=0800000040dd6003, p4d=0800000040dd6003, pud=0800000040dd6003, pmd=0000000000000000<0>[65628.827101] Internal error: Oops: 0000000096000046 [#1] PREEMPT SMP<4>[65628.827133] Modules linked in: bcm2835_codec(C) bcm2835_mmal_vchiq(C) vc_sm_cma(C) dwc2 edt_ft5x06 tc358762 drm_mipi_dbi simple_bridge panel_raspberrypi_touchscreen rpi_panel_attiny_regulator rpi_panel_v2_regulator panel_ilitek_ili9881c panel_simple nvmem_rmem drm_rp1_dsi drm_ttm_helper ttm snd_soc_hdmi_codec rpivid_hevc(C) pisp_be vc4 v4l2_mem2mem videobuf2_dma_contig videobuf2_v4l2 videobuf2_memops v3d drm_dma_helper videobuf2_common gpu_sched drm_shmem_helper drm_kms_helper drm_display_helper videodev drm backlight mc cec i2c_mux_pinctrl i2c_mux i2c_designware_platform i2c_designware_core i2c_brcmstb drm_panel_orientation_quirks raspberrypi_gpiomem uinput enc28j60 pwm_bcm2835 rpi_poe_power brcmfmac_wcc pwm_raspberrypi_poe gpio_fan simple_mfd_i2c raspberrypi_hwmon rtc_ds1307 rtc_pcf8523 i2c_bcm2708 i2c_dev regmap_i2c cdc_acm ftdi_sio pl2303 cp210x usbserial dm_crypt dm_mod hid_multitouch goodix_ts snd_soc_core snd_pcm_dmaengine snd_compress snd_bcm2835(C) snd_pcm snd_timer snd rt2800usb rt2800lib rt2x00usb rt2x00lib<4>[65628.827444] brcmfmac brcmutil rtl8xxxu rtl8192cu rtl8192c_common rtl_usb rtlwifi xpad ff_memless tun i2c_bcm2835 overlay lib80211 mac80211 cfg80211 rfkill xt_owner xt_REDIRECT iptable_nat xt_MASQUERADE nf_nat xt_state nf_conntrack ipt_REJECT nf_reject_ipv4 nf_defrag_ipv6 nf_defrag_ipv4 xt_tcpudp iptable_filter ip_tables x_tables crc_ccitt squashfs fuse libarc4 ctr ccm cryptd sha256_arm64 aes_arm64 aes_generic libaes<4>[65628.827658] CPU: 3 UID: 0 PID: 302 Comm: SMIO Tainted: G C 6.12.16-v8+ #1859<4>[65628.827683] Tainted: [C]=CRAP<4>[65628.827692] Hardware name: Raspberry Pi 4 Model B Rev 1.1 (DT)<4>[65628.827715] pstate: 20000005 (nzCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)<4>[65628.827727] pc : vc_sm_release_resource+0x54/0xf8 [vc_sm_cma]<4>[65628.827788] lr : vc_sm_release_resource+0x50/0xf8 [vc_sm_cma]<4>[65628.827801] sp : ffffffc080d93cf0<4>[65628.827807] x29: ffffffc080d93cf0 x28: ffffffc080a26cf8 x27: ffffff84c0f6de30<4>[65628.827822] x26: ffffffe389a9dcf0 x25: ffffffc080a26cf0 x24: ffffff84c0f6df98<4>[65628.827837] x23: ffffff84c0f6de30 x22: ffffff84c131faa0 x21: ffffffe389a5e000<4>[65628.827852] x20: ffffffe389a5e000 x19: ffffff84c131fa80 x18: ffffffffffffffff<4>[65628.827867] x17: 0000000000000000 x16: ffffffe3e8f8c698 x15: ffffffc080d93c75<4>[65628.827882] x14: 0000000000000008 x13: ffffff84c0f986e8 x12: 0000000000000000<4>[65628.827895] x11: ffffff84c8712bc0 x10: ffffff84c8712b58 x9 : ffffffe389ad1288<4>[65628.827908] x8 : ffffff84c8712b80 x7 : 0000000000000034 x6 : 000000000000000c<4>[65628.827922] x5 : 0000000000000000 x4 : 0000000000000000 x3 : 0000000000000000<4>[65628.827936] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffffff84c0f98700<4>[65628.827950] Call trace:<4>[65628.827959] vc_sm_release_resource+0x54/0xf8 [vc_sm_cma]<4>[65628.827970] vc_sm_vpu_event+0x42c/0x508 [vc_sm_cma]<4>[65628.827980] vc_sm_cma_vchi_videocore_io+0x1dc/0x398 [vc_sm_cma]<4>[65628.827991] kthread+0x120/0x130<4>[65628.828039] ret_from_fork+0x10/0x20<0>[65628.828065] Code: f9438280 91020000 94000c3f a9400662 (f9000441) <4>[65628.828079] ---[ end trace 0000000000000000 ]---# vcgencmd bootloader_version2025/02/11 17:00:13version 75c1e570e99e14684e79e6ab8f5355d831440c71 (release)timestamp 1739293213update-time 1741025244capabilities 0x0000007f# vcgencmd versionFeb 17 2025 20:03:07 Copyright (c) 2012 Broadcomversion da7125f985dfe3cb0cf91e3c47f1ace88018e466 (clean) (release) (start)# uname -a (this is the kernel from rpi-firmware)Linux info-beamer 6.12.16-v8+ #1859 SMP PREEMPT Mon Feb 24 13:14:16 GMT 2025 aarch64 GNU/LinuxRevision : b03111Model : Raspberry Pi 4 Model B Rev 1.1Maybe my reimport of an existing dma buf, provided by ffmpeg's AVDRMObjectDescriptor's fd, using VC_SM_CMA_IOCTL_MEM_IMPORT_DMABUF somehow messes things up? I'm using this to get the firmware side address of the dma buf using the returned value in import.dma_addr. Is there another way?
Code:
struct vc_sm_cma_ioctl_import_dmabuf import = { .dmabuf_fd = dma_fd, }; int ret = ioctl(vcsm_fd, VC_SM_CMA_IOCTL_MEM_IMPORT_DMABUF, &import);Statistics: Posted by dividuum — Tue Mar 04, 2025 3:30 pm