diff options
author | Tomasz Figa <tfiga@chromium.org> | 2016-07-15 16:53:49 +0900 |
---|---|---|
committer | Emil Velikov <emil.l.velikov@gmail.com> | 2016-07-20 15:48:03 +0100 |
commit | 565fa6b748e952098b2e69eff4be6ac15c204043 (patch) | |
tree | d3ef787925ffdb0ab6ae067d7917e8cb280dac7c /src/egl | |
parent | 94282b6dd0e7c15030b09b6789a7aa5a15e8a869 (diff) | |
download | external_mesa3d-565fa6b748e952098b2e69eff4be6ac15c204043.zip external_mesa3d-565fa6b748e952098b2e69eff4be6ac15c204043.tar.gz external_mesa3d-565fa6b748e952098b2e69eff4be6ac15c204043.tar.bz2 |
egl/android: Add some useful error messages
It is much easier to debug issues when the application gives some
meaningful error messages. This patch adds few to the EGL Android
platform backend.
Signed-off-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Diffstat (limited to 'src/egl')
-rw-r--r-- | src/egl/drivers/dri2/platform_android.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c index 302eb85..37616f9 100644 --- a/src/egl/drivers/dri2/platform_android.c +++ b/src/egl/drivers/dri2/platform_android.c @@ -353,8 +353,10 @@ update_buffers(struct dri2_egl_surface *dri2_surf) return 0; /* try to dequeue the next back buffer */ - if (!dri2_surf->buffer && !droid_window_dequeue_buffer(dri2_surf)) + if (!dri2_surf->buffer && !droid_window_dequeue_buffer(dri2_surf)) { + _eglLog(_EGL_WARNING, "Could not dequeue buffer from native window"); return -1; + } /* free outdated buffers and update the surface size */ if (dri2_surf->base.Width != dri2_surf->buffer->width || @@ -379,16 +381,21 @@ get_back_bo(struct dri2_egl_surface *dri2_surf) return -1; fd = get_native_buffer_fd(dri2_surf->buffer); - if (fd < 0) + if (fd < 0) { + _eglLog(_EGL_WARNING, "Could not get native buffer FD"); return -1; + } fourcc = get_fourcc(get_format(dri2_surf->buffer->format)); pitch = dri2_surf->buffer->stride * get_format_bpp(dri2_surf->buffer->format); - if (fourcc == -1 || pitch == 0) + if (fourcc == -1 || pitch == 0) { + _eglLog(_EGL_WARNING, "Invalid buffer fourcc(%x) or pitch(%d)", + fourcc, pitch); return -1; + } dri2_surf->dri_image = dri2_dpy->image->createImageFromFds(dri2_dpy->dri_screen, |