Skip to content

Draw a legacy cursor into the buffer that is not on screen - #134

Merged
jwinarske merged 1 commit into
mainfrom
cursor-legacy-two-buffers
Nov 17, 2026
Merged

jwinarske merged 1 commit into
mainfrom
cursor-legacy-two-buffers

Conversation

@jwinarske

@jwinarske jwinarske commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

On the legacy cursor path the sprite was redrawn into the one buffer on screen: on every move near the top and left edges (the edge shift), and for each frame of an animation. A VisionFive 2's display controller shows that as a broken-up cursor near those two edges; the right and bottom edges and the middle are fine.

  • The legacy path keeps two buffers, draws into the one not installed, and installs it
  • An animation's next frame is installed too
  • PingPong::single stays public and is no longer used by the renderer

Seen on the VisionFive 2 by a person, through fl-engine built against this branch: clean at the top and left edges and in the corner, wait and progress animating cleanly, and a capture of the cursor in the corner clean.

No device test tells the two buffers apart on vkms: the kernel makes a new framebuffer for every drmModeSetCursor, whichever handle it is given.

The legacy path had one buffer, on the reasoning that drmModeSetCursor
takes one handle and has no flip to alternate on. But a sprite is
redrawn while it is shown: an animation's next frame, and near the top
and left edges of the CRTC on every move, where it is drawn shifted
inside its buffer so the plane need not start off screen. Those redraws
went into the buffer being scanned out.

On a VisionFive 2, whose display controller reads the cursor's buffer
as it scans, the cursor broke up whenever the pointer was near the top
or left edge and came back away from them; the right and bottom edges,
where nothing is redrawn, were fine. A Raspberry Pi 5's vc4 did not
show it.

The legacy path keeps two buffers now, as the atomic paths do. A redraw
goes into the one that is not installed, and installing it with
drmModeSetCursor is the switch. An animation's frame marks the cursor
for installing as well: before, a driver that copies the buffer when it
is set would have gone on showing the first frame.

PingPong::single stays for a caller with one buffer; the renderer no
longer uses it.

Review: one more dumb buffer of the cursor's size a renderer, which
allocate_pair was already making and the legacy path left unused. No
new ioctl; set_cursor is called where it was, with the other handle.

Signed-off-by: Joel Winarske <joel.winarske@linux.com>
@jwinarske
jwinarske marked this pull request as ready for review November 17, 2026 19:37
@jwinarske
jwinarske merged commit 8cb6c9f into main Nov 17, 2026
10 checks passed
@jwinarske
jwinarske deleted the cursor-legacy-two-buffers branch November 17, 2026 19:49
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.

1 participant