surface: use tpl_display_query_supported_buffer_count_from_native_window 31/67031/3
authordeasung.kim <deasung.kim@samsung.com>
Sun, 24 Apr 2016 05:55:06 +0000 (14:55 +0900)
committerdeasung.kim <deasung.kim@samsung.com>
Mon, 25 Apr 2016 03:36:24 +0000 (12:36 +0900)
this patch depends on
https://review.tizen.org/gerrit/#/c/66840

Change-Id: If852d63bd0be788a8d21356d161de4b4a57d7177

src/wsi/surface.c

index 09003e6..9039b40 100644 (file)
@@ -51,6 +51,8 @@ vk_GetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice                    pdev,
 {
        VkIcdSurfaceWayland     *sfc = (VkIcdSurfaceWayland *)(uintptr_t)surface;
        tpl_display_t           *display;
+       int min, max;
+       tpl_result_t res;
 
        VK_CHECK(sfc->base.platform == VK_ICD_WSI_PLATFORM_WAYLAND, return VK_ERROR_DEVICE_LOST,
                         "Not supported platform surface.\n");
@@ -58,15 +60,13 @@ vk_GetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice                  pdev,
        display = vk_get_tpl_display(sfc->display);
        VK_CHECK(display, return VK_ERROR_DEVICE_LOST, "vk_get_tpl_display() failed.\n");
 
-#if 0
-       res = tpl_surface_query_supported_buffer_count(sfc->tpl.surface, &min, &max);
+       res = tpl_display_query_supported_buffer_count_from_native_window(display, sfc->surface, &min, &max);
        VK_CHECK(res == TPL_ERROR_NONE, return VK_ERROR_DEVICE_LOST,
-                        "tpl_surface_query_supported_buffer_count() failed.\n");
-#endif
+                        "tpl_display_query_native_window_supported_buffer_count() failed.\n");
 
        /* TODO: Hard-coded. */
-       caps->minImageCount = 3;
-       caps->maxImageCount = 3;
+       caps->minImageCount = min;
+       caps->maxImageCount = max;
 
        caps->currentExtent.width = -1;
        caps->currentExtent.height = -1;