anv: add more swapchain formats
authorTapani Pälli <tapani.palli@intel.com>
Wed, 25 Jul 2018 11:26:33 +0000 (14:26 +0300)
committerTapani Pälli <tapani.palli@intel.com>
Mon, 6 Aug 2018 06:25:11 +0000 (09:25 +0300)
This change helps with some of the dEQP-VK.wsi.android.* tests that
try to create swapchain with using such formats.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
src/intel/vulkan/anv_android.c

index a3bab8087b4726547f09d99b26725010ca6c6226..46c41d57861f18f482757632c24e83290b317a8e 100644 (file)
@@ -300,11 +300,17 @@ VkResult anv_GetSwapchainGrallocUsageANDROID(
     *
     * FINISHME: Advertise all display-supported formats.
     */
-   if (format == VK_FORMAT_B8G8R8A8_UNORM ||
-       format == VK_FORMAT_B5G6R5_UNORM_PACK16) {
-      *grallocUsage |= GRALLOC_USAGE_HW_FB |
-                       GRALLOC_USAGE_HW_COMPOSER |
-                       GRALLOC_USAGE_EXTERNAL_DISP;
+   switch (format) {
+      case VK_FORMAT_B8G8R8A8_UNORM:
+      case VK_FORMAT_B5G6R5_UNORM_PACK16:
+      case VK_FORMAT_R8G8B8A8_UNORM:
+      case VK_FORMAT_R8G8B8A8_SRGB:
+         *grallocUsage |= GRALLOC_USAGE_HW_FB |
+                          GRALLOC_USAGE_HW_COMPOSER |
+                          GRALLOC_USAGE_EXTERNAL_DISP;
+         break;
+      default:
+         intel_logw("%s: unsupported format=%d", __func__, format);
    }
 
    if (*grallocUsage == 0)