egl: Improve the debugging of gbm format matching in DRI configs.
authorEric Anholt <eric@anholt.net>
Mon, 29 Oct 2018 16:28:00 +0000 (09:28 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 12 Nov 2018 23:20:23 +0000 (15:20 -0800)
Previously the debug would be:

libEGL debug: No DRI config supports native format 0x20203852
libEGL debug: No DRI config supports native format 0x38385247

but

libEGL debug: No DRI config supports native format R8
libEGL debug: No DRI config supports native format GR88

is a lot easier to understand.

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
src/egl/drivers/dri2/platform_drm.c

index 68ec8322e978c17bbf1f7aa798ab5746c653c937..fb346e0073321a3bccaee5e3b4bdeab88c04ba11 100644 (file)
@@ -664,8 +664,9 @@ drm_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *disp)
 
    for (unsigned i = 0; i < ARRAY_SIZE(format_count); i++) {
       if (!format_count[i]) {
-         _eglLog(_EGL_DEBUG, "No DRI config supports native format 0x%x",
-                 visuals[i].gbm_format);
+         struct gbm_format_name_desc desc;
+         _eglLog(_EGL_DEBUG, "No DRI config supports native format %s",
+                 gbm_format_get_name(visuals[i].gbm_format, &desc));
       }
    }