1
0
Fork 0
forked from wry/wry

all: use tracy for tracing

This commit is contained in:
Julian Orth 2024-09-15 18:08:54 +02:00
parent 50186e764e
commit ccad3cf0fb
56 changed files with 647 additions and 171 deletions

View file

@ -13,6 +13,7 @@ use {
},
theme::Color,
time::Time,
tracy::FrameName,
tree::OutputNode,
utils::{errorfmt::ErrorFmt, oserror::OsError, transform_ext::TransformExt},
video::{
@ -90,6 +91,8 @@ impl MetalConnector {
}
pub async fn present_loop(self: Rc<Self>) {
#[cfg_attr(not(feature = "tracy"), expect(unused_variables))]
let frame_name = FrameName::get(&self.kernel_id().to_string());
let mut cur_sec = 0;
let mut max = 0;
loop {
@ -113,6 +116,7 @@ impl MetalConnector {
expected_sequence += 1;
}
}
frame!(frame_name);
if let Err(e) = self.present_once().await {
log::error!("Could not present: {}", ErrorFmt(e));
continue;
@ -293,6 +297,7 @@ impl MetalConnector {
cursor: Option<&CursorProgramming>,
new_fb: Option<&PresentFb>,
) -> Result<(), MetalError> {
zone!("program_connector");
let mut changes = self.master.change();
let mut try_async_flip = self.try_async_flip();
macro_rules! change {

View file

@ -1089,10 +1089,11 @@ fn create_connector(
presentation_is_zero_copy: Cell::new(false),
});
let futures = ConnectorFutures {
_present: backend
.state
.eng
.spawn2(Phase::Present, slf.clone().present_loop()),
_present: backend.state.eng.spawn2(
"present loop",
Phase::Present,
slf.clone().present_loop(),
),
};
Ok((slf, futures))
}
@ -1791,10 +1792,10 @@ impl MetalBackend {
}
}
let drm_handler = self
.state
.eng
.spawn(self.clone().handle_drm_events(slf.clone()));
let drm_handler = self.state.eng.spawn(
"handle drm events",
self.clone().handle_drm_events(slf.clone()),
);
slf.dev.handle_events.handle_events.set(Some(drm_handler));
Ok(slf)