QEMU's reims-graphics-pci has no default option ROM, and reims-ctl is to
name one for every x86-64 VM on reims-vgpu's own device, on hosts that
build no firmware. firmware/prebuilt/ReimsGraphics.rom is the ROM `make -C
firmware prebuilt` builds on a Mac (Apple clang 21.0.0, Homebrew lld 23.1.4;
the bytes are the compiler's), and ReimsGraphics.toml records its sha256
and that of every file it was built from, the wire header among them.
`make -C firmware prebuilt-check` (firmware/prebuilt.sh --check) hashes the
ROM and those files against the record on any host, with no compiler, and
`cargo xtask check` runs it: the wire header is the library's, whose checks
would otherwise never see the ROM go stale.
Integration found the guest and host wire headers disagreed on the control
ring's data size (the guest used 0x10000 - 256; the host, authoritatively,
uses a 32 KiB power of two) and on every name. The host's generated cbindgen
header is the source of truth, so the kext and the option ROM now build on it
and the guest's own copy is gone.
- Both include crates/reims-graphics/include/reims_graphics_wire.h; the
Makefiles point there.
- RG_* names become the host's RGFX_*; ring field offsets come from
RgfxRingHeader, and a command is now a full message struct (RgfxSetScanout
and the like) whose header the sender stamps.
- The ring index masks against RGFX_CONTROL_RING_DATA_SIZE, now a power of two.
- The option ROM's .S cannot assemble the C header, so the Makefile reads the
PCI identity from it with the preprocessor and passes it in. apple-gfx-pci's
ROM bytes are unchanged.
The reims-graphics lane's boot display is a GOP framebuffer in the device's
region, so firmware, boot.efi and the kernel console have a screen before the
guest's display kext starts. The new driver binds 1234:5247, resets the
device, adopts the control rings' counters, and offers one mode: the first
connected display's preferred mode from GET_DISPLAYS, or 1920x1080. SetMode
points the display at the region from 0x20000 with SET_SCANOUT, its rows
aligned to 256 bytes as the kext lays them out, so the boot frame keeps its
layout at the handover. Firmware polls the completion ring for answers.
OptionRom.S takes the PCI identity from its includer, so both ROMs share the
layout; apple-gfx-pci's ROM builds to the same bytes as before.
This repository now holds libreims_vgpu, a Rust library that is the host
side of the paravirtualized GPU macOS guests drive, in place of Apple's
ParavirtualizedGraphics.framework: the library and its C API
(reims_vgpu.h), the PCI device's option ROM, QEMU's apple-gfx on that API
(vendor/qemu), the behaviour-lock suite that drives the C API as QEMU
does, and reims-ctl, the VM manager users run. README.md says what it is
and how it is laid out, and AGENTS.md how to change it.
Every file of the earlier tree is replaced. vendor/qemu moves to the
steelbrain/reims-vgpu branch of the same public repository.