From 100c02e5146be08647e2e5a09fda85c42e3a234b Mon Sep 17 00:00:00 2001 From: Daniel van Vugt Date: Thu, 13 Oct 2022 16:06:57 +0800 Subject: [PATCH] drm-buffer: Clarify misleading error message on drmModeAddFB2 failure The real error is more likely to do with the drmModeAddFB2 failure than the format not being compatible with drmModeAddFB. Related: https://gitlab.gnome.org/GNOME/mutter/-/issues/2379 Part-of: --- src/backends/native/meta-drm-buffer.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/backends/native/meta-drm-buffer.c b/src/backends/native/meta-drm-buffer.c index 86dfb16da..c7eeca4f6 100644 --- a/src/backends/native/meta-drm-buffer.c +++ b/src/backends/native/meta-drm-buffer.c @@ -127,10 +127,12 @@ meta_drm_buffer_do_ensure_fb_id (MetaDrmBuffer *buffer, { g_set_error (error, G_IO_ERROR, - G_IO_ERROR_FAILED, - "drmModeAddFB does not support format '%s' (0x%x)", - meta_drm_format_to_string (&tmp, fb_args->format), - fb_args->format); + g_io_error_from_errno (errno), + "drmModeAddFB2 failed (%s) and drmModeAddFB cannot be " + "used as a fallback because format=0x%x (%s).", + g_strerror (errno), + fb_args->format, + meta_drm_format_to_string (&tmp, fb_args->format)); return FALSE; }