diff --git a/src/main.rs b/src/main.rs index dbfdc7e..b2a5105 100644 --- a/src/main.rs +++ b/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(_) => {} } }