aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEmil Velikov <[email protected]>2016-08-25 13:32:41 +0100
committerEmil Velikov <[email protected]>2016-10-14 12:53:39 +0100
commit23ed073aa4f87943f660edaa54b60da5a9f2dbb7 (patch)
tree722bb6c7f507b0621e22ba51bf478bc106ea9d06 /src
parent98f5d0106a8ee45e58a6bf162720da3f6f614a95 (diff)
egl/surfaceless: print out a message on zero configs for given format
Currently we print a debug message if the total configs is non-zero only to do the same (at an error level) as we return from the function. Rework the message to print if we're missing a config for the given format. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Gurchetan Singh <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/egl/drivers/dri2/platform_surfaceless.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/egl/drivers/dri2/platform_surfaceless.c b/src/egl/drivers/dri2/platform_surfaceless.c
index 386aa7ab7af..9e2aa7c5630 100644
--- a/src/egl/drivers/dri2/platform_surfaceless.c
+++ b/src/egl/drivers/dri2/platform_surfaceless.c
@@ -181,28 +181,37 @@ static EGLBoolean
surfaceless_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *dpy)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
- static const unsigned int visuals[3][4] = {
- { 0xff0000, 0xff00, 0xff, 0xff000000 }, // ARGB8888
- { 0xff0000, 0xff00, 0xff, 0x0 }, // RGB888
- { 0xf800, 0x7e0, 0x1f, 0x0 }, // RGB565
+ static const struct {
+ const char *format_name;
+ unsigned int rgba_masks[4];
+ } visuals[] = {
+ { "ARGB8888", { 0xff0000, 0xff00, 0xff, 0xff000000 } },
+ { "RGB888", { 0xff0000, 0xff00, 0xff, 0x0 } },
+ { "RGB565", { 0x00f800, 0x07e0, 0x1f, 0x0 } },
};
unsigned int count, i, j;
count = 0;
for (i = 0; i < ARRAY_SIZE(visuals); i++) {
+ int format_count = 0;
+
for (j = 0; dri2_dpy->driver_configs[j]; j++) {
struct dri2_egl_config *dri2_conf;
dri2_conf = dri2_add_config(dpy, dri2_dpy->driver_configs[j],
- count + 1, EGL_PBUFFER_BIT, NULL, visuals[i]);
+ count + 1, EGL_PBUFFER_BIT, NULL, visuals[i].rgba_masks);
- if (dri2_conf)
+ if (dri2_conf) {
count++;
+ format_count++;
+ }
}
- }
- if (!count)
- _eglLog(_EGL_DEBUG, "Can't create surfaceless visuals");
+ if (!format_count) {
+ _eglLog(_EGL_DEBUG, "No DRI config supports native format %s",
+ visuals[i].format_name);
+ }
+ }
return (count != 0);
}