fix: wire redox-drm handoff patches

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
2026-05-07 20:52:51 +01:00
parent e3a9a820ee
commit 612ef6ce36
3 changed files with 30 additions and 1 deletions
@@ -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<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