tpl_wayland_egl: Used tdm_client_handle_events_timeout() to prevent deadlock. 29/175429/2
authorjoonbum.ko <joonbum.ko@samsung.com>
Tue, 10 Apr 2018 05:20:57 +0000 (14:20 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Fri, 13 Apr 2018 07:47:52 +0000 (07:47 +0000)
Change-Id: Idf5f0e33b72364e0dd4646b0d9790c4a6e05f04d
Signed-off-by: joonbum.ko <joonbum.ko@samsung.com>
src/tpl_wayland_egl.c

index 539be9e..9182de0 100644 (file)
@@ -733,7 +733,13 @@ __tpl_wayland_egl_surface_wait_vblank(tpl_surface_t *surface)
        while (wayland_egl_surface->vblank_done == TPL_FALSE &&
                   wayland_egl_surface->tdm_vblank != NULL &&
                   tdm_client_vblank_is_waiting(wayland_egl_surface->tdm_vblank)) {
-               tdm_err = tdm_client_handle_events(wayland_egl_display->tdm_client);
+               tdm_err = tdm_client_handle_events_timeout(wayland_egl_display->tdm_client,
+                                                                                                  1000);
+               if (tdm_err == TDM_ERROR_TIMEOUT) {
+                       TPL_ERR("Failed to tdm_client_handle_events. timeour (>1000)");
+                       wayland_egl_surface->vblank_done = TPL_TRUE;
+                       break;
+               }
 
                if (tdm_err != TDM_ERROR_NONE) {
                        TPL_ERR("Failed to tdm_client_handle_events.");