From 3920ae0d142cfca913374c9682b9073e8c0b3e2e Mon Sep 17 00:00:00 2001 From: "Mun, Gwan-gyeong" Date: Fri, 30 Dec 2016 09:47:55 +0900 Subject: [PATCH] tpl_wayland_egl: When wl_display_dispatch_queue() fails, print infomation of error in detail on __tpl_wayland_egl_surface_wait_dequeuable() When the wl_display_dispatch_queue() fails on __tpl_wayland_egl_surface_wait_dequeuable(), it generally prints errno and errno_str. If errno is EPROTO, it prints error interface name and error enumeration code. Change-Id: I774774294a396164a9b9c66492c9cb79f18257cc Signed-off-by: Mun, Gwan-gyeong --- src/tpl_wayland_egl.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/tpl_wayland_egl.c b/src/tpl_wayland_egl.c index 5dea7ed..358432c 100644 --- a/src/tpl_wayland_egl.c +++ b/src/tpl_wayland_egl.c @@ -941,8 +941,24 @@ __tpl_wayland_egl_surface_wait_dequeuable(tpl_surface_t *surface) /* Application sent all buffers to the server. Wait for server response. */ if (wl_display_dispatch_queue(wayland_egl_display->wl_dpy, wayland_egl_display->wl_tbm_event_queue) == -1) { + int dpy_err; + char buf[1024]; + strerror_r(errno, buf, sizeof(buf)); + + TPL_ERR("falied to wl_display_dispatch_queue. error:%d(%s)", errno, + buf); + + dpy_err = wl_display_get_error(wayland_egl_display->wl_dpy); + if (dpy_err == EPROTO) { + const struct wl_interface *err_interface; + uint32_t err_proxy_id, err_code; + err_code = wl_display_get_protocol_error(wayland_egl_display->wl_dpy, + &err_interface, &err_proxy_id); + TPL_ERR("[Protocol Error] interface: %s, error_code: %d, proxy_id: %d", + err_interface->name, err_code, err_proxy_id); + } + ret = TPL_ERROR_INVALID_OPERATION; - TPL_ERR("falied to wl_display_dispatch_queue."); break; } } -- 2.7.4