Added codes about processing for event_queue of wl_tbm_queue. 75/79775/4
authorjoonbum.ko <joonbum.ko@samsung.com>
Wed, 13 Jul 2016 00:50:43 +0000 (09:50 +0900)
committerjoonbum.ko <joonbum.ko@samsung.com>
Tue, 19 Jul 2016 07:33:26 +0000 (16:33 +0900)
Change-Id: I687624549548c405a2325e68072991a21b7e6a54
Signed-off-by: joonbum.ko <joonbum.ko@samsung.com>
src/tpl_wayland_egl.c

index 9606dd8..dde27fe 100644 (file)
@@ -725,6 +725,20 @@ __tpl_wayland_egl_surface_wait_dequeuable(tpl_surface_t *surface)
                        wl_proxy_set_queue(wayland_egl_buffer->wl_proxy, queue);
        }
 
+       /* wayland_egl_surface->wl_proxy has to receive below wayland events.
+        * - buffer_attached_with_id
+        * - buffer_attached_with_fd
+        * - active
+        * - deactive
+     *
+        * When wayland_egl_surface->wl_proxy( == wl_tbm_queue ) could not receive
+        * any events, tpl_surface cannot get a buffer.
+        * So, we have to manage event queue about wl_tbm_queue along with wl_buffer.
+        */
+
+       if (wayland_egl_surface->wl_proxy)
+               wl_proxy_set_queue(wayland_egl_surface->wl_proxy, queue);
+
        wl_display_dispatch_pending((struct wl_display *)surface->display->native_handle);
 
        if (tbm_surface_queue_can_dequeue(wayland_egl_surface->tbm_queue, 0))
@@ -735,6 +749,9 @@ __tpl_wayland_egl_surface_wait_dequeuable(tpl_surface_t *surface)
                                wl_proxy_set_queue(wayland_egl_buffer->wl_proxy, NULL);
                }
 
+               if (wayland_egl_surface->wl_proxy)
+                       wl_proxy_set_queue(wayland_egl_surface->wl_proxy, NULL);
+
                wl_event_queue_destroy(queue);
 
                return TPL_ERROR_NONE;
@@ -761,6 +778,9 @@ __tpl_wayland_egl_surface_wait_dequeuable(tpl_surface_t *surface)
                        wl_proxy_set_queue(wayland_egl_buffer->wl_proxy, NULL);
        }
 
+       if (wayland_egl_surface->wl_proxy)
+               wl_proxy_set_queue(wayland_egl_surface->wl_proxy, NULL);
+
        wl_event_queue_destroy(queue);
        return ret;
 }