Description
Describe the bug
This may not be a bug at all, sorry for reporting it as a bug, but this is a doubt closely related to a kernel line. Feel free to close if you think I'm in the wrong place.
The problem I'm experiencing is described also here: https://forums.raspberrypi.com/viewtopic.php?t=338157. I'm trying to use the DRM API to render a UI on a plane and framebuffers resulting from the decode of a 1080p@30 video on another plane below. The UI is drawn using Qt, which also sets the mode. Then, I decode a video and every frame is imported through drmPrimeFDToHandle() and a framebuffer is created with drmModeAddFB2(). The problem is with the drmModeSetPlane() function that follows, which works up to a certain dest size and then starts only returning ENOSPC. To write the code I read this: https://github.com/6by9/ffmpeg-drm/blob/master/main.c.
By looking into the vc4 driver, I see this is where the error comes from: https://github.com/raspberrypi/linux/blob/rpi-5.15.y/drivers/gpu/drm/vc4/vc4_kms.c#L644. I placed a log in there, and the value of hvs_load is 248893440 when two 1080p planes are used. 720p works fine. 1080p works only up to a certain dest size set in drmModeSetPlane(). If I remove that check it seems 1080p works well, but I guess this is considered an unacceptable load.
Is this expected? I was used to be able to render UI and a 1080p video just fine on a rpi3 with the old graphics stack based on dispmanx and oxmplayer (even fkms). It is very well possible I'm doing it wrong, but maybe someone can confirm if this is supposed to work or not. Thanks.
Steps to reproduce the behaviour
Render UI through OpenGL on a plane and repeatedly create framebuffers and set on another plane at 30fps.
Device (s)
Raspberry Pi 3 Mod. B
System
Raspberry Pi reference 2022-04-04
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 226b479f8d32919c9fe36dd5b4c20c02682f8180, stage2
Mar 24 2022 13:20:54
Copyright (c) 2012 Broadcom
version e5a963efa66a1974127860b42e913d2374139ff5 (clean) (release) (start)
Linux raspberrypi 5.15.56-v7+ #1 SMP Fri Jul 29 19:29:51 BST 2022 armv7l GNU/Linux
(this kernel is self-built to investigate the issue, but the behavior was identical with the original kernel)
Logs
I collected this: https://pastebin.com/kWYYLqke.
The errors I receive in userspace are probably these:
[ 1594.449130] [drm:drm_atomic_check_only [drm]] atomic driver check for 77bab436 failed: -28
Additional context
No response