Skip to contentSkip to conversation

drm/amdgpu: fix incorrect MALL size for GFX1151

PATCH In review Tim Huang 3 participants 3 messages May 8, 2025 – May 9, 2025

Subsystems (2)
lore
Share & tools
lore

Tim Huang

author
#0 lore raw

PATCH 1/1 drm/amdgpu: fix incorrect MALL size for GFX1151

On GFX1151, the reported MALL cache size reflects only half of its actual size; this adjustment corrects the discrepancy.

---
 drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c +12 -0
index 917d894a1316..72211409227b 100644
@@ -748,6 +748,18 @@ static int gmc_v11_0_sw_init(struct amdgpu_ip_block *ip_block)
 	adev->gmc.vram_type = vram_type;
 	adev->gmc.vram_vendor = vram_vendor;
 
+	/* The mall_size is already calculated as mall_size_per_umc * num_umc.
+	 * However, for gfx1151, which features a 2-to-1 UMC mapping,
+	 * the result must be multiplied by 2 to determine the actual mall size.
+	 */
+	switch (amdgpu_ip_version(adev, GC_HWIP, 0)) {
+	case IP_VERSION(11, 5, 1):
+		adev->gmc.mall_size *= 2;
+		break;
+	default:
+		break;
+	}
+
 	switch (amdgpu_ip_version(adev, GC_HWIP, 0)) {
 	case IP_VERSION(11, 0, 0):
 	case IP_VERSION(11, 0, 1):
Signature · 1 line
2.43.0
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Tim Huang

On GFX1151, the reported MALL cache size reflects only half of its actual size; this adjustment corrects the discrepancy.

Quoted 30 lines
---
 drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c +12 -1
index 917d894a1316..72211409227b 100644
@@ -748,6 +748,18 @@ static int gmc_v11_0_sw_init(struct amdgpu_ip_block *ip_block)
        adev->gmc.vram_type = vram_type;
        adev->gmc.vram_vendor = vram_vendor;
 
+       /* The mall_size is already calculated as mall_size_per_umc * num_umc.
+        * However, for gfx1151, which features a 2-to-1 UMC mapping,
+        * the result must be multiplied by 2 to determine the actual mall size.
+        */
+       switch (amdgpu_ip_version(adev, GC_HWIP, 0)) {
+       case IP_VERSION(11, 5, 1):
+               adev->gmc.mall_size *= 2;
+               break;
+       default:
+               break;
+       }
+
        switch (amdgpu_ip_version(adev, GC_HWIP, 0)) {
        case IP_VERSION(11, 0, 0):
        case IP_VERSION(11, 0, 1):
--

2.43.0

Reviewed-by on v1 1/1
#2 lore raw
In reply to Tim Huang

[AMD Official Use Only - AMD Internal Distribution Only]

-----Original Message-----
From: Huang, Tim <[email protected]>
Sent: Thursday, May 8, 2025 3:30 PM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Zhang, Yifan <[email protected]>; Huang, Tim <[email protected]>
Subject: [PATCH] drm/amdgpu: fix incorrect MALL size for GFX1151

On GFX1151, the reported MALL cache size reflects only half of its actual size; this adjustment corrects the discrepancy.

---
 drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c +12 -0
index 917d894a1316..72211409227b 100644
@@ -748,6 +748,18 @@ static int gmc_v11_0_sw_init(struct amdgpu_ip_block *ip_block)
        adev->gmc.vram_type = vram_type;
        adev->gmc.vram_vendor = vram_vendor;
 
+       /* The mall_size is already calculated as mall_size_per_umc * num_umc.
+        * However, for gfx1151, which features a 2-to-1 UMC mapping,
+        * the result must be multiplied by 2 to determine the actual mall size.
+        */
+       switch (amdgpu_ip_version(adev, GC_HWIP, 0)) {
+       case IP_VERSION(11, 5, 1):
+               adev->gmc.mall_size *= 2;
+               break;
+       default:
+               break;
+       }
+
        switch (amdgpu_ip_version(adev, GC_HWIP, 0)) {
        case IP_VERSION(11, 0, 0):
        case IP_VERSION(11, 0, 1):

--
2.43.0