drm/amdgpu: Use IP versions in convert_tiling_flags_to_modifier()
authorAlex Deucher <alexander.deucher@amd.com>
Mon, 28 Feb 2022 19:31:59 +0000 (14:31 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 2 Mar 2022 23:40:07 +0000 (18:40 -0500)
Rather than checking the asic_type.

Reviewed-by: Guchun Chen <guchun.chen@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c

index cae57d3b317a173c7708335aff5746a9527de6b0..fae5c1debfad3abf7a3a1a38954d34adf589b06b 100644 (file)
@@ -691,9 +691,9 @@ static int convert_tiling_flags_to_modifier(struct amdgpu_framebuffer *afb)
                        return -EINVAL;
                }
 
-               if (adev->asic_type >= CHIP_SIENNA_CICHLID)
+               if (adev->ip_versions[GC_HWIP][0] >= IP_VERSION(10, 3, 0))
                        version = AMD_FMT_MOD_TILE_VER_GFX10_RBPLUS;
-               else if (adev->family == AMDGPU_FAMILY_NV)
+               else if (adev->ip_versions[GC_HWIP][0] >= IP_VERSION(10, 0, 0))
                        version = AMD_FMT_MOD_TILE_VER_GFX10;
                else
                        version = AMD_FMT_MOD_TILE_VER_GFX9;
@@ -787,7 +787,7 @@ static int convert_tiling_flags_to_modifier(struct amdgpu_framebuffer *afb)
                                if (adev->family >= AMDGPU_FAMILY_NV) {
                                        int extra_pipe = 0;
 
-                                       if (adev->asic_type >= CHIP_SIENNA_CICHLID &&
+                                       if ((adev->ip_versions[GC_HWIP][0] >= IP_VERSION(10, 3, 0)) &&
                                            pipes == packers && pipes > 1)
                                                extra_pipe = 1;