1
0
Fork 0
forked from wry/wry

metal: implement VRR

This commit is contained in:
Julian Orth 2024-07-17 16:30:52 +02:00
parent cd09e57568
commit 2d7c13b0b4
35 changed files with 1320 additions and 91 deletions

View file

@ -30,7 +30,8 @@ use {
video::{
connectors, drm_devices, on_connector_connected, on_connector_disconnected,
on_graphics_initialized, on_new_connector, on_new_drm_device,
set_direct_scanout_enabled, set_gfx_api, Connector, DrmDevice,
set_direct_scanout_enabled, set_gfx_api, set_vrr_cursor_hz, set_vrr_mode, Connector,
DrmDevice,
},
},
std::{cell::RefCell, io::ErrorKind, path::PathBuf, rc::Rc},
@ -555,6 +556,14 @@ impl Output {
Some(m) => c.set_mode(m.width(), m.height(), Some(m.refresh_rate())),
}
}
if let Some(vrr) = &self.vrr {
if let Some(mode) = vrr.mode {
c.set_vrr_mode(mode);
}
if let Some(hz) = vrr.cursor_hz {
c.set_vrr_cursor_hz(hz);
}
}
}
}
@ -1017,6 +1026,14 @@ fn load_config(initial_load: bool, persistent: &Rc<PersistentState>) {
.seat
.set_window_management_key(window_management_key);
}
if let Some(vrr) = config.vrr {
if let Some(mode) = vrr.mode {
set_vrr_mode(mode);
}
if let Some(hz) = vrr.cursor_hz {
set_vrr_cursor_hz(hz);
}
}
}
fn create_command(exec: &Exec) -> Command {