Skip to content

A display that takes no buffer of the renderer's gets buffers of its own card's - #27

Merged
jwinarske merged 11 commits into
mainfrom
kms-gbm-ring
Nov 17, 2026
Merged

jwinarske merged 11 commits into
mainfrom
kms-gbm-ring

Conversation

@jwinarske

@jwinarske jwinarske commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

The VisionFive 2's first run on its display, and what it needed.

  • GBM ring. The board's display controller (card0, VeriSilicon) is a card apart from its GPU (card1, PowerVR) and refuses the renderer's dma-buf: importing a buffer: Function not implemented. fl-raster still tries the renderer's own ring first; where that is refused it uses emblema's DrmScanoutTarget::with_gbm, buffers allocated on the display's card and imported by the renderer. Display says which card is its own (ScanoutOutput::device_fd). libgbm is opened at run time for that ring only, through drmkit-gbm; nothing more is linked
  • run-app --kms --mode WxH[@HZ]. One of the display's own modes by size, at the nearest rate or the fastest. The monitor's preferred mode is 3840x2160 at 30 Hz and the board shows a frame there in two or three blanks. run.sh --mode passes it on
  • Docs. m4-status.md has the run; m1-exit.md closes its last open criterion, both boards having run the kit with 0 failed

On the board (Ubuntu 24.04.3, Linux 6.12.5-starfive, the cross lane's kit from this PR):

./run.sh --mode 1280x720
...
PASS  M2-4  300 frames on card=/dev/dri/card0 mode=1280x720@60.000: 299 flips, 0 blanks missed
10 passed, 0 failed, 0 skipped

That is with the CPU's governor at performance. Under the image's ondemand one frame in twelve takes two blanks (299 flips over 324).

  • A switch of terminals under an app at rest. Ctrl+Alt+F2 and back left the console on the screen when the app had nothing new to draw. The session's coming back now has the last frame drawn again, and the display notices a switch it was not watching. Seen on both boards, the display read back after the switch
  • A run with --frames exits. The redraw hook held the raster thread's channel open; the thread is now told to end

Seen on that board since, with a keyboard and a mouse plugged in: 243 keys, clicks, moves, 209 wheel notches, all 35 cursors, a capture by Print Screen, a terminal switch away and back.

Open: the cursor is sometimes noise when it first appears on that board, until the mouse moves further (#29); two changes were tried for it on the board and neither is kept. counter runs at about 20 frames a second there; ticker holds 60.

Unit test for the mode choice; the Pi 5's path (the renderer's own ring) is the first one tried and is unchanged.

…own card's

- a VisionFive 2's display controller is a card apart from its GPU, and
  importing the renderer's dma-buf into it is refused: "importing a
  buffer: Function not implemented". No frame was shown
- fl-raster's scanout tries the renderer's own ring first, as before,
  and where that is refused asks emblema for one whose buffers GBM
  allocates on the display's card, which the renderer imports and draws
  into (DrmScanoutTarget::with_gbm). Both refusals are said if neither
  works
- the display says which card is its own (ScanoutOutput::device_fd)
- emblema-present-drm's `gbm` feature, through drmkit-gbm: libgbm is
  opened at run time when that ring is asked for, not linked, so a
  board without it runs as before
- review: the card's descriptor is duplicated for the ring and closed
  with it; a ring is rebuilt after a terminal switch on the card's new
  descriptor. One crate more in the kms build, drmkit-gbm, pure Rust

Signed-off-by: Joel Winarske <joel.winarske@linux.com>
- run-app --kms --mode WxH[@hz]: one of the display's own modes of that
  size, at the rate nearest the one said or its fastest. A display's
  preferred mode can be more than a board draws at: a VisionFive 2 on a
  3840x2160 monitor showed a frame in three blanks
- a size the display has not is an error that lists the sizes it has
- the mode asked for is kept for the card opened again after a switch
  of terminals
- board kit: run.sh --mode passes it to the display's and the devices'
  checks
- review: the size and rate are parsed as numbers and matched against
  the kernel's list, never set as timings of their own

Signed-off-by: Joel Winarske <joel.winarske@linux.com>
…p and 60 Hz

- docs/m4-status.md: the second board. Its display controller takes no
  buffer of the renderer's, so the ring is GBM's; its monitor's own
  mode, 3840x2160, is more than it draws at; at 1280x720 and 60 Hz no
  blank is missed once the CPU's governor is `performance`, and one
  frame in twelve takes two under the image's `ondemand`
- docs/m1-exit.md: both boards have run the kit with 0 failed, which
  closes exit criterion 2, the last one open. The VisionFive 2's report
  is there
- docs/m4-exit.md, README, CHANGELOG: the board as run. Its devices are
  what is left: nothing was plugged in
- board kit: a negative RSS growth reads -128 kB, not +-128
- review: documents, and one line of a shell script checked under dash

Signed-off-by: Joel Winarske <joel.winarske@linux.com>
@jwinarske
jwinarske marked this pull request as ready for review November 17, 2026 18:28
The changelog's two lists of milestone 4 are one: main's line names
emblema 0.3.0, and this branch's two lines follow it.

Signed-off-by: Joel Winarske <joel.winarske@linux.com>
- docs/m4-status.md: ticker's animation seen by a person, its colors
  as they should be
- review: one line of a document

Signed-off-by: Joel Winarske <joel.winarske@linux.com>
- Ctrl+Alt+F2 and back under an app that draws only when something
  changes left the console on the screen: seen on the VisionFive 2 with
  the cursors app. Nothing drew, so nothing took the card again
- the seat tells who asked when the session comes back
  (Seat::on_resume), and the raster thread draws its last scene again
  (RasterThread::redrawer); a target that cannot lose its frame keeps no
  scene for it
- the display knows the card went and came back with nobody looking,
  by the session's count of its comings back, where it knew only a
  switch it had looked during
- --capture asks for the planes on its own descriptor: after a switch
  it could read the card before the display had taken it again, and
  saw no plane
- on the Pi 5: cursors, a switch away and back by synthetic keys, the
  display read back before and after: the same frame
- review: the callback runs on the seat's thread and only sends on a
  channel, so it cannot wait on the seat; a redraw that fails, the card
  not yet back, is not the run's failure. One scene is kept, and only
  for a display

Signed-off-by: Joel Winarske <joel.winarske@linux.com>
- a run with --kms and --frames printed its totals and never exited:
  seen on the VisionFive 2 with counter. The seat kept the redrawer it
  was given for a session's coming back, the redrawer kept a sender,
  and the raster thread ended only when every sender was gone
- finish sends the thread its end, after what is queued; an uploader or
  a redrawer that outlives it sends to nobody
- on the Pi 5: ticker --kms --frames 60 exits 0
- review: scenes queued before the end are still drawn, in order; the
  one sender that counted scenes is the owner's, which sends nothing
  after it

Signed-off-by: Joel Winarske <joel.winarske@linux.com>
… devices

- a VisionFive 2's display controller shows a cursor newly set as
  noise until it is next moved, its buffer right all the while: a mouse
  nudged once and left kept the noise. A cursor just shown, or given a
  new shape, is told to the card twice more, a tick apart, with nothing
  new to tell
- docs/m4-status.md: the board's devices, with a person at it: keys,
  the mouse and its wheel, all 35 cursors, a capture, a switch of
  terminals, counter; and its cursor's two faults, the one near the
  edges fixed in drmkit (drmkit#134), not yet in a release pinned here
- docs/m4-exit.md, README: the board's input as tried
- review: two more cursor calls after a show or a shape, then none; a
  mouse that keeps moving makes none extra

Signed-off-by: Joel Winarske <joel.winarske@linux.com>
- docs/m4-status.md, docs/m4-exit.md: pointer's cursor is clean from
  its first nudge; counter's is still noise when it first appears,
  which stays open. The button's arrow is what the framework asks for
- review: documents

Signed-off-by: Joel Winarske <joel.winarske@linux.com>
…nd its change taken out

- telling the card a newly shown cursor again did not clear the noise
  the VisionFive 2 sometimes shows in place of it, nor did a pixel aside
  and back, tried on the board: the change is taken out, and the cursor
  is driven as it was
- docs/m4-status.md, docs/m4-exit.md: what was found, each with a
  person at the board. The buffer is right while the monitor shows
  noise; it is not every run, not one app, not the app's start, and
  walking the caches out did not clear it. It may be the board's display
  driver. Tracked as #29
- review: cursor.rs is as it was two commits ago, by checkout; documents

Signed-off-by: Joel Winarske <joel.winarske@linux.com>
…reen

- drmkit crates at 0.1.6. On a VisionFive 2 the cursor broke up near
  the top and left edges of the display, where its image is redrawn on
  every move; drmkit-cursor draws that into a second buffer now
- docs, CHANGELOG: the fix as pinned
- review: the lockfile moves the thirteen drmkit packages and nothing
  else; drmkit 0.1.6 differs from 0.1.5 in drmkit-cursor alone

Signed-off-by: Joel Winarske <joel.winarske@linux.com>
@jwinarske
jwinarske merged commit 87e5f29 into main Nov 17, 2026
11 checks passed
@jwinarske
jwinarske deleted the kms-gbm-ring branch November 17, 2026 20:26
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