Display connectors
This commit is contained in:
parent
2d40952aab
commit
30ca46d2b7
2 changed files with 16 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
|||
use drm::Device;
|
||||
use drm::control::Device as ControlDevice;
|
||||
use std::os::fd::{AsFd, BorrowedFd};
|
||||
use std::fmt::Debug;
|
||||
|
||||
|
@ -53,4 +54,6 @@ impl Debug for Card {
|
|||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ControlDevice for Card {}
|
12
src/main.rs
12
src/main.rs
|
@ -1,3 +1,5 @@
|
|||
use drm::control::Device;
|
||||
|
||||
mod card;
|
||||
|
||||
fn main() {
|
||||
|
@ -9,4 +11,14 @@ fn main() {
|
|||
};
|
||||
|
||||
println!("{:?}", gpu);
|
||||
|
||||
let resource_handles = gpu.resource_handles().unwrap();
|
||||
|
||||
println!("Connectors:");
|
||||
for handle in resource_handles.connectors() {
|
||||
match gpu.get_connector(*handle, false) {
|
||||
Ok(connector) => println!("\t{} ({:?})", connector.interface().as_str(), connector.state()),
|
||||
Err(_) => {}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue