Skip to contentSkip to conversation

drm/amdgpu/gfx: only call mes for enforce isolation if supported

PATCH In review Alex Deucher 2 participants 2 messages Feb 13, 2025

Subsystems (2)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/1 drm/amdgpu/gfx: only call mes for enforce isolation if supported

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")
Cc Shaoyun Liu <[email protected]>
Cc Srinivasan Shanmugam <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +4 -2
index 27f5318c3a26c..b9bd6654f3172 100644
@@ -1670,11 +1670,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];
 	}
Signature · 1 line
2.48.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 21 lines · Alex Deucher

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")
Cc Shaoyun Liu<[email protected]>
Cc Srinivasan Shanmugam<[email protected]>
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 6 ++++--
  1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +1 -1
index 27f5318c3a26c..b9bd6654f3172 100644
@@ -1670,11 +1670,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)

drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c static ssize_t amdgpu_gfx_set_enforce_isolation(struct device *dev, · line 1682

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +3 -1
+				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];
  	}