Add emulate-zero-presentation-time debug flag

This commit is contained in:
Ivan Molodetskikh
2024-03-01 07:49:10 +04:00
parent 28977d1d3f
commit 92d9c7ff4f
3 changed files with 12 additions and 0 deletions
+2
View File
@@ -810,6 +810,8 @@ pub struct DebugConfig {
pub disable_cursor_plane: bool,
#[knuffel(child, unwrap(argument))]
pub render_drm_device: Option<PathBuf>,
#[knuffel(child)]
pub emulate_zero_presentation_time: bool,
}
impl Config {
+5
View File
@@ -557,4 +557,9 @@ debug {
// Enable the color-transformations capability of the Smithay renderer.
// May cause a slight decrease in rendering performance.
// enable-color-transformations-capability
// Emulate zero (unknown) presentation time returned from DRM.
// This is a thing on NVIDIA proprietary drivers, so this flag can be
// used to test that we don't break too hard on those systems.
// emulate-zero-presentation-time
}
+5
View File
@@ -902,6 +902,11 @@ impl Tty {
Duration::ZERO
}
};
let presentation_time = if niri.config.borrow().debug.emulate_zero_presentation_time {
Duration::ZERO
} else {
presentation_time
};
let message = if presentation_time.is_zero() {
format!("vblank on {name}, presentation time unknown")