drivers/graphics: Directly pass scheme name to DisplayHandle::new

This commit is contained in:
bjorn3
2026-03-04 20:02:37 +01:00
parent f518db3d6a
commit 3c79908b5a
5 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ fn daemon(daemon: daemon::Daemon, mut pcid_handle: PciFunctionHandle) -> ! {
let irq_file = pci_allocate_interrupt_vector(&mut pcid_handle, "ihdgd");
let mut inputd_display_handle = DisplayHandle::new(format!("ihdg.{}", name)).unwrap();
let mut inputd_display_handle = DisplayHandle::new(format!("display.ihdg.{}", name)).unwrap();
let mut scheme = GraphicsScheme::new(device, format!("display.ihdg.{}", name));
+1 -1
View File
@@ -84,7 +84,7 @@ fn daemon(daemon: daemon::Daemon) -> ! {
};
}
let mut inputd_display_handle = DisplayHandle::new_early("vesa").unwrap();
let mut inputd_display_handle = DisplayHandle::new_early("display.vesa").unwrap();
let mut scheme = GraphicsScheme::new(FbAdapter { framebuffers }, "display.vesa".to_owned());
+1 -1
View File
@@ -571,7 +571,7 @@ impl<'a> GpuScheme {
};
let scheme = GraphicsScheme::new(adapter, "display.virtio-gpu".to_owned());
let handle = DisplayHandle::new("virtio-gpu").unwrap();
let handle = DisplayHandle::new("display.virtio-gpu").unwrap();
Ok((scheme, handle))
}
}
+4 -4
View File
@@ -153,13 +153,13 @@ pub struct KeymapActivate {
pub struct DisplayHandle(File);
impl DisplayHandle {
pub fn new<S: Into<String>>(device_name: S) -> io::Result<Self> {
let path = format!("/scheme/input/handle/display/{}", device_name.into());
pub fn new<S: Into<String>>(scheme_name: S) -> io::Result<Self> {
let path = format!("/scheme/input/handle/{}", scheme_name.into());
Ok(Self(File::open(path)?))
}
pub fn new_early<S: Into<String>>(device_name: S) -> io::Result<Self> {
let path = format!("/scheme/input/handle_early/display/{}", device_name.into());
pub fn new_early<S: Into<String>>(scheme_name: S) -> io::Result<Self> {
let path = format!("/scheme/input/handle_early/{}", scheme_name.into());
Ok(Self(File::open(path)?))
}
+3 -3
View File
@@ -209,7 +209,7 @@ impl SchemeSync for InputScheme {
}
}
"handle" | "handle_early" => {
let display = path_parts.collect::<Vec<_>>().join(".");
let display = path_parts.next().ok_or(SysError::new(EINVAL))?;
let needs_handoff = match command {
"handle_early" => self.display.is_none(),
@@ -227,7 +227,7 @@ impl SchemeSync for InputScheme {
if needs_handoff {
self.has_new_events = true;
self.display = Some(display.clone());
self.display = Some(display.to_owned());
for handle in self.handles.values_mut() {
match handle {
@@ -258,7 +258,7 @@ impl SchemeSync for InputScheme {
vec![]
},
notified: false,
device: display,
device: display.to_owned(),
is_earlyfb: command == "handle_early",
}
}