Skip to content

drm/vc4: Give the writeback cursor plane the full zpos range - #7807

Open
YORROY123 wants to merge 1 commit into
raspberrypi:rpi-6.18.yfrom
YORROY123:vc4-txp-cursor-zpos
Open

YORROY123 wants to merge 1 commit into
raspberrypi:rpi-6.18.yfrom
YORROY123:vc4-txp-cursor-zpos

Conversation

@YORROY123

Copy link
Copy Markdown
Contributor

Follow-up to #7800, as suggested by @popcornmix in its review.

After #7800 the 32 writeback overlay planes have a zpos range of 1..33, but the cursor plane on the writeback CRTC was still created with zpos 17 and a maximum of 17, so overlays at 18..33 sat above it and it couldn't be moved on top. This gives the cursor on the writeback CRTC a default and maximum zpos of VC4_NUM_TXP_OVERLAY_PLANES + 1; the other CRTCs keep VC4_NUM_OVERLAY_PLANES + 1.

Tested on a Pi 5 (6.18.39, vc4 module with #7800 and this change, loaded from the initramfs):

  • writeback cursor plane: zpos 17, range 1..17 before; zpos 33, range 1..33 after
  • the other three cursor planes unchanged (17, 1..17)
  • 0 of 56 planes with a zpos outside their range
  • igt kms_properties 10/0; kms_writeback, kms_atomic, kms_plane_multiple and kms_cursor_legacy give the same results as before

The change and description were written with help from an AI coding assistant (Claude); the testing was done on real hardware.

Commit fda2f62 ("drm/vc4: Fix the zpos range of the writeback
overlay planes") raised the zpos range of the 32 writeback overlay
planes to 1..VC4_NUM_TXP_OVERLAY_PLANES + 1 (33), but every CRTC's
cursor plane is still created with a zpos and maximum of
VC4_NUM_OVERLAY_PLANES + 1 (17). On the writeback CRTC, overlays with a
zpos from 18 to 33 therefore sit above the cursor, and the cursor can't
be moved on top of them.

Use VC4_NUM_TXP_OVERLAY_PLANES + 1 as the default and maximum zpos of
the cursor plane on the writeback CRTC, so it starts on top again as it
does on the other CRTCs. The other CRTCs keep
VC4_NUM_OVERLAY_PLANES + 1.

Tested on a Raspberry Pi 5 (6.18.39, vc4 module with fda2f62 and
this change, loaded from the initramfs):
- writeback CRTC cursor plane: zpos 17, range 1..17 before; zpos 33,
  range 1..33 after
- the cursor planes of the other three CRTCs are unchanged (17, 1..17)
- no plane has a zpos outside its range (0 of 56)
- igt kms_properties 10 pass / 0 fail; kms_writeback, kms_atomic,
  kms_plane_multiple and kms_cursor_legacy give the same results as
  before

Suggested by popcornmix in the review of raspberrypi#7800. This change and its
description were written with the help of an AI coding assistant
(Claude); the testing above was done on real hardware.

Fixes: 5c85a4b ("drm/vc4: Assign 32 overlay planes to writeback only")
Signed-off-by: Roy <rongh7426@gmail.com>
@popcornmix

Copy link
Copy Markdown
Collaborator

Thanks. Claude has a few minors:

Looks correct to me. Now the cursor on the writeback CRTC uses the same zpos range as that CRTC's overlays (1..33), as I suggested in #7800.

Small points:

  • The new comment (/* The writeback CRTC has its own, larger set of overlays */) isn't needed: the code already says this.
  • Fixes: points to 5c85a4b. The cursor was only limited below the overlays once fda2f62 raised their range, so Fixes: fda2f62fe65e ("drm/vc4: Fix the zpos range of the writeback overlay planes") seems more accurate.
  • checkpatch: ERROR: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' for the "with fda2f62 and" line in the testing paragraph.
  • The commit message could be shorter. The test details and the AI note are better kept in the PR description than in the commit.

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.

2 participants