From 5313285bbfedf6154d2611c4923cff458d7ef271 Mon Sep 17 00:00:00 2001 From: eunhhu Date: Sun, 27 Sep 2026 14:59:54 +0100 Subject: 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. --- surfaces/pixels.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'surfaces/pixels.c') diff --git a/surfaces/pixels.c b/surfaces/pixels.c index 67e7bc5..f671143 100644 --- a/surfaces/pixels.c +++ b/surfaces/pixels.c @@ -67,6 +67,10 @@ static void missing(uint32_t *out, size_t stride, int x, int y, int width, int h for (int j = top; j <= bottom; ++j) out[(size_t)j * stride + (size_t)left] = out[(size_t)j * stride + (size_t)right] = color; } +void vega_pixels_clear(uint32_t *out, size_t stride, unsigned width, unsigned height) { + fill(out, stride, 0, 0, (int)width, (int)height, background); +} + void vega_pixels(const VegaGrid *grid, VegaFace *face, uint32_t *out, size_t stride) { int width = (int)grid->width * face->cell_width, height = (int)grid->height * face->cell_height; /* Backgrounds first: a wide glyph spans its neighbour's cell. */ -- cgit v1.2.3