aboutsummaryrefslogtreecommitdiff
path: root/src/backend/tty.rs
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2023-09-14 09:33:42 +0400
committerIvan Molodetskikh <yalterz@gmail.com>2023-09-14 09:33:42 +0400
commit092095ead005ff073344b723f00b08a5b845f186 (patch)
treeccd0522615a0ef80ea5905193518c9689c617e98 /src/backend/tty.rs
parentef11975ec53005b10786e2bfe6f31ba88ff81a34 (diff)
downloadniri-092095ead005ff073344b723f00b08a5b845f186.tar.gz
niri-092095ead005ff073344b723f00b08a5b845f186.tar.bz2
niri-092095ead005ff073344b723f00b08a5b845f186.zip
Add debug flag to wait for frame completion
Diffstat (limited to 'src/backend/tty.rs')
-rw-r--r--src/backend/tty.rs14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/backend/tty.rs b/src/backend/tty.rs
index 475a007d..f2144770 100644
--- a/src/backend/tty.rs
+++ b/src/backend/tty.rs
@@ -8,7 +8,7 @@ use anyhow::{anyhow, Context};
use smithay::backend::allocator::dmabuf::Dmabuf;
use smithay::backend::allocator::gbm::{GbmAllocator, GbmBufferFlags, GbmDevice};
use smithay::backend::allocator::{Format as DrmFormat, Fourcc};
-use smithay::backend::drm::compositor::DrmCompositor;
+use smithay::backend::drm::compositor::{DrmCompositor, PrimaryPlaneElement};
use smithay::backend::drm::{DrmDevice, DrmDeviceFd, DrmEvent, DrmEventTime};
use smithay::backend::egl::{EGLContext, EGLDisplay};
use smithay::backend::libinput::{LibinputInputBackend, LibinputSessionInterface};
@@ -33,6 +33,7 @@ use smithay::wayland::dmabuf::{DmabufFeedbackBuilder, DmabufGlobal, DmabufState,
use smithay_drm_extras::drm_scanner::{DrmScanEvent, DrmScanner};
use smithay_drm_extras::edid::EdidInfo;
+use crate::config::Config;
use crate::niri::{OutputRenderElements, State};
use crate::utils::get_monotonic_time;
use crate::{LoopData, Niri};
@@ -626,6 +627,7 @@ impl Tty {
pub fn render(
&mut self,
+ config: &Config,
niri: &mut Niri,
output: &Output,
elements: &[OutputRenderElements<GlesRenderer>],
@@ -645,10 +647,12 @@ impl Tty {
Ok(res) => {
assert!(!res.needs_sync());
- // if let PrimaryPlaneElement::Swapchain(element) = res.primary_element {
- // let _span = tracy_client::span!("wait for sync");
- // element.sync.wait();
- // }
+ if config.debug.wait_for_frame_completion_before_queueing {
+ if let PrimaryPlaneElement::Swapchain(element) = res.primary_element {
+ let _span = tracy_client::span!("wait for completion");
+ element.sync.wait();
+ }
+ }
if res.damage.is_some() {
let presentation_feedbacks =