swapchain_tpl: Fixed to use tpl_surface_get() before create. 94/165694/1
authorjoonbum.ko <joonbum.ko@samsung.com>
Tue, 2 Jan 2018 04:22:11 +0000 (13:22 +0900)
committerjoonbum.ko <joonbum.ko@samsung.com>
Tue, 2 Jan 2018 04:22:14 +0000 (13:22 +0900)
 - We need to call tpl_surface_get() before tpl_surface_create() to pass
  dEQP-VK.wsi.wayland.swapchain.modify.resize test.
 - tpl_surface_get() newly added below.
  libtpl-egl : tpl: Added a new API tpl_surface_get()
              46a8d4c7879b9349458f8e0098ae27bb5b586c3e

Change-Id: I3d1cd23d15d3ed0306b805d1aed357ca0e94797e
Signed-off-by: joonbum.ko <joonbum.ko@samsung.com>
src/wsi/swapchain_tpl.c

index 890405f..ca43154 100644 (file)
@@ -156,9 +156,15 @@ swapchain_tpl_init(VkDevice                                                         device,
        VK_CHECK(swapchain_tpl->tpl_display, goto error, "vk_get_tpl_display() failed.\n");
        native_window = vk_get_tpl_native_window(surface);
 
-       swapchain_tpl->tpl_surface = tpl_surface_create(swapchain_tpl->tpl_display,
-                                                                                                                  native_window,
-                                                                                                                  TPL_SURFACE_TYPE_WINDOW, format);
+       swapchain_tpl->tpl_surface = tpl_surface_get(swapchain_tpl->tpl_display,
+                                                                                                native_window);
+       if (swapchain_tpl->tpl_surface)
+               tpl_object_reference(swapchain_tpl->tpl_surface);
+       else
+               swapchain_tpl->tpl_surface = tpl_surface_create(swapchain_tpl->tpl_display,
+                                                                                                               native_window,
+                                                                                                               TPL_SURFACE_TYPE_WINDOW, format);
+
        VK_CHECK(swapchain_tpl->tpl_surface, goto error, "tpl_surface_create() failed.\n");
 
        switch(info->presentMode) {