Skip to contentSkip to conversation

drm/amdgpu/mes: optimize compute loop handling

PATCH In review Alex Deucher 3 participants 4 messages Mar 19, 2025

Subsystems (2)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/2 drm/amdgpu/mes: optimize compute loop handling

Break when we get to the end of the supported pipes rather than continuing the loop.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c +1 -1
index 6f5e272d7ded3..920cd1c1eacb6 100644
@@ -111,7 +111,7 @@ int amdgpu_mes_init(struct amdgpu_device *adev)
 	for (i = 0; i < AMDGPU_MES_MAX_COMPUTE_PIPES; i++) {
 		/* use only 1st MEC pipes */
 		if (i >= adev->gfx.mec.num_pipe_per_mec)
-			continue;
+			break;
 		adev->mes.compute_hqd_mask[i] = 0xc;
 	}
 
Signature · 1 line
2.48.1
author maintainer
#1 lore raw

PATCH 2/2 drm/amdgpu/mes: enable compute pipes across all MEC

Enable pipes on both MECs for MES.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c +1 -2
index 920cd1c1eacb6..b8066c0b9014f 100644
@@ -109,8 +109,7 @@ int amdgpu_mes_init(struct amdgpu_device *adev)
 	adev->mes.vmid_mask_gfxhub = 0xffffff00;
 
 	for (i = 0; i < AMDGPU_MES_MAX_COMPUTE_PIPES; i++) {
-		/* use only 1st MEC pipes */
-		if (i >= adev->gfx.mec.num_pipe_per_mec)
+		if (i >= (adev->gfx.mec.num_pipe_per_mec * adev->gfx.mec.num_mec))
 			break;
 		adev->mes.compute_hqd_mask[i] = 0xc;
 	}
Signature · 1 line
2.48.1
#2 lore raw

Re: [PATCH 2/2] drm/amdgpu/mes: enable compute pipes across all MEC

Quoted 3 lines · Alex Deucher

Enable pipes on both MECs for MES.

Fixes 745f46b6a99f ("drm/amdgpu: enable mes v12 self test")
Quoted 22 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c +1 -3
index 920cd1c1eacb6..b8066c0b9014f 100644
@@ -109,8 +109,7 @@ int amdgpu_mes_init(struct amdgpu_device *adev)
        adev->mes.vmid_mask_gfxhub = 0xffffff00;
 
        for (i = 0; i < AMDGPU_MES_MAX_COMPUTE_PIPES; i++) {
-               /* use only 1st MEC pipes */
-               if (i >= adev->gfx.mec.num_pipe_per_mec)
+               if (i >= (adev->gfx.mec.num_pipe_per_mec * adev->gfx.mec.num_mec))
                        break;
                adev->mes.compute_hqd_mask[i] = 0xc;
        }
--

2.48.1

Reviewed-by on v1 1/2
#3 lore raw
In reply to Alex Deucher

[AMD Official Use Only - AMD Internal Distribution Only]

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Wednesday, March 19, 2025 12:24 PM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>
Subject: [PATCH 1/2] drm/amdgpu/mes: optimize compute loop handling

Break when we get to the end of the supported pipes rather than continuing the loop.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c +1 -1
index 6f5e272d7ded3..920cd1c1eacb6 100644
@@ -111,7 +111,7 @@ int amdgpu_mes_init(struct amdgpu_device *adev)
        for (i = 0; i < AMDGPU_MES_MAX_COMPUTE_PIPES; i++) {
                /* use only 1st MEC pipes */
                if (i >= adev->gfx.mec.num_pipe_per_mec)
-                       continue;
+                       break;
                adev->mes.compute_hqd_mask[i] = 0xc;
        }
 

--
2.48.1