aboutsummaryrefslogtreecommitdiff
path: root/src/backend/tty.rs
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2023-10-13 13:04:41 +0400
committerIvan Molodetskikh <yalterz@gmail.com>2023-10-13 13:30:36 +0400
commit29053a807b8969d3e2eb88c7065a087aaa137a31 (patch)
tree34e0d75df75acdd25aa1aca4b5e7b49d85a789c6 /src/backend/tty.rs
parent0a3274749563067b06af83f870ff39dc503a5355 (diff)
downloadniri-29053a807b8969d3e2eb88c7065a087aaa137a31.tar.gz
niri-29053a807b8969d3e2eb88c7065a087aaa137a31.tar.bz2
niri-29053a807b8969d3e2eb88c7065a087aaa137a31.zip
Return RenderResult from render()
Diffstat (limited to 'src/backend/tty.rs')
-rw-r--r--src/backend/tty.rs16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/backend/tty.rs b/src/backend/tty.rs
index 74f3e9ed..75626898 100644
--- a/src/backend/tty.rs
+++ b/src/backend/tty.rs
@@ -43,6 +43,8 @@ use crate::niri::{OutputRenderElements, State, RedrawState};
use crate::utils::get_monotonic_time;
use crate::Niri;
+use super::RenderResult;
+
const SUPPORTED_COLOR_FORMATS: &[Fourcc] = &[Fourcc::Argb8888, Fourcc::Abgr8888];
pub struct Tty {
@@ -837,18 +839,20 @@ impl Tty {
output: &Output,
elements: &[OutputRenderElements<GlesRenderer>],
target_presentation_time: Duration,
- ) {
+ ) -> RenderResult {
let span = tracy_client::span!("Tty::render");
+ let mut rv = RenderResult::Error;
+
let Some(device) = self.output_device.as_mut() else {
error!("missing output device");
- return;
+ return rv;
};
let tty_state: &TtyOutputState = output.user_data().get().unwrap();
let Some(surface) = device.surfaces.get_mut(&tty_state.crtc) else {
error!("missing surface");
- return;
+ return rv;
};
span.emit_text(&surface.name);
@@ -896,12 +900,14 @@ impl Tty {
}
};
- return;
+ return RenderResult::Submitted;
}
Err(err) => {
error!("error queueing frame: {err}");
}
}
+ } else {
+ rv = RenderResult::NoDamage;
}
}
Err(err) => {
@@ -915,6 +921,8 @@ impl Tty {
// Queue a timer to fire at the predicted vblank time.
queue_estimated_vblank_timer(niri, output.clone(), target_presentation_time);
+
+ rv
}
pub fn change_vt(&mut self, vt: i32) {