Skip to content

Read ten-bit scanout formats back in a capture - #132

Merged
jwinarske merged 1 commit into
mainfrom
capture-10bit
Nov 17, 2026
Merged

jwinarske merged 1 commit into
mainfrom
capture-10bit

Conversation

@jwinarske

Copy link
Copy Markdown
Owner

drmkit_capture::snapshot skipped a plane in XRGB2101010, which is what a Vulkan client on a Raspberry Pi 5 scans out. A capture of such a client was the cursor on a transparent image.

It now reads XRGB2101010, ARGB2101010, XBGR2101010 and ABGR2101010, at eight bits a channel.

  • One unit test, twelve cases: each field's place in both orders, the opaque variants with their top bits set and clear, two bits of alpha widened, and a color above its alpha clamped
  • Seen on the Pi 5 from a client holding the card: primary plane and cursor in one PNG
  • CHANGELOG, README and TEST_PARITY say so

The README's host test count goes up by one at the next release.

snapshot reads XRGB2101010, ARGB2101010, XBGR2101010 and ABGR2101010,
each at eight bits a channel: the low two bits of a ten-bit channel are
dropped, and two bits of alpha widen by replication. A Vulkan client's
scanout buffer is often one of these. On a Raspberry Pi 5 the primary
plane of such a client was skipped as an unsupported format, and a
capture showed the cursor plane on nothing.

Seen on the Pi 5 through a client that holds the card: the primary
plane and the cursor in one PNG.

Review: one more arm in a pixel reader whose chunk is four bytes by the
format's own size, so no new indexing; the alpha variants go through
the same clamp to alpha as ARGB8888. No new dependency, nothing on a
hot path.

Signed-off-by: Joel Winarske <joel.winarske@linux.com>
@jwinarske
jwinarske merged commit 94cbb4d into main Nov 17, 2026
9 checks passed
@jwinarske jwinarske mentioned this pull request Nov 17, 2026
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