tpl_wayland_egl: When wl_display_dispatch_queue() fails, print infomation of error... 79/107779/2
authorMun, Gwan-gyeong <kk.moon@samsung.com>
Fri, 30 Dec 2016 00:47:55 +0000 (09:47 +0900)
committerGwan-gyeong Mun <kk.moon@samsung.com>
Wed, 11 Jan 2017 09:58:29 +0000 (01:58 -0800)
                 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 <kk.moon@samsung.com>
src/tpl_wayland_egl.c

index 5dea7ed..358432c 100644 (file)
@@ -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;
                }
        }