Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drm/vc4: Rework UPM allocation to avoid double buffering #6385

Open
wants to merge 4 commits into
base: rpi-6.6.y
Choose a base branch
from

Conversation

6by9
Copy link
Contributor

@6by9 6by9 commented Sep 25, 2024

The previous UPM allocation was done per plane state, when there is no overlap of usage between frames.

Allocate per plane, and only change the allocation if the required size changes. We have to reference count as plane states can be duplicated.

@6by9 6by9 force-pushed the rpi-6.6.y-drm2 branch 4 times, most recently from 3c45267 to 21bec0f Compare September 27, 2024 16:00
The previous UPM allocation was done per plane state, when
there is no overlap of usage between frames.

Allocate per plane, and only change the allocation if the required
size changes. We have to reference count as plane states can
be duplicated.

Signed-off-by: Dave Stevenson <[email protected]>
LBM is only relevant for each active dlist, so there is
no need to double-buffer the allocations.

Cache the allocations per plane so that we can ensure the
allocations are possible.

Signed-off-by: Dave Stevenson <[email protected]>
Seeing as it is userspace that creates the state and commit that
is validated, drop the log messages to debug to avoid userspace
being able to totally spam the kernel log.

Signed-off-by: Dave Stevenson <[email protected]>
@6by9 6by9 marked this pull request as ready for review September 30, 2024 16:13
@6by9
Copy link
Contributor Author

6by9 commented Sep 30, 2024

These patches are now cleanly rejecting commits that exceed LBM or UPM limits. We reuse the allocations if they are of the same size as the previous user of the plane, but will allocate a new buffer when it changes (that will double buffer, but it is a relatively rare event to have significant changes).

Probably hold off merging until the stable image has been bumped, but review comments welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant