]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amdgpu/gfx: only call mes for enforce isolation if supported
authorAlex Deucher <alexander.deucher@amd.com>
Thu, 13 Feb 2025 18:37:01 +0000 (13:37 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 25 Feb 2025 17:22:56 +0000 (12:22 -0500)
This should not be called on chips without MES so check if
MES is enabled and if the cleaner shader is supported.

Fixes: 8521e3c5f058 ("drm/amd/amdgpu: limit single process inside MES")
Reviewed-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Shaoyun Liu <shaoyun.liu@amd.com>
Cc: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
(cherry picked from commit 80513e389765c8f9543b26d8fa4bbdf0e59ff8bc)

drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c

index 784b03abb3a4398b4c54436004bee9c3eede5a12..c6aff3ddb42d770ef0908184d64c3a02d875f10c 100644 (file)
@@ -1643,11 +1643,13 @@ static ssize_t amdgpu_gfx_set_enforce_isolation(struct device *dev,
                if (adev->enforce_isolation[i] && !partition_values[i]) {
                        /* Going from enabled to disabled */
                        amdgpu_vmid_free_reserved(adev, AMDGPU_GFXHUB(i));
-                       amdgpu_mes_set_enforce_isolation(adev, i, false);
+                       if (adev->enable_mes && adev->gfx.enable_cleaner_shader)
+                               amdgpu_mes_set_enforce_isolation(adev, i, false);
                } else if (!adev->enforce_isolation[i] && partition_values[i]) {
                        /* Going from disabled to enabled */
                        amdgpu_vmid_alloc_reserved(adev, AMDGPU_GFXHUB(i));
-                       amdgpu_mes_set_enforce_isolation(adev, i, true);
+                       if (adev->enable_mes && adev->gfx.enable_cleaner_shader)
+                               amdgpu_mes_set_enforce_isolation(adev, i, true);
                }
                adev->enforce_isolation[i] = partition_values[i];
        }