diff options
| author | eunhhu <[email protected]> | 2026-09-27 14:59:54 +0100 |
|---|---|---|
| committer | eunhhu <[email protected]> | 2026-09-27 14:59:54 +0100 |
| commit | 5313285bbfedf6154d2611c4923cff458d7ef271 (patch) | |
| tree | 81a9d1516f5666c351cf716b394523255d9a5183 /surfaces/vega.h | |
| parent | 993871c6dfa19cf4e0bd4a16c9aad26cb0025d70 (diff) | |
| download | vega-5313285bbfedf6154d2611c4923cff458d7ef271.tar.gz vega-5313285bbfedf6154d2611c4923cff458d7ef271.zip | |
Put the frames on a display through KMS, checked by writeback
vega display draws the same frames on a display with the kernel's mode
setting and no library between: a connected connector's mode on a CRTC, its
primary plane flipped between two dumb buffers by atomic commits, the grid
as many cells as fit. Frames are drawn in cached memory and copied over,
since blending over write-combined buffers read them back slowly (a 1080p
frame took 370 ms; now 20.6 ms with a vertical sync and the check below).
This Pi has no screen but its display controller has writeback connectors:
--writeback sets a mode on one and takes every frame back as the controller
put it out. Each came back exactly as drawn, and the new check finds it the
pixel surface's frame for the same grid, pixel for pixel.
Diffstat (limited to 'surfaces/vega.h')
| -rw-r--r-- | surfaces/vega.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/surfaces/vega.h b/surfaces/vega.h index b8e0044..69eba0b 100644 --- a/surfaces/vega.h +++ b/surfaces/vega.h @@ -135,4 +135,20 @@ void vega_face_close(VegaFace *); /* The grid into out: 0xRRGGBB pixels, grid->width * cell_width across and * grid->height * cell_height down, stride pixels apart. */ void vega_pixels(const VegaGrid *, VegaFace *, uint32_t *out, size_t stride); +/* width x height of out in the background's colour. */ +void vega_pixels_clear(uint32_t *out, size_t stride, unsigned width, unsigned height); + +/* A display through KMS: the first connected connector (or, with writeback, + * a writeback connector: the frames come back to memory, so no screen is + * needed to check them), its preferred mode or width x height. */ +typedef struct VegaDisplay VegaDisplay; +VegaDisplay *vega_display_open(const char *card, bool writeback, unsigned width, unsigned height, char *error, + size_t error_size); +/* The buffer to draw the next frame into: 0xRRGGBB, stride pixels apart. */ +uint32_t *vega_display_buffer(VegaDisplay *, unsigned *width, unsigned *height, size_t *stride); +/* Show it (and, on writeback, wait until the frame has come back). */ +bool vega_display_show(VegaDisplay *); +/* Writeback: the last frame as the display controller put it out. */ +const uint32_t *vega_display_captured(const VegaDisplay *, size_t *stride); +void vega_display_close(VegaDisplay *); #endif |
