diff --git a/local/patches/redox-drm/P6-pcid-coordinate-handoff.patch b/local/patches/redox-drm/P6-pcid-coordinate-handoff.patch new file mode 100644 index 000000000..3f9e5b2d6 --- /dev/null +++ b/local/patches/redox-drm/P6-pcid-coordinate-handoff.patch @@ -0,0 +1,28 @@ +--- a/src/main.rs ++++ b/src/main.rs +@@ -21,6 +21,7 @@ use redox_driver_sys::pci::{ + PCI_VENDOR_ID_AMD, PCI_VENDOR_ID_INTEL, + }; ++use redox_driver_sys::pcid_client::PcidClient; + use redox_driver_sys::quirks::PciQuirkFlags; + use redox_scheme::{SignalBehavior, Socket}; + +@@ -164,6 +165,19 @@ fn select_gpu_from_args() -> Result { + }); + } + ++ if let Some(mut pcid) = PcidClient::connect_default() { ++ let function = pcid.request_config().map_err(|e| { ++ DriverError::Pci(format!("failed to read pcid-spawner handoff config: {e}")) ++ })?; ++ let info = function.device_info(); ++ info!( ++ "redox-drm: selected GPU from pcid-spawner handoff at {}", ++ info.location ++ ); ++ return Ok(info); ++ } ++ + let devices = enumerate_pci_class(PCI_CLASS_DISPLAY) + .map_err(|e| DriverError::Pci(format!("PCI scan failed: {e}")))?; + let first = devices diff --git a/local/recipes/gpu/redox-drm/P6-pcid-coordinate-handoff.patch b/local/recipes/gpu/redox-drm/P6-pcid-coordinate-handoff.patch new file mode 120000 index 000000000..3bc4c5086 --- /dev/null +++ b/local/recipes/gpu/redox-drm/P6-pcid-coordinate-handoff.patch @@ -0,0 +1 @@ +../../../patches/redox-drm/P6-pcid-coordinate-handoff.patch \ No newline at end of file diff --git a/local/recipes/gpu/redox-drm/recipe.toml b/local/recipes/gpu/redox-drm/recipe.toml index b87a9f762..724d65982 100644 --- a/local/recipes/gpu/redox-drm/recipe.toml +++ b/local/recipes/gpu/redox-drm/recipe.toml @@ -1,6 +1,6 @@ [source] path = "source" -patches = ["P1-intel-gen-gate.patch", "P2-intel-display-fixes.patch", "P3-intel-gen8-gen9-firmware.patch", "P4-virtio-gpu-driver.patch", "P5-virtio-auto-probe.patch"] +patches = ["P1-intel-gen-gate.patch", "P2-intel-display-fixes.patch", "P3-intel-gen8-gen9-firmware.patch", "P4-virtio-gpu-driver.patch", "P5-virtio-auto-probe.patch", "P6-pcid-coordinate-handoff.patch", "P7-unreachable-pattern-cleanup.patch", "P8-terminal-scheme-ebadf.patch", "P9-virtio-handoff-mmio-map.patch"] [build] template = "cargo"