tpl_wayland_egl_thread: Set to GUARANTEE_CYCLE mode to swapchain tbm_queue. 88/165688/3
authorjoonbum.ko <joonbum.ko@samsung.com>
Tue, 2 Jan 2018 05:50:50 +0000 (14:50 +0900)
committerjoonbum.ko <joonbum.ko@samsung.com>
Wed, 3 Jan 2018 09:25:28 +0000 (18:25 +0900)
Change-Id: Ie9435f58924932314bbe7a37b71a88cd6937f077
Signed-off-by: joonbum.ko <joonbum.ko@samsung.com>
src/tpl_wayland_egl_thread.c

index ba1ece6..96dbb8c 100644 (file)
@@ -2561,6 +2561,11 @@ twe_surface_create_swapchain(twe_surface_h twe_surface,
                                                                width, height,
                                                                TBM_FORMAT_ARGB8888);
 
+       if (!surf_source->tbm_queue) {
+               TPL_ERR("TBM surface queue creation failed!");
+               return TPL_ERROR_OUT_OF_MEMORY;
+       }
+
        if (tbm_surface_queue_add_reset_cb(surf_source->tbm_queue,
                                                                           __cb_tbm_queue_reset_callback,
                                                                           surf_source) != TBM_SURFACE_QUEUE_ERROR_NONE) {
@@ -2570,9 +2575,13 @@ twe_surface_create_swapchain(twe_surface_h twe_surface,
                return TPL_ERROR_INVALID_OPERATION;
        }
 
-       if (!surf_source->tbm_queue) {
-               TPL_ERR("TBM surface queue creation failed!");
-               return TPL_ERROR_OUT_OF_MEMORY;
+       if (tbm_surface_queue_set_modes(surf_source->tbm_queue,
+                       TBM_SURFACE_QUEUE_MODE_GUARANTEE_CYCLE) !=
+                               TBM_SURFACE_QUEUE_ERROR_NONE) {
+               TPL_ERR("Failed to set queue mode to tbm_surface_queue(%p)",
+                               surf_source->tbm_queue);
+               tbm_surface_queue_destroy(surf_source->tbm_queue);
+               return TPL_ERROR_INVALID_OPERATION;
        }
 
        if (tbm_surface_queue_add_trace_cb(surf_source->tbm_queue,