1
0
Fork 0
forked from wry/wry

wayland: implement commit-timing-v1

This commit is contained in:
Julian Orth 2024-09-26 16:18:17 +02:00
parent d45aaffdb3
commit fac5445f2e
19 changed files with 434 additions and 15 deletions

View file

@ -65,6 +65,15 @@ pub struct Mode {
pub refresh_rate_millihz: u32,
}
impl Mode {
pub fn refresh_nsec(&self) -> u64 {
match self.refresh_rate_millihz {
0 => u64::MAX,
n => 1_000_000_000_000 / (n as u64),
}
}
}
#[derive(Clone, Debug)]
pub struct MonitorInfo {
pub modes: Vec<Mode>,