R1-R10 audit Gap 15: the pci_*_quirk_flags and
redox_pci_set_quirk_flags symbols lived inside redox_stubs.c
alongside kmalloc, printk, and other generic glue functions.
The 'stub' file name was misleading — the flag word that
pci_get_quirk_flags() returned was real, computed by
redox-drm (Rust) via redox_driver_sys::quirks::lookup_pci_quirks_full()
and pushed across the FFI boundary.
This change:
- Adds source/redox_quirk_bridge.c containing the three
symbols plus a static g_redox_quirk_flags global. The
header documents the Rust-to-C data flow and references
the audit + the Rust-side caller at display.rs:155.
- Removes the three functions and the g_pci_quirk_flags
static from source/redox_stubs.c. redox_stubs.c now only
contains generic glue (kmalloc, printk, msleep, udelay,
firmware_store, etc.) and the file name matches its
contents.
- Updates recipe.toml Stage 1 to compile the new
translation unit alongside redox_stubs.c. Both files
are linked into libamdgpu_dc_redox.so.
The Rust-side caller in
local/recipes/gpu/redox-drm/source/src/drivers/amd/display.rs
is unchanged: the FFI symbol name 'redox_pci_set_quirk_flags'
is the same, so the linker picks up the new definition
without any code change on the Rust side.
No caller code in amdgpu_redox_main.c changes either —
pci_get_quirk_flags and pci_has_quirk are still declared
in redox_glue.h with the same signatures, and the new TU
provides the single definition that the linker resolves.
The end result is identical behavior (the flag word flows
the same way) with cleaner file naming and accurate
documentation. The audit's stub-finding is now a non-issue
for these symbols: there is no longer a stub; the bridge
file is named for what it does.
- Fix redox_pci_enable_device to track enabled state instead of noop.
redox_pci_set_master now logs bus master enable.
- Fix redox_request_irq to return the IRQ fd instead of open+close.
redox_free_irq now accepts fd via dev_id and actually closes it.
- SETPLANE now returns EOPNOTSUPP instead of silently succeeding,
with warning about DC dependency.
- OBJ_SETPROPERTY now accepts CRTC_ID (property 30) as a noop
(connector routing is managed by SETCRTC).
- Add VramManager (vram.rs): bump-allocator with free-list coalescing for BAR2 VRAM
aperture. gem_create auto-selects VRAM for scanout buffers (width>0 && height>0)
with fallback to system RAM on exhaustion. gem_close frees VRAM when gpu_addr is
within BAR2 range. ensure_gem_gpu_mapping detects VRAM-backed buffers and skips
GTT mapping.
- Add amdgpu_dc_upload_firmware() stub documenting DMUB firmware upload sequence
prerequisites (requires Linux DC tree compilation).
- Replace generic 'unavailable' CS ioctl/virgl error messages with specific
messages documenting what component is needed (amdgpu core driver, Mesa radeonsi/
iris cross-compilation, CS ioctl backend).
- Fix ASIC detection: use PCI device_id instead of broken MMIO offset-0 read.
Add proper device_id->ASIC family lookup table covering Navi10-Navi33 (RDNA1/RDNA2/RDNA3).
Add per-family properties (DCN revision, firmware name, OTG/HUBP base offsets, HPD register).
- Wire quirk flags from Rust to C: replace pci_get_quirk_flags/pci_has_quirk stubs
(previously always returned 0/false) with stored quirk_flags set via new FFI
redox_pci_set_quirk_flags(). Quirk-aware IRQ policy now actually works.
- Store firmware blobs from Rust to C: add redox_firmware_store() FFI to pass
firmware blobs from AmdDriver.firmware HashMap into C-side storage. C side
can now fall back to scheme:firmware if blobs not pre-stored.
- Fix connector descriptors: replace hardcoded 600x340mm fake dimensions with
per-ASIC-family connector tables (desktop dGPU vs APU layout). Set mm_width/
mm_height to 0 (unprobed — needs DC hardware detection). HPD register offset
now comes from per-family asic_props table.
- Fix register offsets: replace hardcoded OTG base 0x4800 / HUBP base 0x5800
(Navi23-specific) with per-DCN-revision dispatch from asic_props table
(DCN2.0=0x4000/0x5000, DCN3.0=0x4800/0x5800, DCN3.2=0x5000/0x6000).
Consolidate the active desktop path around redbear-full while landing the greeter/session stack and the runtime fixes needed to keep Wayland and KWin bring-up moving forward.
AMD display driver: expanded DCN pipeline setup with plane/controller/stream mapping.
Intel driver: cleaned up module structure.
New interrupt module for MSI-X vector management across GPU drivers.
PCID config endpoint patch and Intel GPU TOML for automatic driver spawning.
Expanded redox_stubs with additional kernel API shims.
Derivative of Redox OS (https://www.redox-os.org) adding:
- AMD GPU driver (amdgpu) via LinuxKPI compat layer
- ext4 filesystem support (ext4d scheme daemon)
- ACPI fixes for AMD bare metal (x2APIC, DMAR, IVRS, MCFG)
- Custom branding (hostname, os-release, boot identity)
Build system is full upstream Redox with RBOS overlay in local/.
Patches for kernel, base, and relibc are symlinked from local/patches/
and protected from make clean/distclean. Custom recipes live in
local/recipes/ with symlinks into the recipes/ search path.
Build: make all CONFIG_NAME=redbear-full
Sync: ./local/scripts/sync-upstream.sh