perf(display): present copies window rows as-is (scanout R8G8B8X8 = window byte order, Host hands out row bytes, Framebuffer::write_rgba_row); Window copy_from/copy_to one fenced memcpy; full present ~65ms -> ~3ms

This commit is contained in:
2026-10-28 14:47:06 +01:00
parent d26b265d38
commit 815a2f9fe2
7 changed files with 88 additions and 55 deletions

View File

@@ -28,9 +28,10 @@ const DISPLAY_H: ByteOffset = ByteOffset::new(24 + 12);
pub fn create_2d(mmio: &impl MmioAccess, queue: &VirtioQueue, dma: &GpuDmaAddrs, resource_id: u32, width: Dimension, height: Dimension) -> bool {
write_cmd_header(&dma.cmd, 0x0101);
// Resource id, format (1: B8G8R8A8), width, height.
// Resource id, format (134: R8G8B8X8, a window's own byte order, so
// its rows are copied as they are), width, height.
dma.cmd.write(BODY, resource_id);
dma.cmd.write(BODY + 4, 1u32);
dma.cmd.write(BODY + 4, 134u32);
dma.cmd.write(BODY + 8, width.raw() as u32);
dma.cmd.write(BODY + 12, height.raw() as u32);
submit_cmd(mmio, queue, dma, 40)