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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2656>
This commit is contained in:
Daniel van Vugt 2022-10-13 16:06:57 +08:00
parent 21cddbae95
commit 100c02e514

View File

@ -127,10 +127,12 @@ meta_drm_buffer_do_ensure_fb_id (MetaDrmBuffer *buffer,
{ {
g_set_error (error, g_set_error (error,
G_IO_ERROR, G_IO_ERROR,
G_IO_ERROR_FAILED, g_io_error_from_errno (errno),
"drmModeAddFB does not support format '%s' (0x%x)", "drmModeAddFB2 failed (%s) and drmModeAddFB cannot be "
meta_drm_format_to_string (&tmp, fb_args->format), "used as a fallback because format=0x%x (%s).",
fb_args->format); g_strerror (errno),
fb_args->format,
meta_drm_format_to_string (&tmp, fb_args->format));
return FALSE; return FALSE;
} }