danos/system/services
Daniel Samson 6e0e0a62c6
virtio-gpu: a modern virtio 1.0 display driver, bring-up to a flushed frame (v2 V3)
The first native scanout backend's driver half. The device manager matches the
virtio-gpu PCI function by its Display/Other class triple and spawns the driver,
which claims the device, confirms vendor 0x1AF4/device 0x1050 from config space,
enables memory-space + bus mastering, and walks the virtio vendor capabilities to
find the common-config and notify structures in its BAR.

From there it is the standard modern-virtio bring-up: reset, negotiate VERSION_1,
stand up the control virtqueue in coherent DMA, then drive the GPU end to end —
RESOURCE_CREATE_2D, ATTACH_BACKING (a coherent DMA buffer; V4 swaps in the shm-
shared surface), SET_SCANOUT, paint a known pattern, TRANSFER_TO_HOST_2D,
RESOURCE_FLUSH, and wait for the device's used-ring ack. Reading the backing back
proves it is CPU-visible RAM; the ack proves the device consumed the frame —
together the automated stand-in for "it's on screen", no screenshot.

- system/drivers/virtio-gpu/: the driver, plus virtio-gpu-protocol.zig (control
  commands) and virtio-pci.zig (the 1.0 PCI transport + split-virtqueue), both with
  host-tested struct sizes.
- device-manager matches the display/other class triple to "virtio-gpu"; the driver
  self-confirms the vendor/device id, since the class alone cannot distinguish it.
- ServiceId.scanout (11): the driver registers it so the compositor finds it in V4.

Gate: python3 test/qemu_test.py virtio-gpu (QEMU -device virtio-gpu-pci) — the
device-manager stack discovers the function, the driver brings up a 640x480 scanout
and flushes a test pattern: "virtio-gpu: scanout 640x480 online" + "flush acked,
pixel check ok". host tests, display-service, shm, and device-list still pass.

Note: the pre-existing pci-scan case triple-faults on main (verified at 88ad432,
before this change); it is unrelated and tracked separately.
2026-07-14 11:29:53 +01:00
..
acpi acpi: stop parsing AML in the kernel; power management is userspace's 2026-07-13 23:09:30 +01:00
args-echo Pass arguments to main via runtime.process.Init, dispatched on signature 2026-07-11 14:22:48 +01:00
block fat/usb-storage: flush the device cache on close so writes survive power-off 2026-07-13 23:29:15 +01:00
crash-test The device manager supervises: hello, backoff, and the crash-loop cap (M18.1) 2026-07-13 00:19:30 +01:00
device-list The application surface: enumerate, subscribe, and device-list (M18.3) 2026-07-13 00:49:03 +01:00
device-manager virtio-gpu: a modern virtio 1.0 display driver, bring-up to a flushed frame (v2 V3) 2026-07-14 11:29:53 +01:00
display display: pluggable scanout backend seam (v2 V1) 2026-07-14 09:40:15 +01:00
display-demo display: layer client API + the display-demo client (D4) 2026-07-14 01:56:37 +01:00
fat fat/usb-storage: flush the device cache on close so writes survive power-off 2026-07-13 23:29:15 +01:00
fdt Add runtime.time, drop demo drivers, harden TSC timekeeping 2026-07-13 11:56:43 +01:00
init init: restart a crashed boot service 2026-07-14 09:05:10 +01:00
input fix / debug 2026-07-13 05:41:05 +01:00
input-source Generalize input module to mouse and joystick/gamepad events 2026-07-11 15:21:09 +01:00
input-test Generalize input module to mouse and joystick/gamepad events 2026-07-11 15:21:09 +01:00
log-flush Phase 2a: FAT engine mutations + O_TRUNC (fix the overwrite corruption) 2026-07-13 20:02:01 +01:00
power Add runtime.time, drop demo drivers, harden TSC timekeeping 2026-07-13 11:56:43 +01:00
process-test The application surface: enumerate, subscribe, and device-list (M18.3) 2026-07-13 00:49:03 +01:00
shm-client kernel: shm cross-process shared memory capability (v2 V2) 2026-07-14 10:57:14 +01:00
shm-server kernel: shm cross-process shared memory capability (v2 V2) 2026-07-14 10:57:14 +01:00
vfs Phase 2d (ii): filesystem modification time (mtime) 2026-07-13 20:43:40 +01:00