Replace stub ioctl handlers with real per-fd magic token assignment
and master tracking. First card opener auto-becomes master. Master
state is tracked and cleared on fd close.
When pcid-spawner launches redox-drm for a GPU device, the init
service (10_redox-drm.service) may also start a second instance.
The guard check in the service file (head -c 1 /scheme/drm/card0)
has a race condition with pcid-spawner's scheme registration.
Move the scheme:drm existence check into the binary itself. If
scheme:drm is already registered when run() starts, log and exit
gracefully with daemon.ready() instead of crashing with a fatal
"no GPU found" error.
Critical fixes from Linux kernel cross-reference:
- execlists.rs flush_pending(): write upper 32 bits FIRST, then lower.
BSpec requires upper-first on legacy ELSP; GPU latches on lower write.
Previously wrote lower then upper — stale upper dword used by GPU.
- execlists.rs init(): write only INHIBIT_SYN_CTX_SWITCH to RING_CONTEXT_CONTROL.
Linux init_common_regs() disables ENGINE_CTX_RESTORE_INHIBIT and
RS_CTX_ENABLE for normal operation. Our old code set restore inhibit,
preventing context save/restore on context switch — GPU would hang.
- context.rs: LRC image offsets were MMIO register offsets (0x30, 0x34, 0x38).
LRC state layout is different — CTX_CONTEXT_CONTROL is dword index 3 (byte 12).
Fixed to match Linux intel_lrc_reg.h dword layout:
LRC_CTX_CTRL_OFFSET = 12 (was 0x02)
LRC_HEAD_OFFSET = 20 (was 0x30)
LRC_TAIL_OFFSET = 28 (was 0x34)
LRC_RING_START_OFFSET = 36 (was 0x38)
Added LRC_RING_CTL_OFFSET = 40
- context.rs: corrected CTX_CTRL_INHIBIT_SYN_CTX_SWITCH from bit 2 to bit 3
to match Linux RING_CONTEXT_CONTROL bit layout at 0x244.
- ring.rs: added gpu_address() method to expose ring GGTT address for
LRC descriptor construction.
- mod.rs: wire execlist submission path after ring batch submit in
hw_submit_to_ring(), creating LRC descriptor and submitting via ExeclistPort.
- display.rs: program HDMI infoframes (AVI, audio, VSIF) on port enable.
On Redox there is no udev-based DRM device enumeration. KWin's DRM
backend relies on m_udev->listGPUs() which returns nothing without udev.
Add a fallback: when no KWIN_DRM_DEVICES is set and the session is
kde-wayland, inject KWIN_DRM_DEVICES=/scheme/drm/card0 so KWin knows
which device to open. This fixes the 'No suitable DRM devices' error
that prevented KWin from starting on Redox.
Added test: build_environment_sets_kwin_drm_devices_default_for_kde_wayland
to verify the fallback is applied correctly.
- gem_lmem: Replace bump allocator with best-fit free-list (BTreeMap) that
tracks individual allocations and coalesces freed blocks on both sides
- mocs: Add init_pat() - programs PAT index 0-7 with WB/WC/WT/UC for Gen9+,
and WB-only for Gen12+; called after init_mocs() in IntelDriver init
- regs_gt: Add PAT register constants (GEN8_PRIVATE_PAT_*, GEN12_PAT_INDEX,
GEN8_PPAT_* cache attributes) and TBIMR_FAST_CLIP
- PAT programming: Gen9 uses 0x40E0 base with LLC/LLCELLC attributes,
Gen12 uses 0x4800 base with simple WB/WC/WT/UC (no LLC on Xe2)
- All changes compile clean (0 errors)
- Changed make all -> make live to produce .iso files
- Skipped verify-overlay-integrity.sh (corrupts recipe symlinks)
- Added ac_cv_namespace_ok=yes to ICU recipe (toolchain libstdc++ stale)
- Fixed variable reference
- Mini ISO builds successfully via the script
- Changed make all -> make live to produce .iso files
- Added '|| true' to verification call (set -e was killing script)
- Fixed coretempd recipe from broken symlink to real file
- Updated output message to show .iso path
- Removed stale REDBEAR_RELEASE override code
- Fixed NO_CACHE initialization (was unbound CLEAN variable)
- Added --no-cache argument parsing and usage docs
- Auto-unset REDBEAR_RELEASE from .config during dev builds
- Stale-build detection now uses NO_CACHE variable correctly
- Updated help text with environment variable docs
redox-drm = "ignore" was left from earlier GPU-suppression tests.
Restored to active so the DRM/KMS display driver is included in
the full ISO image. Without it, no GPU output or SDDM compositor.
Automatically detects when source repos (relibc, kernel, base,
bootloader, installer) have commits newer than their built pkgars.
If stale, forces a clean rebuild to prevent shipping old binaries.
Also: consolidated clean-rebuild logic into a single conditional.
Per AGENTS.md policy: local recipes ALWAYS supersede WIP packages.
Any WIP directory that shadows a local/recipes/ package is replaced
with a symlink to the local version.
Fixed shadows: bison, flex, m4, meson, ninja-build, libxcvt,
qt6-sensors, libepoxy, mc — all now symlinked to local/recipes/.
Added WIP-local enforcement to build-redbear.sh: auto-detects and
fixes WIP shadows at build time.
Fix pre-existing compilation errors in modules that were present as
source files but not declared in mod.rs:
- audio_eld: cast u16 copy_len to usize for slice indexing
- dp_fec, dp_uhbr, edp_pll, gpu_reset, hdmi_frl, lspcon:
DriverError::Initialization now takes String, add .to_string()
- dsc: add missing import
- guc_submission: DriverError::Buffer now takes String
- vrr: cast VRR_MAX/MIN_FRAME_TIME constants to usize
- rps_rc6: change freq_table() return to &'static to avoid
borrow checker conflict with self mutation
All 12 modules now compile with zero errors.
Replace busy-wait spin_loop() in FenceTimeline::wait() with
Condvar::wait_timeout(). signal() now calls notify_all() to
wake blocked threads. This turns syncobj_wait from CPU-burning
poll to proper blocking sleep/wake.
Add two new tests:
- test_wait_wakes_on_signal: spawns a thread that signals
after 10ms, verifies the blocked wait wakes within 1s
- test_wait_timeout_expires: verifies 1ms timeout on an
unsignaled fence returns an error
VIRTGPU_GETPARAM: expand from 1 to 8 sub-parameters for Mesa
compatibility. Mesa virgl driver probes CAPSET_QUERY_FIX,
RESOURCE_BLOB, CONTEXT_INIT, SUPPORTED_CAPSET_IDS, and
EXPLICIT_DEBUG_NAME during initialization.
set_property: add doc comment explaining that virtio-gpu has
no per-object property tables — all mode/fb/active changes
flow through atomic commit, not set_property.
cursor_move: replace x.max(0) as u32 / y.max(0) as u32 with
explicit if-else for clarity. Negative coordinates now clamp
to zero at screen edges (same behavior, more readable code).
BUG 1: virgl_resource_create_blob held device lock while calling
self.gem_create() which internally tries to lock device again.
Rust std::sync::Mutex is not reentrant — guaranteed deadlock.
Fix: release device lock before calling gem_create, using a
scoped block for the has_resource_blob feature check.
BUG 2: Box::leak in atomic_commit error paths converted
dynamically-formatted strings to &'static str at the cost of
a memory leak per error. Replaced with static &str literals.
VirtioDriver:
- Override poll_hotplug() — refresh connectors and detect
display changes by comparing cached vs current topology
- Override set_property() — validate obj_id is a known CRTC
or connector; compositors need property acknowledgement
even if individual properties are no-ops for virtio-gpu
scheme.rs:
- Fix fsync() — was EOPNOTSUPP, now returns Ok(())
Virtio-gpu commands complete synchronously, so there
are no pending GPU operations to flush
Implement VIRTGPU_RESOURCE_CREATE_BLOB:
- Define VirtioGpuResourceCreateBlob wire struct (commands.rs)
- Add VIRTIO_GPU_BLOB_MEM_*/FLAG_* constants
- Negotiate VIRTIO_GPU_F_RESOURCE_BLOB feature flag
- Add virgl_resource_create_blob() to GpuDriver trait
- Implement in VirtioDriver with virtio command dispatch
- Wire ioctl handler in scheme.rs (was EOPNOTSUPP stub)
- Add find_by_handle() to ResourceManager
Implement hardware cursor:
- Add VIRTIO_GPU_CMD_UPDATE_CURSOR/MOVE_CURSOR opcodes
- Define VirtioGpuCmdUpdateCursor/MoveCursor/CursorPos structs
- Add update_cursor()/move_cursor() to VirtioGpuDevice
- Override cursor_set/cursor_move on VirtioDriver
- CRTC-to-connector lookup for scanout index mapping
Implement atomic modeset:
- Override atomic_commit on VirtioDriver with full state
validation via atomic_check(), then delegate to
set_crtc + page_flip for each active CRTC
- Support TEST_ONLY flag (returns NoChange)
Mesa recipe: add iris,crocus to gallium-drivers
Config: enable mesa = {} in redbear-full.toml