Hi there.
I'm currently reworking my software info-beamer to now fully embrace the KMS/DRM/FFmpeg future. Looking quite good so far, but I've run into an issue where I might need some insight. I'm using DRM atomic commits and this particular problem occurs when I use two FullHD displays. On each CRTC I've assigned one GL backed plane and one plane containing a decoded video frame from a 4K video. The layout looks like follows. The GL framebuffer is 3840x1080, the video frame's framebuffer is 4K, so 3840x2160:
This triggers the following atomic updates that are successfully applied:
In dmesg (using /sys/module/drm/parameters/debug) I see:
For the next output frame I'm trying to switch the zpos ordering of the GL plane and the video planes to put the GL layer in front of the video. The resulting assignment looks like this:
The updated fb_ids are the result of the next video frame/next GL page flip. The resulting atomic updates look like this:
To pick one example of a change made here: plane 78, which during the previous period displayed frame buffer 307, a 1920x1080 view into the GL layer with a size of 3840x1080 is now updated to show the next video frame in frame buffer 308 (which is a view of 1920x1080 into a 3840x2160 video frame).
This commit fails. dmesg shows:
The output is rather similar, but then abruptly results in "Failed to allocate UPM entry: -28" and the commit fails. The total number of pixels to output hasn't changed. Any idea what might cause this?
I'm currently reworking my software info-beamer to now fully embrace the KMS/DRM/FFmpeg future. Looking quite good so far, but I've run into an issue where I might need some insight. I'm using DRM atomic commits and this particular problem occurs when I use two FullHD displays. On each CRTC I've assigned one GL backed plane and one plane containing a decoded video frame from a 4K video. The layout looks like follows. The GL framebuffer is 3840x1080, the video frame's framebuffer is 4K, so 3840x2160:
Code:
[surface_kms.c] placed layer_idx=0 (GL) fb_id:307 on plane_idx=2 (plane_id=78, zpos=0)[surface_kms.c] placed layer_idx=1 (GL) fb_id:307 on plane_idx=3 (plane_id=89, zpos=0)[surface_kms.c] placed layer_idx=2 (Raw Video (display 0)) fb_id:304 on plane_idx=4 (plane_id=100, zpos=1)[surface_kms.c] placed layer_idx=3 (Raw Video (display 1)) fb_id:304 on plane_idx=5 (plane_id=110, zpos=1)
Code:
atomic (plane->plane_id) 78 (plane->FB_ID) 17 (layer->fb_id) 307atomic (plane->plane_id) 78 (plane->CRTC_ID) 20 (layer->crtc_id) 88atomic (plane->plane_id) 89 (plane->FB_ID) 17 (layer->fb_id) 307atomic (plane->plane_id) 89 (plane->CRTC_ID) 20 (layer->crtc_id) 99atomic (plane->plane_id) 100 (plane->FB_ID) 17 (layer->fb_id) 304atomic (plane->plane_id) 100 (plane->CRTC_ID) 20 (layer->crtc_id) 88atomic (plane->plane_id) 110 (plane->FB_ID) 17 (layer->fb_id) 304atomic (plane->plane_id) 110 (plane->CRTC_ID) 20 (layer->crtc_id) 99
Code:
[ 9329.704513] vc4-drm axi:gpu: [drm:drm_atomic_state_init [drm]] Allocated atomic state 00000000d7cb32e7[ 9329.704662] vc4-drm axi:gpu: [drm:drm_atomic_get_plane_state [drm]] Added [PLANE:78:plane-2] 000000002db8aa69 state to 00000000d7cb32e7[ 9329.704745] vc4-drm axi:gpu: [drm:drm_atomic_get_crtc_state [drm]] Added [CRTC:88:crtc-2] 0000000075b9bbd4 state to 00000000d7cb32e7[ 9329.704782] vc4-drm axi:gpu: [drm:drm_atomic_set_fb_for_plane [drm]] Set [FB:307] for [PLANE:78:plane-2] state 000000002db8aa69[ 9329.705007] vc4-drm axi:gpu: [drm:drm_atomic_get_plane_state [drm]] Added [PLANE:89:plane-3] 00000000ed065994 state to 00000000d7cb32e7[ 9329.705082] vc4-drm axi:gpu: [drm:drm_atomic_get_crtc_state [drm]] Added [CRTC:99:crtc-3] 000000003e8b5328 state to 00000000d7cb32e7[ 9329.705120] vc4-drm axi:gpu: [drm:drm_atomic_set_fb_for_plane [drm]] Set [FB:307] for [PLANE:89:plane-3] state 00000000ed065994[ 9329.705383] vc4-drm axi:gpu: [drm:drm_atomic_get_plane_state [drm]] Added [PLANE:100:plane-4] 00000000dbaeb5ca state to 00000000d7cb32e7[ 9329.705420] vc4-drm axi:gpu: [drm:drm_atomic_set_fb_for_plane [drm]] Set [FB:304] for [PLANE:100:plane-4] state 00000000dbaeb5ca[ 9329.705652] vc4-drm axi:gpu: [drm:drm_atomic_get_plane_state [drm]] Added [PLANE:110:plane-5] 00000000e34a0b5b state to 00000000d7cb32e7[ 9329.705689] vc4-drm axi:gpu: [drm:drm_atomic_set_fb_for_plane [drm]] Set [FB:304] for [PLANE:110:plane-5] state 00000000e34a0b5b[ 9329.705866] vc4-drm axi:gpu: [drm:drm_atomic_check_only [drm]] checking 00000000d7cb32e7[ 9329.705909] vc4-drm axi:gpu: [drm:drm_atomic_get_private_obj_state [drm]] Added new private object 00000000f3a849ca state 000000007939ee6c to 00000000d7cb32e7[ 9329.705950] vc4-drm axi:gpu: [drm:vc4_atomic_check [vc4]] crtc-2: Trying to find a channel.[ 9329.705981] vc4-drm axi:gpu: [drm:vc4_atomic_check [vc4]] crtc-2: Already enabled, reusing channel 0.[ 9329.705996] vc4-drm axi:gpu: [drm:vc4_atomic_check [vc4]] crtc-3: Trying to find a channel.[ 9329.706011] vc4-drm axi:gpu: [drm:vc4_atomic_check [vc4]] crtc-3: Already enabled, reusing channel 1.[ 9329.706039] vc4-drm axi:gpu: [drm:vc4_plane_atomic_check [vc4]] [PLANE:78:plane-2] Computed DLIST size: 9[ 9329.706060] vc4-drm axi:gpu: [drm:vc4_plane_atomic_check [vc4]] [PLANE:89:plane-3] Computed DLIST size: 9[ 9329.706078] vc4-drm axi:gpu: [drm:vc4_plane_atomic_check [vc4]] [PLANE:100:plane-4] Computed DLIST size: 20[ 9329.706092] vc4-drm axi:gpu: [drm:vc4_plane_atomic_check [vc4]] [PLANE:100:plane-4] LBM Allocation Size: 120[ 9329.706108] vc4-drm axi:gpu: [drm:vc4_plane_atomic_check [vc4]] [PLANE:110:plane-5] Computed DLIST size: 20[ 9329.706123] vc4-drm axi:gpu: [drm:vc4_plane_atomic_check [vc4]] [PLANE:110:plane-5] LBM Allocation Size: 120[ 9329.706143] vc4-drm axi:gpu: [drm:vc4_hvs_atomic_check [vc4]] [CRTC:88:crtc-2] Found [PLANE:78:plane-2] with DLIST size: 9[ 9329.706157] vc4-drm axi:gpu: [drm:vc4_hvs_atomic_check [vc4]] [CRTC:88:crtc-2] Found [PLANE:100:plane-4] with DLIST size: 20[ 9329.706175] vc4-drm axi:gpu: [drm:vc4_hvs_atomic_check [vc4]] [CRTC:88:crtc-2] Allocating DLIST block with size: 30[ 9329.706194] vc4-drm axi:gpu: [drm:vc4_hvs_atomic_check [vc4]] [CRTC:99:crtc-3] Found [PLANE:89:plane-3] with DLIST size: 9[ 9329.706209] vc4-drm axi:gpu: [drm:vc4_hvs_atomic_check [vc4]] [CRTC:99:crtc-3] Found [PLANE:110:plane-5] with DLIST size: 20[ 9329.706223] vc4-drm axi:gpu: [drm:vc4_hvs_atomic_check [vc4]] [CRTC:99:crtc-3] Allocating DLIST block with size: 30 [ 9329.706241] vc4-drm axi:gpu: [drm:drm_atomic_get_private_obj_state [drm]] Added new private object 00000000306a2d4b state 000000009f37de96 to 00000000d7cb32e7[ 9329.706282] vc4-drm axi:gpu: [drm:drm_atomic_commit [drm]] committing 00000000d7cb32e7
For the next output frame I'm trying to switch the zpos ordering of the GL plane and the video planes to put the GL layer in front of the video. The resulting assignment looks like this:
Code:
[surface_kms.c] placed layer_idx=2 (Raw Video (display 0)) fb_id:308 on plane_idx=2 (plane_id=78, zpos=0)[surface_kms.c] placed layer_idx=3 (Raw Video (display 1)) fb_id:308 on plane_idx=3 (plane_id=89, zpos=0)[surface_kms.c] placed layer_idx=0 (GL) fb_id:302 on plane_idx=4 (plane_id=100, zpos=1)[surface_kms.c] placed layer_idx=1 (GL) fb_id:302 on plane_idx=5 (plane_id=110, zpos=1)
Code:
atomic (plane->plane_id) 100 (plane->FB_ID) 17 (layer->fb_id) 302atomic (plane->plane_id) 100 (plane->CRTC_ID) 20 (layer->crtc_id) 88atomic (plane->plane_id) 110 (plane->FB_ID) 17 (layer->fb_id) 302atomic (plane->plane_id) 110 (plane->CRTC_ID) 20 (layer->crtc_id) 99atomic (plane->plane_id) 78 (plane->FB_ID) 17 (layer->fb_id) 308atomic (plane->plane_id) 78 (plane->CRTC_ID) 20 (layer->crtc_id) 88atomic (plane->plane_id) 89 (plane->FB_ID) 17 (layer->fb_id) 308atomic (plane->plane_id) 89 (plane->CRTC_ID) 20 (layer->crtc_id) 99
This commit fails. dmesg shows:
Code:
[ 9329.721049] vc4-drm axi:gpu: [drm:drm_atomic_state_init [drm]] Allocated atomic state 000000003c9f4441[ 9329.721138] vc4-drm axi:gpu: [drm:drm_atomic_get_plane_state [drm]] Added [PLANE:78:plane-2] 0000000013a54b16 state to 000000003c9f4441[ 9329.721226] vc4-drm axi:gpu: [drm:drm_atomic_get_crtc_state [drm]] Added [CRTC:88:crtc-2] 00000000c34626b3 state to 000000003c9f4441[ 9329.721263] vc4-drm axi:gpu: [drm:drm_atomic_set_fb_for_plane [drm]] Set [FB:308] for [PLANE:78:plane-2] state 0000000013a54b16[ 9329.721496] vc4-drm axi:gpu: [drm:drm_atomic_get_plane_state [drm]] Added [PLANE:89:plane-3] 000000008a20f3d3 state to 000000003c9f4441[ 9329.721568] vc4-drm axi:gpu: [drm:drm_atomic_get_crtc_state [drm]] Added [CRTC:99:crtc-3] 00000000d4184a5d state to 000000003c9f4441[ 9329.721604] vc4-drm axi:gpu: [drm:drm_atomic_set_fb_for_plane [drm]] Set [FB:308] for [PLANE:89:plane-3] state 000000008a20f3d3[ 9329.721816] vc4-drm axi:gpu: [drm:drm_atomic_get_plane_state [drm]] Added [PLANE:100:plane-4] 0000000070b8c345 state to 000000003c9f4441[ 9329.721852] vc4-drm axi:gpu: [drm:drm_atomic_set_fb_for_plane [drm]] Set [FB:302] for [PLANE:100:plane-4] state 0000000070b8c345[ 9329.722065] vc4-drm axi:gpu: [drm:drm_atomic_get_plane_state [drm]] Added [PLANE:110:plane-5] 00000000f198652b state to 000000003c9f4441[ 9329.722101] vc4-drm axi:gpu: [drm:drm_atomic_set_fb_for_plane [drm]] Set [FB:302] for [PLANE:110:plane-5] state 00000000f198652b[ 9329.722278] vc4-drm axi:gpu: [drm:drm_atomic_check_only [drm]] checking 000000003c9f4441[ 9329.722317] vc4-drm axi:gpu: [drm:drm_atomic_get_private_obj_state [drm]] Added new private object 00000000f3a849ca state 00000000255b1b9b to 000000003c9f4441[ 9329.722354] vc4-drm axi:gpu: [drm:vc4_atomic_check [vc4]] crtc-2: Trying to find a channel.[ 9329.722374] vc4-drm axi:gpu: [drm:vc4_atomic_check [vc4]] crtc-2: Already enabled, reusing channel 0.[ 9329.722388] vc4-drm axi:gpu: [drm:vc4_atomic_check [vc4]] crtc-3: Trying to find a channel.[ 9329.722402] vc4-drm axi:gpu: [drm:vc4_atomic_check [vc4]] crtc-3: Already enabled, reusing channel 1.[ 9329.722426] vc4-drm axi:gpu: [drm:vc4_plane_atomic_check [vc4]] [PLANE:78:plane-2] Computed DLIST size: 20[ 9329.722441] vc4-drm axi:gpu: [drm:vc4_plane_atomic_check [vc4]] [PLANE:78:plane-2] LBM Allocation Size: 120[ 9329.722460] vc4-drm axi:gpu: [drm:vc4_plane_atomic_check [vc4]] [PLANE:89:plane-3] Computed DLIST size: 20[ 9329.722475] vc4-drm axi:gpu: [drm:vc4_plane_atomic_check [vc4]] [PLANE:89:plane-3] LBM Allocation Size: 120[ 9329.722491] vc4-drm axi:gpu: [drm:vc4_plane_atomic_check [vc4]] [PLANE:100:plane-4] Computed DLIST size: 9[ 9329.722506] vc4-drm axi:gpu: [drm:vc4_plane_atomic_check [vc4]] [PLANE:110:plane-5] Computed DLIST size: 9[ 9329.722521] vc4-drm axi:gpu: [drm] *ERROR* Failed to allocate UPM entry: -28[ 9329.722523] vc4-drm axi:gpu: [drm:drm_atomic_helper_check_planes [drm_kms_helper]] [PLANE:110:plane-5] atomic driver check failed
Statistics: Posted by dividuum — Mon Jan 15, 2024 1:45 pm