feat: VirtIO GPU driver, libdrm DRM ioctls, KWin/KF6 build fixes, display stack additions
- Add full VirtIO GPU driver with command submission, resource management, VirtQueue implementation, and transport layer; includes diagnostic probes for resource_create_2d ERR_INVALID_RESOURCE_ID investigation - Expand libdrm Redox support with DRM ioctl wrappers (ADDFB, RMFB, CREATE_DUMB, MAP_DUMB, DESTROY_DUMB, GET_RESOURCES, GET_CONNECTOR, GET_CRTC, SET_CRTC, MODE_OBJ_GET_PROPERTIES, etc.) and xf86drm_redox.h - Add redox-drm scheme handlers for VirtIO GPU-specific DRM ioctls (VIRTGPU_RESOURCE_CREATE, VIRTGPU_MAP, VIRTGPU_WAIT, VIRTGPU_INFO, etc.) - Add display stack recipes: freetype2, lcms2, libdisplay-info, libepoxy, libxcvt - Fix KWin build (recipe.toml expanded, kf6-ksvg added) - Fix KF6 CMakeLists for cross-compilation (attica, kcmutils, kcolorscheme, kcompletion, kconfigwidgets, kdeclarative, kiconthemes, kitemmodels, kitemviews, kjobwidgets, ktextwidgets, kwayland, kxmlgui, kpty, solid) - Add Qt6 futex support patch - Add relibc patches: P3 strtold, P3 ld-so search path, P5 DRM ioctl removal - Add base P4 pcid config scheme patch - Update driver-manager hotplug/config, PCI config in redox-driver-sys - Update greeter compositor and KDE session scripts - Update AGENTS.md with zero-tolerance stubs policy and project knowledge
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use std::collections::BTreeSet;
|
||||
use std::collections::{BTreeMap, BTreeSet};
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::thread;
|
||||
use std::time::Duration;
|
||||
@@ -10,6 +10,11 @@ use redox_driver_core::manager::ProbeEvent;
|
||||
|
||||
use crate::scheme::{DriverManagerScheme, notify_bind, notify_unbind};
|
||||
|
||||
/// Maximum times a single deferred device+driver pair is retried before
|
||||
/// permanently abandoning it. Deferred means a dependency scheme (e.g.
|
||||
/// scheme:firmware) is not yet ready, so the device may bind later.
|
||||
const MAX_DEFERRED_RETRIES: u32 = 5;
|
||||
|
||||
pub fn run_hotplug_loop(
|
||||
manager: Arc<Mutex<DeviceManager>>,
|
||||
scheme: Arc<DriverManagerScheme>,
|
||||
@@ -20,6 +25,9 @@ pub fn run_hotplug_loop(
|
||||
poll_interval_ms
|
||||
);
|
||||
|
||||
let mut deferred_retries: BTreeMap<(String, String), u32> = BTreeMap::new();
|
||||
let mut permanently_fatal: BTreeSet<(String, String)> = BTreeSet::new();
|
||||
|
||||
loop {
|
||||
thread::sleep(Duration::from_millis(poll_interval_ms));
|
||||
|
||||
@@ -57,18 +65,41 @@ pub fn run_hotplug_loop(
|
||||
result,
|
||||
} => {
|
||||
track_pci_device(device, &mut seen_pci_devices);
|
||||
let key = (device.path.clone(), driver_name.clone());
|
||||
|
||||
// Skip devices that were permanently fatal in a previous cycle.
|
||||
// enumerate() re-probes all unbound devices each poll, but a Fatal
|
||||
// result means the driver binary is genuinely absent (e.g. ided on
|
||||
// a live ISO that doesn't ship it) — no amount of re-probing will
|
||||
// change the outcome.
|
||||
if permanently_fatal.contains(&key) {
|
||||
continue;
|
||||
}
|
||||
|
||||
match result {
|
||||
ProbeResult::Bound => {
|
||||
log::info!("hotplug: bound {} -> {}", device.path, driver_name);
|
||||
notify_bound_device(scheme.as_ref(), device, driver_name);
|
||||
}
|
||||
ProbeResult::Deferred { reason } => {
|
||||
log::info!(
|
||||
"hotplug: deferred {} -> {} ({})",
|
||||
device.path,
|
||||
driver_name,
|
||||
reason
|
||||
);
|
||||
let retries = deferred_retries.entry(key).or_insert(0);
|
||||
*retries += 1;
|
||||
if *retries <= MAX_DEFERRED_RETRIES {
|
||||
log::info!(
|
||||
"hotplug: deferred {} -> {} ({})",
|
||||
device.path,
|
||||
driver_name,
|
||||
reason
|
||||
);
|
||||
} else if *retries == MAX_DEFERRED_RETRIES + 1 {
|
||||
log::warn!(
|
||||
"hotplug: giving up on {} -> {} after {} retries: {}",
|
||||
device.path,
|
||||
driver_name,
|
||||
MAX_DEFERRED_RETRIES,
|
||||
reason
|
||||
);
|
||||
}
|
||||
}
|
||||
ProbeResult::Fatal { reason } => {
|
||||
log::error!(
|
||||
@@ -77,6 +108,7 @@ pub fn run_hotplug_loop(
|
||||
driver_name,
|
||||
reason
|
||||
);
|
||||
permanently_fatal.insert(key);
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user