turnip: set linear tiling for scanout images
authorJonathan Marek <jonathan@marek.ca>
Tue, 21 Jan 2020 13:46:58 +0000 (08:46 -0500)
committerMarge Bot <eric+marge@anholt.net>
Thu, 23 Jan 2020 18:34:07 +0000 (18:34 +0000)
Fixes: 210e6887 "vulkan/wsi: Use the interface from the real modifiers extension"
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Acked-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3485>

src/freedreno/vulkan/tu_image.c

index 7dbbcb99682481622bef4d2b3876116a5a41bd7e..c76c44870e9e134ab67ddd5f3615af7682f6074c 100644 (file)
@@ -395,6 +395,11 @@ tu_CreateImage(VkDevice device,
          if (mod_info->pDrmFormatModifiers[i] == DRM_FORMAT_MOD_QCOM_COMPRESSED)
             modifier = DRM_FORMAT_MOD_QCOM_COMPRESSED;
       }
+   } else {
+      const struct wsi_image_create_info *wsi_info =
+         vk_find_struct_const(pCreateInfo->pNext, WSI_IMAGE_CREATE_INFO_MESA);
+      if (wsi_info && wsi_info->scanout)
+         modifier = DRM_FORMAT_MOD_LINEAR;
    }
 
    return tu_image_create(device, pCreateInfo, pAllocator, pImage, modifier);