tu: Add noubwc debug flag to disable UBWC
authorConnor Abbott <cwabbott0@gmail.com>
Tue, 12 May 2020 15:45:26 +0000 (17:45 +0200)
committerMarge Bot <eric+marge@anholt.net>
Wed, 13 May 2020 13:39:04 +0000 (13:39 +0000)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5007>

src/freedreno/vulkan/tu_device.c
src/freedreno/vulkan/tu_image.c
src/freedreno/vulkan/tu_private.h

index dfe4df85e32ab08678f48bfef4e02f36caf59249..3e685e0518eee5e37bf7055bc3ca54d90a00fa42 100644 (file)
@@ -383,6 +383,7 @@ static const struct debug_control tu_debug_options[] = {
    { "nobin", TU_DEBUG_NOBIN },
    { "sysmem", TU_DEBUG_SYSMEM },
    { "forcebin", TU_DEBUG_FORCEBIN },
+   { "noubwc", TU_DEBUG_NOUBWC },
    { NULL, 0 }
 };
 
index 8c0e8c5341fc6a6076c4576279d2e853b30fa863..52585a85c8dd6ba276bed75c706c8cf3613b20f6 100644 (file)
@@ -86,7 +86,8 @@ tu_image_create(VkDevice _device,
                            EXTERNAL_MEMORY_IMAGE_CREATE_INFO) != NULL;
 
    image->layout.tile_mode = TILE6_3;
-   bool ubwc_enabled = true;
+   bool ubwc_enabled =
+      !(device->physical_device->instance->debug_flags & TU_DEBUG_NOUBWC);
 
    /* disable tiling when linear is requested and for compressed formats */
    if (pCreateInfo->tiling == VK_IMAGE_TILING_LINEAR ||
index 1c32e60000ac1b34191149edf1f89cee2764da21..1cba064d0c837a54747f90a4f32831cb43e4d519 100644 (file)
@@ -353,6 +353,7 @@ enum tu_debug_flags
    TU_DEBUG_NOBIN = 1 << 3,
    TU_DEBUG_SYSMEM = 1 << 4,
    TU_DEBUG_FORCEBIN = 1 << 5,
+   TU_DEBUG_NOUBWC = 1 << 6,
 };
 
 struct tu_instance