diff options
author | Derek Foreman <derekf@osg.samsung.com> | 2015-05-20 14:57:58 -0500 |
---|---|---|
committer | Bryce Harrington <bryce@osg.samsung.com> | 2015-05-21 18:41:24 -0700 |
commit | a7e199147a1951fa27781c9a379d4f068a6aa2df (patch) | |
tree | a42a0e4dc91af603e7c62d8f51b75e1cf75f9543 | |
parent | 0ccf8e22387db6f183e501e6fa71776fb112fb7a (diff) | |
download | weston-a7e199147a1951fa27781c9a379d4f068a6aa2df.tar.gz weston-a7e199147a1951fa27781c9a379d4f068a6aa2df.tar.bz2 weston-a7e199147a1951fa27781c9a379d4f068a6aa2df.zip |
gl-renderer: Make the error logging a little nicer
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
-rw-r--r-- | src/gl-renderer.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/gl-renderer.c b/src/gl-renderer.c index 772c6a85..d18e1245 100644 --- a/src/gl-renderer.c +++ b/src/gl-renderer.c @@ -1925,7 +1925,6 @@ match_config_to_visual(EGLDisplay egl_display, return i; } - weston_log("Unable to find an appropriate EGL config.\n"); return -1; } @@ -1939,16 +1938,19 @@ egl_choose_config(struct gl_renderer *gr, const EGLint *attribs, EGLConfig *configs; int i, config_index = -1; - if (!eglGetConfigs(gr->egl_display, NULL, 0, &count) || count < 1) + if (!eglGetConfigs(gr->egl_display, NULL, 0, &count) || count < 1) { + weston_log("No EGL configs to choose from.\n"); return -1; - + } configs = calloc(count, sizeof *configs); if (!configs) return -1; if (!eglChooseConfig(gr->egl_display, attribs, configs, - count, &matched) || !matched) + count, &matched) || !matched) { + weston_log("No EGL configs with appropriate attributes.\n"); goto out; + } if (!visual_id) config_index = 0; @@ -1967,6 +1969,10 @@ out: if (config_index == -1) return -1; + if (i > 1) + weston_log("Unable to use first choice EGL config with id" + " 0x%x, succeeded with alternate id 0x%x.\n", + visual_id[0], visual_id[i - 1]); return 0; } @@ -2356,7 +2362,7 @@ gl_renderer_create(struct weston_compositor *ec, EGLenum platform, if (egl_choose_config(gr, attribs, visual_id, n_ids, &gr->egl_config) < 0) { weston_log("failed to choose EGL config\n"); - goto err_egl; + goto err_config; } ec->renderer = &gr->base; @@ -2375,6 +2381,7 @@ gl_renderer_create(struct weston_compositor *ec, EGLenum platform, err_egl: gl_renderer_print_egl_error_state(); +err_config: free(gr); return -1; } |