-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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: Add 2712 support to vc4_plane_async_set_fb #5827
Conversation
* atomic updates that don't do a new modeset on our plane | ||
* also use our updated address. | ||
*/ | ||
vc4_state->dlist[vc4_state->ptr0_offset[0]] = addr; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's surprising there isn't a helper function to update hw_dlist
and the shadow dlist
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This it the only place that the dlist gets mangled in this way.
The fragments for each plane get created in vc[46]_plane_set_mode.
vc4_hvs_atomic_flush then assembles the fragments into a complete list in the dlist memory.
This async update is the only place that does both in one hit.
Reviewing the code it feels a little fragile based on a number of major assumptions.
AIUI it only works on the primary plane, which would normally be the bottom-most but that isn't guaranteed. vc4_state->ptr0_offset[0] is the offset within the fragment, so it only works as long as it is the bottom-most plane and hence first in the dlist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's also this:
linux/drivers/gpu/drm/vc4/vc4_plane.c
Lines 2170 to 2186 in e2020fe
vc4_state->dlist[vc4_state->pos0_offset] = | |
new_vc4_state->dlist[vc4_state->pos0_offset]; | |
vc4_state->dlist[vc4_state->pos2_offset] = | |
new_vc4_state->dlist[vc4_state->pos2_offset]; | |
vc4_state->dlist[vc4_state->ptr0_offset[0]] = | |
new_vc4_state->dlist[vc4_state->ptr0_offset[0]]; | |
/* Note that we can't just call vc4_plane_write_dlist() | |
* because that would smash the context data that the HVS is | |
* currently using. | |
*/ | |
writel(vc4_state->dlist[vc4_state->pos0_offset], | |
&vc4_state->hw_dlist[vc4_state->pos0_offset]); | |
writel(vc4_state->dlist[vc4_state->pos2_offset], | |
&vc4_state->hw_dlist[vc4_state->pos2_offset]); | |
writel(vc4_state->dlist[vc4_state->ptr0_offset[0]], | |
&vc4_state->hw_dlist[vc4_state->ptr0_offset[0]]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As amending that one needs to be a separate patch that is ideally applied before any 2712 stuff starts to be merged, can I take it as a task to be dealt with in the mainline patches?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course.
073fcf2
to
2256ccc
Compare
@6by9 I've tested your branch recently and it does fix the issue at hand. I've added some more info to the issue report...the corruption happens when vsync is disabled only. |
vc4_plane_async_set_fb directly overwrites the plane address in the dlist entry, but hadn't been updated for the GEN6 / 2712 dlist format, corrupting the address in the process. Add support for the 2712 dlist format to the function. Fixes: 1ab1fbb ("drm/vc4: hvs: Support BCM2712 HVS") Signed-off-by: Dave Stevenson <[email protected]>
Had missed that I hadn't updated this after the review comments. |
Are we planning on another 6.1 release, and hence does this warrant a backport to 6.1? |
Yes we are, and yes it does. We need to bump the 6.1 stable so that it gets feature parity with the upcoming 6.6 stable. |
OK, I'll create a backport PR. Checking the email thread with Igalia, there's a 2nd cleanup required in the async path too, but less critical. |
See: raspberrypi/linux#5827 kernel: drm/vc4: Fix atomic_async_check to call the right mode_set function See: raspberrypi/linux#5860
See: raspberrypi/linux#5827 kernel: drm/vc4: Fix atomic_async_check to call the right mode_set function See: raspberrypi/linux#5860
vc4_plane_async_set_fb directly overwrites the plane address in the dlist entry, but hadn't been updated for the GEN6 / 2712 dlist format, corrupting the address in the process.
Add support for the 2712 dlist format to the function.
Fixes: 1ab1fbb ("drm/vc4: hvs: Support BCM2712 HVS")