From c2273784ce3c82ad1bf0211c31f44e5f52f2e44c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Tue, 10 Sep 2024 16:58:02 +0200 Subject: [PATCH] backend/native: Log more about what pixel formats are attempted This might help identifying pixel format related issues. Part-of: --- src/backends/native/meta-renderer-native.c | 27 +++++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/src/backends/native/meta-renderer-native.c b/src/backends/native/meta-renderer-native.c index 7034206bc..ff5d5002a 100644 --- a/src/backends/native/meta-renderer-native.c +++ b/src/backends/native/meta-renderer-native.c @@ -428,13 +428,23 @@ meta_renderer_native_choose_gbm_format (MetaKmsPlane *kms_plane, for (i = 0; i < num_formats; i++) { + g_autoptr (GError) local_error = NULL; + MetaDrmFormatBuf format_string; + + meta_drm_format_to_string (&format_string, formats[i]); + g_clear_error (error); if (kms_plane && !meta_kms_plane_is_format_supported (kms_plane, formats[i])) { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, + g_set_error (&local_error, G_IO_ERROR, G_IO_ERROR_FAILED, "KMS CRTC doesn't support format"); + meta_topic (META_DEBUG_RENDER, + "Not using format %s: %s", + format_string.s, + local_error->message); + g_propagate_error (error, g_steal_pointer (&local_error)); continue; } @@ -443,17 +453,22 @@ meta_renderer_native_choose_gbm_format (MetaKmsPlane *kms_plane, attributes, formats[i], out_config, - error)) + &local_error)) { - MetaDrmFormatBuf format_string; - - meta_drm_format_to_string (&format_string, formats[i]); - meta_topic (META_DEBUG_KMS, + meta_topic (META_DEBUG_RENDER, "Using GBM format %s for primary GPU EGL %s", format_string.s, purpose); return TRUE; } + else + { + meta_topic (META_DEBUG_RENDER, + "Not using format %s: %s", + format_string.s, + local_error->message); + g_propagate_error (error, g_steal_pointer (&local_error)); + } } return FALSE;