]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amdgpu: Set chicken bit for gfx_v12.1 xnack
authorHarish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
Tue, 2 Sep 2025 14:37:13 +0000 (10:37 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 24 Apr 2026 14:57:25 +0000 (10:57 -0400)
For xnack on, set TCP_PERFCOUNTER_FILTER.COMPRESSION_ENABLE to 1
For xnack off, set TCP_PERFCOUNTER_FILTER.COMPRESSION_ENABLE to 0

Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
Reviewed-by: Philip.Yang <Philip.Yang@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c

index 5412a528f78be45e61f4f0fa51393cfd2d449424..5b5bfc379e9ddfc7a64b9efda39128aeb64d1510 100644 (file)
@@ -1475,6 +1475,19 @@ static void gfx_v12_1_get_tcc_info(struct amdgpu_device *adev)
 {
 }
 
+static void gfx_v12_1_xcc_xnack_set_chicken_bits(struct amdgpu_device *adev, int xcc_id)
+{
+       /* NOTE: COMPRESSION_ENABLE is used a chicken bit to enable/disable xcc xnack */
+       mutex_lock(&adev->srbm_mutex);
+       if (!adev->gmc.noretry) {
+               WREG32_FIELD15_PREREG(GC, GET_INST(GC, xcc_id),
+                                     TCP_PERFCOUNTER_FILTER, COMPRESSION_ENABLE, 0x1);
+       } else
+               WREG32_FIELD15_PREREG(GC, GET_INST(GC, xcc_id),
+                                     TCP_PERFCOUNTER_FILTER, COMPRESSION_ENABLE, 0x0);
+       mutex_unlock(&adev->srbm_mutex);
+}
+
 static void gfx_v12_1_xcc_constants_init(struct amdgpu_device *adev,
                                         int xcc_id)
 {
@@ -1502,6 +1515,8 @@ static void gfx_v12_1_xcc_constants_init(struct amdgpu_device *adev,
        mutex_unlock(&adev->srbm_mutex);
 
        gfx_v12_1_xcc_init_compute_vmid(adev, xcc_id);
+       gfx_v12_1_xcc_xnack_set_chicken_bits(adev, xcc_id);
+
 }
 
 static void gfx_v12_1_constants_init(struct amdgpu_device *adev)