diff --git a/local/recipes/gpu/redox-drm/P10-arrow-lake-device-ids.patch b/local/recipes/gpu/redox-drm/P10-arrow-lake-device-ids.patch deleted file mode 100644 index 9d52cb467d..0000000000 --- a/local/recipes/gpu/redox-drm/P10-arrow-lake-device-ids.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/src/drivers/mod.rs b/src/drivers/mod.rs ---- a/src/drivers/mod.rs -+++ b/src/drivers/mod.rs -@@ -27 +27 @@ const INTEL_GEN12_MTL_IDS: &[u16] = &[ -- 0x7D40, 0x7D41, 0x7D45, 0x7D51, 0x7D55, 0x7D60, 0x7D67, 0x7DD1, 0x7DD5, -+ 0x7D40, 0x7D45, 0x7D55, 0x7D60, 0x7DD5, -@@ -29,2 +29,2 @@ const INTEL_GEN12_MTL_IDS: &[u16] = &[ --const INTEL_GEN12_ARL_IDS: &[u16] = &[0x6420, 0x64A0, 0x64B0]; --const INTEL_GEN12_LNL_IDS: &[u16] = &[0xB640]; -+const INTEL_GEN12_ARL_IDS: &[u16] = &[0x7D41, 0x7D51, 0x7DD1, 0x7D67, 0xB640]; -+const INTEL_GEN12_LNL_IDS: &[u16] = &[0x6420, 0x64A0, 0x64B0]; -diff --git a/src/main.rs b/src/main.rs ---- a/src/main.rs -+++ b/src/main.rs -@@ -297 +297,5 @@ fn intel_display_firmware_keys(device_id: u16) -> Option<&'static [&'static str]> -- 0x7D40 | 0x7D41 | 0x7D45 | 0x7D51 | 0x7D55 | 0x7D60 | 0x7D67 | 0x7DD1 | 0x7DD5 => { -+ 0x7D40 | 0x7D45 | 0x7D55 | 0x7D60 | 0x7DD5 => { -+ Some(INTEL_MTL_DMC_KEYS) -+ } -+ // Arrow Lake (ARL) — display IP 14.0, same DMC as Meteor Lake -+ 0x7D41 | 0x7D51 | 0x7DD1 | 0x7D67 | 0xB640 => { diff --git a/local/recipes/gpu/redox-drm/P5-virtio-auto-probe.patch b/local/recipes/gpu/redox-drm/P5-virtio-auto-probe.patch deleted file mode 100644 index 6cbcc697dd..0000000000 --- a/local/recipes/gpu/redox-drm/P5-virtio-auto-probe.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff --git a/local/recipes/gpu/redox-drm/source/src/main.rs b/local/recipes/gpu/redox-drm/source/src/main.rs -index 612a64e0f..7af80bd75 100644 ---- a/local/recipes/gpu/redox-drm/source/src/main.rs -+++ b/local/recipes/gpu/redox-drm/source/src/main.rs -@@ -168,9 +168,9 @@ fn select_gpu_from_args() -> Result { - .map_err(|e| DriverError::Pci(format!("PCI scan failed: {e}")))?; - let first = devices - .into_iter() -- .find(|d| d.vendor_id == PCI_VENDOR_ID_AMD || d.vendor_id == PCI_VENDOR_ID_INTEL) -+ .find(|d| d.vendor_id == PCI_VENDOR_ID_AMD || d.vendor_id == PCI_VENDOR_ID_INTEL || d.vendor_id == 0x1AF4) - .ok_or_else(|| { -- DriverError::NotFound("no AMD or Intel GPU found via scheme:pci".to_string()) -+ DriverError::NotFound("no AMD, Intel, or VirtIO GPU found via scheme:pci".to_string()) - })?; - let mut pci = PciDevice::open_location(&first.location) - .map_err(|e| DriverError::Pci(format!("failed to open GPU {}: {e}", first.location)))?; -@@ -205,7 +205,7 @@ fn verify_supported_gpu(info: &PciDeviceInfo) -> Result<()> { - ))); - } - -- if info.vendor_id != PCI_VENDOR_ID_AMD && info.vendor_id != PCI_VENDOR_ID_INTEL { -+ if info.vendor_id != PCI_VENDOR_ID_AMD && info.vendor_id != PCI_VENDOR_ID_INTEL && info.vendor_id != 0x1AF4 { - return Err(DriverError::Pci(format!( - "device {} is vendor {:#06x}, expected AMD {:#06x} or Intel {:#06x}", - info.location, info.vendor_id, PCI_VENDOR_ID_AMD, PCI_VENDOR_ID_INTEL diff --git a/local/recipes/gpu/redox-drm/P8-terminal-scheme-ebadf.patch b/local/recipes/gpu/redox-drm/P8-terminal-scheme-ebadf.patch deleted file mode 100644 index bdb8117645..0000000000 --- a/local/recipes/gpu/redox-drm/P8-terminal-scheme-ebadf.patch +++ /dev/null @@ -1,69 +0,0 @@ ---- a/src/main.rs -+++ b/src/main.rs -@@ -24,6 +24,7 @@ use redox_driver_sys::pcid_client::PcidClient; - use redox_driver_sys::quirks::PciQuirkFlags; - use redox_scheme::{SignalBehavior, Socket}; -+use syscall04::error::EBADF; - - use crate::driver::{DriverError, DriverEvent, GpuDriver, Result}; - use crate::drivers::DriverRegistry; -@@ -71,11 +72,6 @@ fn run() -> Result<()> { - info.location - ); - -- let socket = Socket::create("drm") -- .map_err(|e| DriverError::Initialization(format!("failed to register drm scheme: {e}")))?; -- info!("redox-drm: registered scheme:drm"); -- - let (event_tx, event_rx) = mpsc::sync_channel::(8); - - let irq_driver: Arc = driver.clone(); -@@ -108,6 +104,15 @@ fn run() -> Result<()> { - } - }); - -+ // redox-scheme opens the scheme fd with O_CLOEXEC. On Redox, thread startup can -+ // invalidate a close-on-exec fd opened before the thread workers exist, which -+ // showed up as an immediate EBADF from next_request() during QEMU greeter boot. -+ // Register scheme:drm only after the worker threads are running so the listening -+ // fd remains stable for compositor clients. -+ let socket = create_drm_socket()?; -+ info!("redox-drm: registered scheme:drm"); -+ - loop { - let request = match socket.next_request(SignalBehavior::Restart) { - Ok(Some(request)) => request, -@@ -118,6 +123,10 @@ fn run() -> Result<()> { - break; - } - Err(e) => { -+ if e.errno == EBADF { -+ info!("redox-drm: scheme fd closed, exiting"); -+ break; -+ } - error!("redox-drm: failed to receive scheme request: {}", e); - continue; - } -@@ -145,11 +154,22 @@ fn run() -> Result<()> { - }; - - if let Err(e) = socket.write_response(response, SignalBehavior::Restart) { -+ if e.errno == EBADF { -+ info!("redox-drm: scheme fd closed while writing response, exiting"); -+ break; -+ } - error!("redox-drm: failed to write scheme response: {}", e); - } - } - - Ok(()) - } - -+fn create_drm_socket() -> Result { -+ Socket::create("drm") -+ .map_err(|e| DriverError::Initialization(format!("failed to register drm scheme: {e}"))) -+} -+ - fn select_gpu_from_args() -> Result { - let mut args = env::args().skip(1); - let parsed = match (args.next(), args.next(), args.next()) { diff --git a/local/recipes/gpu/redox-drm/recipe.toml b/local/recipes/gpu/redox-drm/recipe.toml index a30ffe1a08..9dbd2f2cce 100644 --- a/local/recipes/gpu/redox-drm/recipe.toml +++ b/local/recipes/gpu/redox-drm/recipe.toml @@ -1,6 +1,21 @@ +# redox-drm — DRM/KMS scheme daemon (Red Bear OS fork). +# +# This recipe builds the Red Bear fork of the upstream redox-drm scheme +# daemon maintained at local/sources/redox-drm/. The fork is directly +# editable and is the durable source of truth for the daemon. +# +# redox-drm registers scheme:drm/cardN for the GPU detected on the PCI +# bus. It supports: +# * virtio-gpu (QEMU default display) +# * Intel i915-like (Meteor Lake, Arrow Lake, Lunar Lake) +# * AMD display glue (DRM/KMS path, hardware validation pending) +# +# The fork integrates with redox-driver-sys (PCI, MMIO, IRQ, quirks) +# and linux-kpi (C headers for the AMD glue path). The bounded Red +# Bear display glue path is built on top of the imported Linux AMD DC +# source tree; connector detection, modeset, and init live in Rust. [source] -path = "source" -patches = ["P5-virtio-auto-probe.patch", "P8-terminal-scheme-ebadf.patch", "P9-virtio-handoff-mmio-map.patch", "P10-arrow-lake-device-ids.patch"] +path = "../../../local/sources/redox-drm" [build] template = "cargo" @@ -10,5 +25,7 @@ dependencies = [ ] [package] +version = "0.2.3" +description = "redox-drm 0.2.3 (v6.0 2026) — DRM/KMS scheme daemon (Red Bear fork). Registers scheme:drm/cardN and provides GPU modesetting, GEM/GTT/ring state, and KMS handling. Supports virtio-gpu (QEMU), Intel i915-like (Meteor Lake, Arrow Lake, Lunar Lake), and AMD display glue. Source maintained at local/sources/redox-drm/." dependencies = [ ] diff --git a/local/recipes/gpu/redox-drm/source b/local/recipes/gpu/redox-drm/source index 0883f3fe38..a5334ccca7 120000 --- a/local/recipes/gpu/redox-drm/source +++ b/local/recipes/gpu/redox-drm/source @@ -1 +1 @@ -../../../local/sources/redox-drm \ No newline at end of file +/home/kellito/Builds/RedBear-OS/local/recipes/gpu/redox-drm/../../../sources/redox-drm \ No newline at end of file