Repository navigation
drm/vc4: Fix the zpos range of the writeback overlay planes - #7800
Conversation
The VC4_NUM_TXP_OVERLAY_PLANES (32) overlay planes for the writeback CRTC are created with a default zpos of i + 1, so 1 to 32, but with the zpos range of the normal overlay planes, 1 to VC4_NUM_OVERLAY_PLANES + 1 (17). Planes 17 to 31 of that loop therefore start with a zpos outside their own range, and writing the current value back fails with EINVAL. On a Pi 5, 15 of the 56 planes have a zpos above their maximum, and the igt test kms_properties fails on it: (kms_properties) CRITICAL: Failed assertion: value <= values[1] (kms_properties) CRITICAL: error: 0x12 > 0x11 Subtest get_properties-sanity-non-atomic: FAIL Subtest get_properties-sanity-atomic: FAIL Use VC4_NUM_TXP_OVERLAY_PLANES + 1 as the maximum for those planes. Tested on a Pi 5 (6.18.39) with the patched vc4 module loaded from the initramfs: - planes with a zpos outside their range: 15 of 56 -> 0 of 56 - kms_properties: 8 pass / 2 fail -> 10 pass / 0 fail - the other KMS tests run (kms_atomic, kms_addfb_basic, kms_getfb, kms_prop_blob, kms_lease, kms_writeback, kms_atomic_transition, ...) give the same results as before. kms_flip has the same set of timing-dependent failures on HDMI-A-1 with and without this change; each of those subtests passes and fails on reruns. The failure was found with igt-gpu-tools. The fix and this changelog were written with the help of an AI coding assistant (Claude), and the testing above was run on real hardware. Fixes: 5c85a4b ("drm/vc4: Assign 32 overlay planes to writeback only") Signed-off-by: Roy <rongh7426@gmail.com>
Review: drm/vc4: Fix the zpos range of the writeback overlay planes (#7800)Looks correct. The 32 writeback overlay planes get a default zpos of 1..32 but a max of 17, so the default is out of range for 15 of them. Raising the max to Optional follow-up: the writeback CRTC's cursor plane still has a zpos range of 1.. Minor: the copied comment "Max of all the overlays + 1 primary + 1 cursor plane" now matches the code for the writeback loop, but only if the cursor change above is made too. |
6by9
left a comment
There was a problem hiding this comment.
Yup, it's correct.
Commit texts don't need the information about how you've tested it, nor any AI attribution these days. For future patches please put that detail in the PR conversation, or for upstream it would be in the cover letter.
The 32 writeback (TXP) overlay planes added in 5c85a4b get a default zpos of i + 1 (1..32), but their zpos range is still 1..VC4_NUM_OVERLAY_PLANES + 1 (17). So 15 of them start outside their own range, and reading the value back and setting it again fails with EINVAL.
On a Pi 5 this makes igt
kms_propertiesfail:The fix uses VC4_NUM_TXP_OVERLAY_PLANES + 1 as the maximum for those planes (one line).
Tested on a Pi 5, 6.18.39, with the patched vc4 module loaded from the initramfs:
The fix and description were written with help from an AI coding assistant (Claude); the testing was done on real hardware.