1
0
Fork 0

onscreen/native: Set latest cogl sync_fd on KMS update

See previous commit log on the effects of this.

This means the deadline evasion needs to be added in both cases in
clutter_frame_clock_notify_presented.

v2:
* Use meta_kms_update_set_sync_fd. (Jonas Ådahl)

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3958>
This commit is contained in:
Michel Dänzer 2024-08-16 17:50:12 +02:00 committed by Marge Bot
parent 996eb4b6ae
commit c2621eca15
2 changed files with 6 additions and 2 deletions

View file

@ -391,8 +391,8 @@ clutter_frame_clock_notify_presented (ClutterFrameClock *frame_clock,
frame_clock->shortterm_max_update_duration_us =
CLAMP (frame_clock->last_dispatch_lateness_us + dispatch_to_swap_us +
MAX (swap_to_rendering_done_us,
swap_to_flip_us + frame_clock->deadline_evasion_us),
MAX (swap_to_rendering_done_us, swap_to_flip_us) +
frame_clock->deadline_evasion_us,
frame_clock->shortterm_max_update_duration_us,
frame_clock->refresh_interval_us);

View file

@ -1315,6 +1315,8 @@ meta_onscreen_native_swap_buffers_with_damage (CoglOnscreen *onscreen,
g_autoptr (MetaDrmBuffer) buffer = NULL;
MetaKmsCrtc *kms_crtc;
MetaKmsDevice *kms_device;
int sync_fd;
COGL_TRACE_SCOPED_ANCHOR (MetaRendererNativePostKmsUpdate);
COGL_TRACE_BEGIN_SCOPED (MetaRendererNativeSwapBuffers,
@ -1498,6 +1500,8 @@ meta_onscreen_native_swap_buffers_with_damage (CoglOnscreen *onscreen,
meta_kms_device_get_path (kms_device));
kms_update = meta_frame_native_steal_kms_update (frame_native);
sync_fd = cogl_context_get_latest_sync_fd (cogl_context);
meta_kms_update_set_sync_fd (kms_update, sync_fd);
meta_kms_device_post_update (kms_device, kms_update,
META_KMS_UPDATE_FLAG_NONE);
clutter_frame_set_result (frame, CLUTTER_FRAME_RESULT_PENDING_PRESENTED);