mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-21 02:01:55 +07:00
Add emulate-zero-presentation-time debug flag
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user