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.

@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.

@6by9

6by9 commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Please note that I would not be able to take these upstream with only Signed-off-by: Roy <rongh7426@gmail.com>.
See https://www.kernel.org/doc/html/latest/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-origin
The requirement is for a "known identity", and I don't believe only a first name and email will be considered sufficient.

It's slightly moot as mainline doesn't have these extra planes for the writeback connector, but it's easier to be clean across the board for drivers that are in mainline.

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. The other CRTCs keep
VC4_NUM_OVERLAY_PLANES + 1.

Fixes: fda2f62 ("drm/vc4: Fix the zpos range of the writeback overlay planes")
Signed-off-by: Lin Tzu Yang <rongh7426@gmail.com>
@YORROY123
YORROY123 force-pushed the vc4-txp-cursor-zpos branch from d552653 to 1e7310b Compare December 1, 2026 11:05
@YORROY123

Copy link
Copy Markdown
Contributor Author

Updated per review:

  • dropped the comment above max_zpos
  • Fixes: now points to fda2f62
  • shorter commit message; test details and the AI note moved here
  • author and Signed-off-by now use my full name, Lin Tzu Yang

The code is unchanged apart from the removed comment.

Testing (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

This change was written with the help of an AI coding assistant (Claude); the testing above was done on real hardware.

@6by9

6by9 commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Thanks for the updates - it looks good to me.

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