From: Changyeon Lee Date: Fri, 4 Nov 2016 06:26:41 +0000 (+0900) Subject: evas_tbmbuf: set proxy of wl_tbm to event queue when waiting buffer X-Git-Tag: accepted/tizen/common/20170102.152350~198 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F27%2F96227%2F3;p=platform%2Fupstream%2Fefl.git evas_tbmbuf: set proxy of wl_tbm to event queue when waiting buffer wayland-tbm-server send frame buffer to client when entering hwc by sending event to proxy of wl_tbm and wl_tbm_queue. so client need to handle event of wl_tbm and wl_tbm_queue when waiting buffers. Change-Id: I674a273575aa3c9b2e4da01378fc5223bb160a67 --- diff --git a/src/modules/evas/engines/wayland_shm/evas_tbmbuf.c b/src/modules/evas/engines/wayland_shm/evas_tbmbuf.c index 1737658..5e15a0a 100755 --- a/src/modules/evas/engines/wayland_shm/evas_tbmbuf.c +++ b/src/modules/evas/engines/wayland_shm/evas_tbmbuf.c @@ -136,6 +136,7 @@ static void *(*sym_wayland_tbm_client_create_surface_queue) (struct wayland_tbm_ int width, int height, tbm_format format) = NULL; static struct wl_tbm_queue * (*sym_wayland_tbm_client_get_wl_tbm_queue) (struct wayland_tbm_client *tbm_client, struct wl_surface *surface) = NULL; +static struct wl_tbm * (*sym_wayland_tbm_client_get_wl_tbm) (struct wayland_tbm_client *tbm_client) = NULL; static Eina_Bool tbm_init(void) @@ -209,6 +210,7 @@ tbm_init(void) fail = 0; SYM(tbm_client_lib, wayland_tbm_client_init); SYM(tbm_client_lib, wayland_tbm_client_deinit); + SYM(tbm_client_lib, wayland_tbm_client_get_wl_tbm); SYM(tbm_client_lib, wayland_tbm_client_get_wl_tbm_queue); SYM(tbm_client_lib, wayland_tbm_client_create_buffer); SYM(tbm_client_lib, wayland_tbm_client_destroy_buffer); @@ -286,6 +288,7 @@ _wait_free_buffer(Tbmbuf_Surface *surface) if (!surface) return; struct wl_tbm_queue *wl_queue; + struct wl_tbm *wl_tbm; int i, num_surface; tbm_surface_h surfaces[5]; struct wl_event_queue *queue = NULL; @@ -296,6 +299,12 @@ _wait_free_buffer(Tbmbuf_Surface *surface) return; DBG("WAIT free buffer"); + wl_tbm = sym_wayland_tbm_client_get_wl_tbm(surface->tbm_client); + if (!wl_tbm) { + ERR(" sym_wayland_tbm_client_get_wl_tbm() wl_tbm == NULL"); + return; + } + wl_queue = sym_wayland_tbm_client_get_wl_tbm_queue(surface->tbm_client, surface->wl_surface); if (!wl_queue) { ERR(" wayland_tbm_client_get_wl_tbm_queue() wl_queue == NULL"); @@ -317,6 +326,8 @@ _wait_free_buffer(Tbmbuf_Surface *surface) } wl_proxy_set_queue((struct wl_proxy*)wl_queue, queue); + wl_proxy_set_queue((struct wl_proxy*)wl_tbm, queue); + while (!sym_tbm_surface_queue_can_dequeue(surface->tbm_queue, 0)) { wl_display_dispatch_queue(surface->wl_display, queue); } @@ -330,6 +341,8 @@ _wait_free_buffer(Tbmbuf_Surface *surface) wl_proxy_set_queue((struct wl_proxy*)wl_queue, NULL); + wl_proxy_set_queue((struct wl_proxy*)wl_tbm, NULL); + wl_event_queue_destroy(queue); } @@ -405,6 +418,8 @@ _evas_tbmbuf_surface_assign(Surface *s) if(!sym_tbm_surface_internal_get_user_data(surface->tbm_surface, KEY_WL_BUFFER, (void **)&buffer)) { buffer = sym_wayland_tbm_client_create_buffer(surface->tbm_client, surface->tbm_surface); + wl_proxy_set_queue((struct wl_proxy *)buffer, NULL); + sym_tbm_surface_internal_add_user_data(surface->tbm_surface, KEY_WL_BUFFER, (tbm_data_free)buffer_destroy); sym_tbm_surface_internal_set_user_data(surface->tbm_surface, KEY_WL_BUFFER, buffer);