From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Wed, 27 Mar 2024 18:16:17 +0100 Subject: [PATCH] drm-buffer-gbm: Do not call ensure_fb_id from lock_front When preparing a frame for scanout on a secondary GPU, calling meta_drm_buffer_gbm_ensure_fb_id for the primary GPU device is unnecessary and potentially harmful. --- src/backends/native/meta-drm-buffer-gbm.c | 2 +- src/backends/native/meta-onscreen-native.c | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/backends/native/meta-onscreen-native.c b/src/backends/native/meta-onscreen-native.c index e40b03f3eaf3..f2bae4f00d6d 100644 --- a/src/backends/native/meta-onscreen-native.c +++ b/src/backends/native/meta-onscreen-native.c @@ -1373,6 +1373,17 @@ meta_onscreen_native_swap_buffers_with_damage (CoglOnscreen *onscreen, #endif } + if (!meta_drm_buffer_ensure_fb_id (onscreen_native->gbm.next_fb, &error)) + { + g_warning ("Failed to ensure KMS FB ID on %s: %s", + meta_device_file_get_path (render_device_file), + error->message); + + frame_info->flags |= COGL_FRAME_INFO_FLAG_SYMBOLIC; + meta_onscreen_native_notify_frame_complete (onscreen); + return; + } + /* * If we changed EGL context, cogl will have the wrong idea about what is * current, making it fail to set it when it needs to. Avoid that by making