I have some weird problem that might be related to NUMA: On a Pi5 (didn't test on Pi4 yet), showing a 10bit HEVC 4K video on a single DRM plane flickers (see short video here), assuming the following conditions are true:
I'm a bit lost on what might cause this. I feel that it might be memory bandwidth related? The fact that actually using the GL surface or not doesn't make a difference is really odd.
Here's the DRM debug output. The first one flickers, the second one doesn't. The only difference are the V3D related calls.
- Video is 10bit at 4K resolution (hevc (Main 10), yuv420p10le(tv)). 8bit 4K HEVC works.
- NUMA is active with both SDRAM_BANKLOW=1 and the automatically added "numa_policy=interleave numa=fake=8" kernel command line arguments. Both with "numa=fake=off" and removed SDRAM_BANKLOW=1 it works.
- A OpenGLES surface must be active. If I remove the eglSwapBuffers call, it works. It also doesn't make a difference whether or not the resulting GL framebuffer is actually added to a DRM plane or not. Even if completely unused, it results in flickering unless the eglSwapBuffers is also removed.
- Tried both with Mesa 23.2.1-1~bpo12+rpt3 as well as the new 24.2.4 and it doesn't make a difference.
- 4K 30Hz mode (CEA 95) works, anything with a higher frequency (50Hz CEA 96 or 60Hz CEA 97) flickers. Using 1080p output at 60Hz works.
Code:
uname -aLinux raspberrypi 6.6.62+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.6.62-1+rpt1 (2024-11-25) aarch64 GNU/Linuxvcgencmd bootloader_config[all]BOOT_UART=1BOOT_ORDER=0xf461NET_INSTALL_AT_POWER_ON=1SDRAM_BANKLOW=1
Here's the DRM debug output. The first one flickers, the second one doesn't. The only difference are the V3D related calls.
Code:
[ 683.607572] [drm:drm_mode_object_put.part.0 [drm]] OBJ ID: 678 (3)[ 683.607577] [drm:drm_mode_object_put.part.0 [drm]] OBJ ID: 685 (2)[ 683.607625] [drm:drm_mode_object_put.part.0 [drm]] OBJ ID: 686 (2)[ 683.607627] [drm:drm_mode_object_put.part.0 [drm]] OBJ ID: 685 (1)[ 683.607677] vc4-drm axi:gpu: [drm:__drm_atomic_state_free [drm]] Freeing atomic state 0000000041d6fee5[ 683.608162] releasing FB backed AVFrame 0x5555d0648170 (fb_id: 685)[ 683.608204] vc4-drm axi:gpu: [drm:drm_ioctl [drm]] comm="info-beamer" pid=1240, dev=0xe201, auth=1, DRM_IOCTL_MODE_ATOMIC[ 683.608257] vc4-drm axi:gpu: [drm:drm_atomic_state_init [drm]] Allocated atomic state 00000000628a0803[ 683.608311] [drm:drm_mode_object_get [drm]] OBJ ID: 687 (2)[ 683.608360] vc4-drm axi:gpu: [drm:drm_atomic_get_plane_state [drm]] Added [PLANE:106:plane-4] 00000000c8ec6464 state to 00000000628a0803[ 683.608411] [drm:drm_mode_object_get [drm]] OBJ ID: 678 (2)[ 683.608459] vc4-drm axi:gpu: [drm:drm_atomic_get_crtc_state [drm]] Added [CRTC:93:crtc-2] 00000000aa3abbf8 state to 00000000628a0803[ 683.608510] vc4-drm axi:gpu: [drm:drm_atomic_set_fb_for_plane [drm]] Set [FB:684] for [PLANE:106:plane-4] state 00000000c8ec6464[ 683.608559] [drm:drm_mode_object_get [drm]] OBJ ID: 684 (3)[ 683.608608] [drm:drm_mode_object_put.part.0 [drm]] OBJ ID: 687 (3)[ 683.608656] [drm:drm_mode_object_put.part.0 [drm]] OBJ ID: 684 (4)[ 683.608704] [drm:drm_mode_object_put.part.0 [drm]] OBJ ID: 684 (3)[ 683.608753] vc4-drm axi:gpu: [drm:drm_atomic_check_only [drm]] checking 00000000628a0803[ 683.608805] vc4-drm axi:gpu: [drm:drm_atomic_get_private_obj_state [drm]] Added new private object 000000006868bfc5 state 000000009bdfa05a to 00000000628a0803[ 683.608856] vc4-drm axi:gpu: [drm:vc4_atomic_check [vc4]] crtc-2: Trying to find a channel.[ 683.608877] vc4-drm axi:gpu: [drm:vc4_atomic_check [vc4]] crtc-2: Already enabled, reusing channel 0.[ 683.608903] vc4-drm axi:gpu: [drm:vc6_plane_mode_set [vc4]] [PLANE:106:plane-4] Computed DLIST size: 20[ 683.608922] vc4-drm axi:gpu: [drm:vc4_plane_atomic_check [vc4]] [PLANE:106:plane-4] LBM Allocation Size: 240[ 683.608942] vc4-drm axi:gpu: [drm:vc4_hvs_atomic_check [vc4]] [CRTC:93:crtc-2] Found [PLANE:106:plane-4] with DLIST size: 20[ 683.608964] vc4-drm axi:gpu: [drm:vc4_hvs_atomic_check [vc4]] [CRTC:93:crtc-2] Allocating DLIST block with size: 21[ 683.608984] vc4-drm axi:gpu: [drm:drm_atomic_get_private_obj_state [drm]] Added new private object 00000000ffc09560 state 0000000058f90675 to 00000000628a0803[ 683.609036] vc4-drm axi:gpu: [drm:drm_atomic_nonblocking_commit [drm]] committing 00000000628a0803 nonblocking[ 683.609150] v3d 1002000000.v3d: [drm:drm_ioctl [drm]] comm="info-beamer" pid=1240, dev=0xe280, auth=1, V3D_WAIT_BO[ 683.609208] v3d 1002000000.v3d: [drm:drm_ioctl [drm]] comm="info-beamer" pid=1240, dev=0xe280, auth=1, V3D_WAIT_BO[ 683.609260] v3d 1002000000.v3d: [drm:drm_ioctl [drm]] comm="info-beamer" pid=1240, dev=0xe280, auth=1, V3D_WAIT_BO[ 683.609310] v3d 1002000000.v3d: [drm:drm_ioctl [drm]] comm="info-beamer" pid=1240, dev=0xe280, auth=1, V3D_WAIT_BO[ 683.609418] vc4-drm axi:gpu: [drm:drm_ioctl [drm]] comm="info-beamer" pid=1240, dev=0xe201, auth=1, DRM_IOCTL_PRIME_FD_TO_HANDLE[ 683.610046] vc4-drm axi:gpu: [drm:drm_gem_dma_prime_import_sg_table [drm_dma_helper]] dma_addr = 0x0000000a78000000, size = 16596992[ 683.610044] vc4-drm axi:gpu: [drm:drm_calc_timestamping_constants [drm]] crtc 93: hwmode: htotal 4400, vtotal 2250, vdisplay 2160[ 683.610069] vc4-drm axi:gpu: [drm:drm_ioctl [drm]] comm="info-beamer" pid=1240, dev=0xe201, auth=1, DRM_IOCTL_PRIME_FD_TO_HANDLE[ 683.610104] vc4-drm axi:gpu: [drm:drm_calc_timestamping_constants [drm]] crtc 93: clock 594000 kHz framedur 16666666 linedur 7407[ 683.610121] vc4-drm axi:gpu: [drm:drm_ioctl [drm]] comm="info-beamer" pid=1240, dev=0xe201, auth=1, DRM_IOCTL_MODE_ADDFB2[ 683.610177] vc4-drm axi:gpu: [drm:drm_mode_addfb2 [drm]] [FB:685][ 683.610229] vc4-drm axi:gpu: [drm:drm_ioctl [drm]] comm="info-beamer" pid=1240, dev=0xe201, auth=1, DRM_IOCTL_GEM_CLOSE[ 683.610403] allocated FB backed AVFrame 0x5555d0648170 (fb_id: 685)[ 683.610442] v3d 1002000000.v3d: [drm:drm_ioctl [drm]] comm="info-beamer" pid=1240, dev=0xe280, auth=1, V3D_WAIT_BO[ 683.610496] v3d 1002000000.v3d: [drm:drm_ioctl [drm]] comm="info-beamer" pid=1240, dev=0xe280, auth=1, V3D_WAIT_BO[ 683.610549] v3d 1002000000.v3d: [drm:drm_ioctl [drm]] comm="info-beamer" pid=1240, dev=0xe280, auth=1, V3D_WAIT_BO[ 683.610599] v3d 1002000000.v3d: [drm:drm_ioctl [drm]] comm="info-beamer" pid=1240, dev=0xe280, auth=1, V3D_WAIT_BO[ 683.610655] v3d 1002000000.v3d: [drm:drm_ioctl [drm]] comm="info-beamer" pid=1240, dev=0xe280, auth=1, V3D_SUBMIT_CL[ 683.610796] v3d 1002000000.v3d: [drm:drm_ioctl [drm]] comm="info-beamer" pid=1240, dev=0xe280, auth=1, DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD[ 683.610863] v3d 1002000000.v3d: [drm:drm_ioctl [drm]] comm="info-beamer" pid=1240, dev=0xe280, auth=1, DRM_IOCTL_SYNCOBJ_CREATE[ 683.610916] v3d 1002000000.v3d: [drm:drm_ioctl [drm]] comm="info-beamer" pid=1240, dev=0xe280, auth=1, DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE[ 683.610970] v3d 1002000000.v3d: [drm:drm_ioctl [drm]] comm="info-beamer" pid=1240, dev=0xe280, auth=1, DRM_IOCTL_SYNCOBJ_WAIT[ 683.611026] v3d 1002000000.v3d: [drm:drm_ioctl [drm]] comm="info-beamer" pid=1240, dev=0xe280, auth=1, DRM_IOCTL_SYNCOBJ_DESTROY[ 683.624172] vc4-drm axi:gpu: [drm:drm_atomic_state_default_clear [drm]] Clearing atomic state 00000000628a0803[ 683.624189] vc4-drm axi:gpu: [drm:drm_ioctl [drm]] comm="info-beamer" pid=1240, dev=0xe201, auth=1, DRM_IOCTL_MODE_RMFB[ 683.624230] [drm:drm_mode_object_put.part.0 [drm]] OBJ ID: 678 (3)[ 683.624241] [drm:drm_mode_object_put.part.0 [drm]] OBJ ID: 686 (2)[ 683.624280] [drm:drm_mode_object_put.part.0 [drm]] OBJ ID: 687 (2)[ 683.624290] [drm:drm_mode_object_put.part.0 [drm]] OBJ ID: 686 (1)[ 683.624331] vc4-drm axi:gpu: [drm:__drm_atomic_state_free [drm]] Freeing atomic state 00000000628a0803
Code:
[ 496.057567] [drm:drm_mode_object_put.part.0 [drm]] OBJ ID: 678 (3)[ 496.057578] [drm:drm_mode_object_put.part.0 [drm]] OBJ ID: 684 (2)[ 496.057605] [drm:drm_mode_object_put.part.0 [drm]] OBJ ID: 685 (2)[ 496.057616] [drm:drm_mode_object_put.part.0 [drm]] OBJ ID: 684 (1)[ 496.057643] vc4-drm axi:gpu: [drm:__drm_atomic_state_free [drm]] Freeing atomic state 0000000062baf360[ 496.058055] releasing FB backed AVFrame 0x5556182c6270 (fb_id: 684)[ 496.058100] vc4-drm axi:gpu: [drm:drm_ioctl [drm]] comm="info-beamer" pid=1177, dev=0xe201, auth=1, DRM_IOCTL_MODE_ATOMIC[ 496.058143] vc4-drm axi:gpu: [drm:drm_atomic_state_init [drm]] Allocated atomic state 00000000293b4b18[ 496.058186] [drm:drm_mode_object_get [drm]] OBJ ID: 681 (2)[ 496.058244] vc4-drm axi:gpu: [drm:drm_atomic_get_plane_state [drm]] Added [PLANE:106:plane-4] 00000000036cdaf8 state to 00000000293b4b18[ 496.058292] [drm:drm_mode_object_get [drm]] OBJ ID: 678 (2)[ 496.058334] vc4-drm axi:gpu: [drm:drm_atomic_get_crtc_state [drm]] Added [CRTC:93:crtc-2] 000000009f440e27 state to 00000000293b4b18[ 496.058373] vc4-drm axi:gpu: [drm:drm_atomic_set_fb_for_plane [drm]] Set [FB:683] for [PLANE:106:plane-4] state 00000000036cdaf8[ 496.058416] [drm:drm_mode_object_get [drm]] OBJ ID: 683 (3)[ 496.058453] [drm:drm_mode_object_put.part.0 [drm]] OBJ ID: 681 (3)[ 496.058490] [drm:drm_mode_object_put.part.0 [drm]] OBJ ID: 683 (4)[ 496.058528] [drm:drm_mode_object_put.part.0 [drm]] OBJ ID: 683 (3)[ 496.058566] vc4-drm axi:gpu: [drm:drm_atomic_check_only [drm]] checking 00000000293b4b18[ 496.058606] vc4-drm axi:gpu: [drm:drm_atomic_get_private_obj_state [drm]] Added new private object 000000006868bfc5 state 00000000aabd393c to 00000000293b4b18[ 496.058648] vc4-drm axi:gpu: [drm:vc4_atomic_check [vc4]] crtc-2: Trying to find a channel.[ 496.058673] vc4-drm axi:gpu: [drm:vc4_atomic_check [vc4]] crtc-2: Already enabled, reusing channel 0.[ 496.058696] vc4-drm axi:gpu: [drm:vc6_plane_mode_set [vc4]] [PLANE:106:plane-4] Computed DLIST size: 20[ 496.058711] vc4-drm axi:gpu: [drm:vc4_plane_atomic_check [vc4]] [PLANE:106:plane-4] LBM Allocation Size: 240[ 496.058727] vc4-drm axi:gpu: [drm:vc4_hvs_atomic_check [vc4]] [CRTC:93:crtc-2] Found [PLANE:106:plane-4] with DLIST size: 20[ 496.058746] vc4-drm axi:gpu: [drm:vc4_hvs_atomic_check [vc4]] [CRTC:93:crtc-2] Allocating DLIST block with size: 21[ 496.058765] vc4-drm axi:gpu: [drm:drm_atomic_get_private_obj_state [drm]] Added new private object 00000000ffc09560 state 00000000ae5d1a57 to 00000000293b4b18[ 496.058805] vc4-drm axi:gpu: [drm:drm_atomic_nonblocking_commit [drm]] committing 00000000293b4b18 nonblocking[ 496.058966] vc4-drm axi:gpu: [drm:drm_ioctl [drm]] comm="info-beamer" pid=1177, dev=0xe201, auth=1, DRM_IOCTL_PRIME_FD_TO_HANDLE[ 496.059465] vc4-drm axi:gpu: [drm:drm_gem_dma_prime_import_sg_table [drm_dma_helper]] dma_addr = 0x0000000a79000000, size = 16596992[ 496.059477] vc4-drm axi:gpu: [drm:drm_ioctl [drm]] comm="info-beamer" pid=1177, dev=0xe201, auth=1, DRM_IOCTL_PRIME_FD_TO_HANDLE[ 496.059516] vc4-drm axi:gpu: [drm:drm_ioctl [drm]] comm="info-beamer" pid=1177, dev=0xe201, auth=1, DRM_IOCTL_MODE_ADDFB2[ 496.059559] vc4-drm axi:gpu: [drm:drm_mode_addfb2 [drm]] [FB:684][ 496.059597] vc4-drm axi:gpu: [drm:drm_ioctl [drm]] comm="info-beamer" pid=1177, dev=0xe201, auth=1, DRM_IOCTL_GEM_CLOSE[ 496.059702] allocated FB backed AVFrame 0x5556182c6270 (fb_id: 684)[ 496.059729] vc4-drm axi:gpu: [drm:drm_calc_timestamping_constants [drm]] crtc 93: hwmode: htotal 4400, vtotal 2250, vdisplay 2160[ 496.059770] vc4-drm axi:gpu: [drm:drm_calc_timestamping_constants [drm]] crtc 93: clock 594000 kHz framedur 16666666 linedur 7407[ 496.074172] vc4-drm axi:gpu: [drm:drm_atomic_state_default_clear [drm]] Clearing atomic state 00000000293b4b18[ 496.074217] [drm:drm_mode_object_put.part.0 [drm]] OBJ ID: 678 (3)[ 496.074225] vc4-drm axi:gpu: [drm:drm_ioctl [drm]] comm="info-beamer" pid=1177, dev=0xe201, auth=1, DRM_IOCTL_MODE_RMFB[ 496.074255] [drm:drm_mode_object_put.part.0 [drm]] OBJ ID: 681 (2)[ 496.074272] [drm:drm_mode_object_put.part.0 [drm]] OBJ ID: 685 (2)[ 496.074293] vc4-drm axi:gpu: [drm:__drm_atomic_state_free [drm]] Freeing atomic state 00000000293b4b18[ 496.074311] [drm:drm_mode_object_put.part.0 [drm]] OBJ ID: 685 (1)[ 496.074721] releasing FB backed AVFrame 0x55561833bf80 (fb_id: 685)
Statistics: Posted by dividuum — Wed Dec 18, 2024 4:36 pm