turnip: disable tiling for NV12/IYUV formats
authorJonathan Marek <jonathan@marek.ca>
Thu, 9 Jul 2020 01:00:07 +0000 (21:00 -0400)
committerMarge Bot <eric+marge@anholt.net>
Tue, 21 Jul 2020 20:08:07 +0000 (20:08 +0000)
The last change to my previous MR to disable UBWC for the formats ended up
breaking a few tests for A640 at least, because tiled-but-not-UBWC can be
broken in some cases.

Fixes: 1a83279da57f2e ("turnip: enable 420_UNORM formats")

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5817>

src/freedreno/vulkan/tu_image.c

index 6bcfc91..9087806 100644 (file)
@@ -154,10 +154,16 @@ tu_image_create(VkDevice _device,
     * For IYUV, the blob doesn't use UBWC, but it seems to work, but
     * disable it since we don't know if a special UBWC format is needed
     * like NV12
+    *
+    * Disable tiling completely, because we set the TILE_ALL bit to
+    * match the blob, however fdl expects the TILE_ALL bit to not be
+    * set for non-UBWC tiled formats
     */
    if (image->vk_format == VK_FORMAT_G8_B8R8_2PLANE_420_UNORM ||
-       image->vk_format == VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM)
+       image->vk_format == VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM) {
+      tile_mode = TILE6_LINEAR;
       ubwc_enabled = false;
+   }
 
    /* don't use UBWC with compressed formats */
    if (vk_format_is_compressed(image->vk_format))