Files
RedBear-OS/local/patches/redox-drm/P6-pcid-coordinate-handoff.patch
T
2026-05-07 20:52:51 +01:00

29 lines
958 B
Diff

--- 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<PciDeviceInfo> {
});
}
+ 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