Module: Mesa
Branch: main
Commit: 24022d5680c33dee0132870c3176f50ea1ac2c30
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=24022d5680c33dee0132870c3176f50ea1ac2c30

Author: Timur Kristóf <timur.kris...@gmail.com>
Date:   Thu Nov  9 13:12:14 2023 +0100

radv: Use GPU info for determining SDMA metadata support.

Signed-off-by: Timur Kristóf <timur.kris...@gmail.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuy...@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoi...@gmail.com>
Reviewed-by: Marek Olšák <marek.ol...@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26110>

---

 src/amd/vulkan/radv_sdma.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/amd/vulkan/radv_sdma.c b/src/amd/vulkan/radv_sdma.c
index b56c5ddc503..dfe73e9ea37 100644
--- a/src/amd/vulkan/radv_sdma.c
+++ b/src/amd/vulkan/radv_sdma.c
@@ -251,10 +251,8 @@ static uint32_t
 radv_sdma_get_metadata_config(const struct radv_device *const device, const 
struct radv_image *const image,
                               const VkImageSubresourceLayers subresource)
 {
-   /* Only SDMA 5 supports metadata. */
-   const bool is_v5 = device->physical_device->rad_info.gfx_level >= GFX10;
-
-   if (!is_v5 || !(radv_dcc_enabled(image, subresource.mipLevel) || 
radv_image_has_htile(image))) {
+   if (!device->physical_device->rad_info.sdma_supports_compression ||
+       !(radv_dcc_enabled(image, subresource.mipLevel) || 
radv_image_has_htile(image))) {
       return 0;
    }
 
@@ -449,8 +447,7 @@ radv_sdma_emit_copy_tiled_sub_window(const struct 
radv_device *device, struct ra
                                      const VkOffset3D tiled_pix_offset, const 
VkOffset3D linear_pix_offset,
                                      const VkExtent3D pix_extent, const bool 
detile)
 {
-   if (device->physical_device->rad_info.gfx_level == GFX9) {
-      /* SDMA v4 doesn't support any image metadata. */
+   if (!device->physical_device->rad_info.sdma_supports_compression) {
       assert(!tiled->meta_va);
    }
 

Reply via email to