Display CRTC
This commit is contained in:
parent
30ca46d2b7
commit
521ff05d86
1 changed files with 24 additions and 1 deletions
25
src/main.rs
25
src/main.rs
|
@ -17,7 +17,30 @@ fn main() {
|
|||
println!("Connectors:");
|
||||
for handle in resource_handles.connectors() {
|
||||
match gpu.get_connector(*handle, false) {
|
||||
Ok(connector) => println!("\t{} ({:?})", connector.interface().as_str(), connector.state()),
|
||||
Ok(connector) => {
|
||||
println!("\t{} ({:?})", connector.interface().as_str(), connector.state());
|
||||
|
||||
let current_encoder = connector
|
||||
.current_encoder()
|
||||
.and_then(|encoder_handle| gpu.get_encoder(encoder_handle).ok());
|
||||
|
||||
let encoder_info = match current_encoder {
|
||||
Some(encoder) => {
|
||||
|
||||
let crtc_info = encoder.crtc()
|
||||
.and_then(|crtc_handle| gpu.get_crtc(crtc_handle).ok())
|
||||
.and_then(|crtc| Some(format!("{:?}", crtc)))
|
||||
.unwrap_or_else(|| format!("No CRTC data"));
|
||||
|
||||
format!("{:?}, {}", encoder.kind(), crtc_info)
|
||||
}
|
||||
None => format!("No encoder found")
|
||||
};
|
||||
|
||||
println!("\t\tEncoder: {}", encoder_info);
|
||||
|
||||
println!(""); // Add blank line
|
||||
},
|
||||
Err(_) => {}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue