1
0
Fork 0

onscreen/native: Don't set sync_fd for KMS update if secondary GPU used

The sync_fd represents only the primary GPU work.

Fixes: c2621eca15 ("onscreen/native: Set latest cogl sync_fd on KMS update")

v2:
* Use g_steal_fd. (Georges Basile Stavracas Neto, Sebastian Wick)

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4060>
This commit is contained in:
Michel Dänzer 2024-10-02 17:45:41 +02:00 committed by Marge Bot
parent 64ce8b2071
commit 118f294a48

View file

@ -1314,7 +1314,6 @@ meta_onscreen_native_swap_buffers_with_damage (CoglOnscreen *onscreen,
g_autoptr (MetaDrmBuffer) buffer = NULL; g_autoptr (MetaDrmBuffer) buffer = NULL;
MetaKmsCrtc *kms_crtc; MetaKmsCrtc *kms_crtc;
MetaKmsDevice *kms_device; MetaKmsDevice *kms_device;
int sync_fd;
COGL_TRACE_SCOPED_ANCHOR (MetaRendererNativePostKmsUpdate); COGL_TRACE_SCOPED_ANCHOR (MetaRendererNativePostKmsUpdate);
@ -1499,8 +1498,15 @@ meta_onscreen_native_swap_buffers_with_damage (CoglOnscreen *onscreen,
meta_kms_device_get_path (kms_device)); meta_kms_device_get_path (kms_device));
kms_update = meta_frame_native_steal_kms_update (frame_native); 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); if (!secondary_gpu_used)
{
int sync_fd;
sync_fd = cogl_context_get_latest_sync_fd (cogl_context);
meta_kms_update_set_sync_fd (kms_update, g_steal_fd (&sync_fd));
}
meta_kms_device_post_update (kms_device, kms_update, meta_kms_device_post_update (kms_device, kms_update,
META_KMS_UPDATE_FLAG_NONE); META_KMS_UPDATE_FLAG_NONE);
clutter_frame_set_result (frame, CLUTTER_FRAME_RESULT_PENDING_PRESENTED); clutter_frame_set_result (frame, CLUTTER_FRAME_RESULT_PENDING_PRESENTED);