turnip: use linear tiling for scanout image
authorJonathan Marek <jonathan@marek.ca>
Thu, 26 Sep 2019 02:47:02 +0000 (22:47 -0400)
committerJonathan Marek <jonathan@marek.ca>
Thu, 26 Sep 2019 21:18:13 +0000 (17:18 -0400)
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Acked-by: Eric Anholt <eric@anholt.net>
src/freedreno/vulkan/tu_image.c

index 8bea11b6ff7f5035202e680b219b432ae53d3220..694f45802bcf44e987e35583edbdf39c7be7f15e 100644 (file)
@@ -172,7 +172,10 @@ tu_image_create(VkDevice _device,
       vk_find_struct_const(pCreateInfo->pNext,
                            EXTERNAL_MEMORY_IMAGE_CREATE_INFO) != NULL;
 
-   image->tile_mode = pCreateInfo->tiling == VK_IMAGE_TILING_OPTIMAL ? 3 : 0;
+   image->tile_mode = TILE6_LINEAR;
+   if (pCreateInfo->tiling == VK_IMAGE_TILING_OPTIMAL && !create_info->scanout)
+      image->tile_mode = TILE6_3;
+
    setup_slices(image, pCreateInfo);
 
    image->size = image->layer_size * pCreateInfo->arrayLayers;
@@ -339,10 +342,14 @@ tu_CreateImage(VkDevice device,
                                    pAllocator, pImage);
 #endif
 
+   const struct wsi_image_create_info *wsi_info =
+      vk_find_struct_const(pCreateInfo->pNext, WSI_IMAGE_CREATE_INFO_MESA);
+   bool scanout = wsi_info && wsi_info->scanout;
+
    return tu_image_create(device,
                           &(struct tu_image_create_info) {
                              .vk_info = pCreateInfo,
-                             .scanout = false,
+                             .scanout = scanout,
                           },
                           pAllocator, pImage);
 }