wl_surface: dispatch frame requests from vblank event handlers
This commit is contained in:
parent
7800488555
commit
3fcc6d6e36
13 changed files with 65 additions and 137 deletions
|
|
@ -221,7 +221,6 @@ impl Backend for MetalBackend {
|
|||
connector.crtc.take();
|
||||
connector.on_change.clear();
|
||||
connector.present_trigger.clear();
|
||||
connector.render_result.take();
|
||||
connector.active_framebuffer.take();
|
||||
connector.next_framebuffer.take();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -486,8 +486,6 @@ impl MetalConnector {
|
|||
if damage == 0 {
|
||||
return None;
|
||||
}
|
||||
let mut rr = self.render_result.borrow_mut();
|
||||
rr.output_id = node.id;
|
||||
let render_hw_cursor = !self.cursor_enabled.get();
|
||||
let mode = node.global.mode.get();
|
||||
let pass = create_render_pass(
|
||||
|
|
@ -495,7 +493,6 @@ impl MetalConnector {
|
|||
&**node,
|
||||
&self.state,
|
||||
Some(node.global.pos.get()),
|
||||
Some(&mut rr),
|
||||
node.global.persistent.scale.get(),
|
||||
true,
|
||||
render_hw_cursor,
|
||||
|
|
@ -503,7 +500,6 @@ impl MetalConnector {
|
|||
node.global.persistent.transform.get(),
|
||||
Some(&self.state.damage_visualizer),
|
||||
);
|
||||
rr.dispatch_frame_requests(self.state.now_msec());
|
||||
Some(Latched { pass, damage })
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ use {
|
|||
wl_output::OutputId,
|
||||
wp_presentation_feedback::{KIND_HW_COMPLETION, KIND_VSYNC},
|
||||
},
|
||||
renderer::RenderResult,
|
||||
state::State,
|
||||
udev::UdevDevice,
|
||||
utils::{
|
||||
|
|
@ -447,8 +446,6 @@ pub struct MetalConnector {
|
|||
|
||||
pub present_trigger: AsyncEvent,
|
||||
|
||||
pub render_result: RefCell<RenderResult>,
|
||||
|
||||
pub cursor_x: Cell<i32>,
|
||||
pub cursor_y: Cell<i32>,
|
||||
pub cursor_enabled: Cell<bool>,
|
||||
|
|
@ -1044,7 +1041,6 @@ fn create_connector(
|
|||
crtc: Default::default(),
|
||||
on_change: Default::default(),
|
||||
present_trigger: Default::default(),
|
||||
render_result: RefCell::new(Default::default()),
|
||||
cursor_x: Cell::new(0),
|
||||
cursor_y: Cell::new(0),
|
||||
cursor_enabled: Cell::new(false),
|
||||
|
|
@ -1912,6 +1908,7 @@ impl MetalBackend {
|
|||
};
|
||||
self.update_sequence(&connector, sequence);
|
||||
connector.queue_sequence();
|
||||
self.state.vblank(connector.connector_id);
|
||||
let dd = connector.display.borrow();
|
||||
connector
|
||||
.next_flip_nsec
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ use {
|
|||
format::XRGB8888,
|
||||
gfx_api::{GfxContext, GfxError, GfxFramebuffer, GfxTexture},
|
||||
ifs::wl_output::OutputId,
|
||||
renderer::RenderResult,
|
||||
state::State,
|
||||
utils::{
|
||||
clonecell::CloneCell, copyhashmap::CopyHashMap, errorfmt::ErrorFmt, numcell::NumCell,
|
||||
|
|
@ -239,7 +238,6 @@ pub async fn create(state: &Rc<State>) -> Result<Rc<XBackend>, XBackendError> {
|
|||
root,
|
||||
scheduled_present: Default::default(),
|
||||
grab_requests: Default::default(),
|
||||
render_result: Default::default(),
|
||||
drm_device_id: state.drm_dev_ids.next(),
|
||||
drm_dev,
|
||||
});
|
||||
|
|
@ -274,7 +272,6 @@ pub struct XBackend {
|
|||
root: u32,
|
||||
scheduled_present: AsyncQueue<Rc<XOutput>>,
|
||||
grab_requests: AsyncQueue<(Rc<XSeat>, bool)>,
|
||||
render_result: RefCell<RenderResult>,
|
||||
drm_device_id: DrmDeviceId,
|
||||
drm_dev: dev_t,
|
||||
}
|
||||
|
|
@ -702,6 +699,7 @@ impl XBackend {
|
|||
} else {
|
||||
image.render_on_idle.set(true);
|
||||
}
|
||||
self.state.vblank(output.id);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
@ -745,13 +743,9 @@ impl XBackend {
|
|||
image.last_serial.set(serial);
|
||||
|
||||
if let Some(node) = self.state.root.outputs.get(&output.id) {
|
||||
let res = self.state.present_output(
|
||||
&node,
|
||||
&image.fb.get(),
|
||||
&image.tex.get(),
|
||||
&mut self.render_result.borrow_mut(),
|
||||
true,
|
||||
);
|
||||
let res = self
|
||||
.state
|
||||
.present_output(&node, &image.fb.get(), &image.tex.get(), true);
|
||||
if let Err(e) = res {
|
||||
log::error!("Could not render screen: {}", ErrorFmt(e));
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue