Module: Mesa
Branch: master
Commit: ff99faf0cf3bf5eb12761f475876090b751d410f
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ff99faf0cf3bf5eb12761f475876090b751d410f

Author: Bas Nieuwenhuizen <[email protected]>
Date:   Sun Feb 28 02:59:25 2021 +0100

radv: Add nodisplaydcc option.

Reviewed-by: Samuel Pitoiset <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9318>

---

 docs/envvars.rst              | 2 ++
 src/amd/vulkan/radv_debug.h   | 1 +
 src/amd/vulkan/radv_device.c  | 1 +
 src/amd/vulkan/radv_formats.c | 2 +-
 src/amd/vulkan/radv_image.c   | 2 ++
 5 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/docs/envvars.rst b/docs/envvars.rst
index 09621c2d3a9..28ef1993089 100644
--- a/docs/envvars.rst
+++ b/docs/envvars.rst
@@ -579,6 +579,8 @@ RADV driver environment variables
       disable compute queue
    ``nodcc``
       disable Delta Color Compression (DCC) on images
+   ``nodisplaydcc``
+      disable Delta Color Compression (DCC) on displayable images
    ``nodynamicbounds``
       do not check OOB access for dynamic descriptors
    ``nofastclears``
diff --git a/src/amd/vulkan/radv_debug.h b/src/amd/vulkan/radv_debug.h
index 735064ad1ff..e888cadc7bf 100644
--- a/src/amd/vulkan/radv_debug.h
+++ b/src/amd/vulkan/radv_debug.h
@@ -60,6 +60,7 @@ enum {
        RADV_DEBUG_IMG               = 1ull << 29,
        RADV_DEBUG_NO_UMR            = 1ull << 30,
        RADV_DEBUG_INVARIANT_GEOM    = 1ull << 31,
+       RADV_DEBUG_NO_DISPLAY_DCC    = 1ull << 32,
 };
 
 enum {
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index ce492a0d309..a22352b4a0c 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -796,6 +796,7 @@ static const struct debug_control radv_debug_options[] = {
        {"img", RADV_DEBUG_IMG},
        {"noumr", RADV_DEBUG_NO_UMR},
        {"invariantgeom", RADV_DEBUG_INVARIANT_GEOM},
+       {"nodisplaydcc", RADV_DEBUG_NO_DISPLAY_DCC},
        {NULL, 0}
 };
 
diff --git a/src/amd/vulkan/radv_formats.c b/src/amd/vulkan/radv_formats.c
index adcbc3c7eed..4161c6bad96 100644
--- a/src/amd/vulkan/radv_formats.c
+++ b/src/amd/vulkan/radv_formats.c
@@ -1152,7 +1152,7 @@ radv_get_modifier_flags(struct radv_physical_device *dev,
        if (ac_modifier_has_dcc(modifier)) {
                features &= ~VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT;
 
-               if (dev->instance->debug_flags & RADV_DEBUG_NO_DCC)
+               if (dev->instance->debug_flags & (RADV_DEBUG_NO_DCC | 
RADV_DEBUG_NO_DISPLAY_DCC))
                        return 0;
        }
 
diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
index 0aeefbef635..6b6cad5cefa 100644
--- a/src/amd/vulkan/radv_image.c
+++ b/src/amd/vulkan/radv_image.c
@@ -424,6 +424,8 @@ radv_patch_image_from_extra_info(struct radv_device *device,
 
                if (radv_surface_has_scanout(device, create_info)) {
                        image->planes[plane].surface.flags |= 
RADEON_SURF_SCANOUT;
+                       if (device->instance->debug_flags & 
RADV_DEBUG_NO_DISPLAY_DCC)
+                               image->planes[plane].surface.flags |= 
RADEON_SURF_DISABLE_DCC;
 
                        image->info.surf_index = NULL;
                }

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to