tpl_wayland_egl_thread: Added the missing code to allocate list. 71/162071/1
authorjoonbum.ko <joonbum.ko@samsung.com>
Wed, 29 Nov 2017 03:00:29 +0000 (12:00 +0900)
committerjoonbum.ko <joonbum.ko@samsung.com>
Wed, 29 Nov 2017 03:00:32 +0000 (12:00 +0900)
 - vblank_waiting_buffers list is needed to support FIFO & FIFO_RELAXED modes.

Change-Id: I93a90ad4711bcb8f13640cc0942dc4175cdff8cc
Signed-off-by: joonbum.ko <joonbum.ko@samsung.com>
src/tpl_wayland_egl_thread.c

index d3116fd..7944b82 100644 (file)
@@ -2158,6 +2158,12 @@ _twe_thread_wl_surf_source_destroy(void *source)
                surf_source->committed_buffers = NULL;
        }
 
+       if (surf_source->vblank_waiting_buffers) {
+               __tpl_list_free(surf_source->vblank_waiting_buffers,
+                                               (tpl_free_func_t)__cb_buffer_remove_from_list);
+               surf_source->vblank_waiting_buffers = NULL;
+       }
+
        if (!disp_source->is_vulkan_dpy) {
                _twe_surface_buffer_flusher_fini(surf_source);
        }
@@ -2425,6 +2431,11 @@ twe_surface_create_swapchain(twe_surface_h twe_surface,
                return TPL_ERROR_INVALID_OPERATION;
        }
 
+       if (present_mode == TPL_DISPLAY_PRESENT_MODE_FIFO
+               || present_mode == TPL_DISPLAY_PRESENT_MODE_FIFO_RELAXED) {
+               surf_source->vblank_waiting_buffers = __tpl_list_alloc();
+       }
+
        surf_source->format = format;
        surf_source->swapchain_properties.width = width;
        surf_source->swapchain_properties.height = height;