File: list_modes.rs

package info (click to toggle)
rust-drm 0.14.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 340 kB
  • sloc: makefile: 2
file content (16 lines) | stat: -rw-r--r-- 559 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/// Check the `util` module to see how the `Card` structure is implemented.
pub mod utils;
use crate::utils::*;

pub fn main() {
    let card = Card::open_global();

    let resources = card.resource_handles().unwrap();
    for connector in resources.connectors().iter() {
        let info = card.get_connector(*connector, false).unwrap();
        println!("Connector {:?}: {:?}", info.interface(), info.state());
        if info.state() == drm::control::connector::State::Connected {
            println!("\t Modes:\n{:#?}", info.modes());
        }
    }
}