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

Merged
merged 4 commits into from
Oct 10, 2024

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 <dave.stevenson@raspberrypi.com>
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 <dave.stevenson@raspberrypi.com>
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 <dave.stevenson@raspberrypi.com>
@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.

@dividuum
Copy link

FYI: I've been running this version for a while now and everything seems to work nicely even when giving it quite a beating by shuffling a lot of DRM planes around.

@pelwell
Copy link
Contributor

pelwell commented Oct 10, 2024

Any objections to merging now?

@6by9
Copy link
Contributor Author

6by9 commented Oct 10, 2024

FYI: I've been running this version for a while now and everything seems to work nicely even when giving it quite a beating by shuffling a lot of DRM planes around.

Great. Thanks for testing.

Any objections to merging now?

Assuming all the apt updating is done and we're happy, then go for it.

@pelwell
Copy link
Contributor

pelwell commented Oct 10, 2024

Given that the last release included a cherry-pick, I think we're essentially past the freeze point.

@pelwell pelwell merged commit c3fa174 into raspberrypi:rpi-6.6.y Oct 10, 2024
11 of 12 checks passed
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Oct 10, 2024
kernel: dts: 2712: Reduce default cma usage on Pi5
See: raspberrypi/linux#6361

kernel: drm/v3d,vc4: Stop the active perfmon before being destroyed
See: raspberrypi/linux#6401

kernel: mmc: sd: disable sd cqhci by default
See: raspberrypi/linux#6405

kernel: drm/vc4: Rework UPM allocation to avoid double buffering
See: raspberrypi/linux#6385

kernel: dts: bcm2712d0: Add non-d0 vc6 compatible string
See: raspberrypi/linux#6408
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Oct 10, 2024
kernel: dts: 2712: Reduce default cma usage on Pi5
See: raspberrypi/linux#6361

kernel: drm/v3d,vc4: Stop the active perfmon before being destroyed
See: raspberrypi/linux#6401

kernel: mmc: sd: disable sd cqhci by default
See: raspberrypi/linux#6405

kernel: drm/vc4: Rework UPM allocation to avoid double buffering
See: raspberrypi/linux#6385

kernel: dts: bcm2712d0: Add non-d0 vc6 compatible string
See: raspberrypi/linux#6408
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.

3 participants