1
0
Fork 0
forked from wry/wry

metal: fix presentation-feedback parameters

This commit is contained in:
Julian Orth 2024-09-13 16:42:35 +02:00
parent a7408555be
commit 7786b55971
3 changed files with 22 additions and 4 deletions

View file

@ -257,6 +257,8 @@ impl MetalConnector {
apply_change!(plane.crtc_w);
apply_change!(plane.crtc_h);
if let Some(fb) = present_fb {
self.presentation_is_zero_copy
.set(fb.direct_scanout_data.is_some());
if fb.direct_scanout_data.is_none() {
self.next_buffer.fetch_add(1);
}
@ -404,9 +406,11 @@ impl MetalConnector {
if try_async_flip {
res = changes.commit(FLAGS | DRM_MODE_PAGE_FLIP_ASYNC, 0);
if res.is_ok() {
self.presentation_is_sync.set(false);
break 'commit;
}
}
self.presentation_is_sync.set(true);
res = changes.commit(FLAGS, 0);
}
res.map_err(MetalError::Commit)