Skip to contentSkip to conversation

drm/amdgpu: Update total channel number for umc v8_10

PATCH New Candice Li 1 participant 1 message Jun 13, 2023

Subsystems (2)
lore
Share & tools
lore

Candice Li

author
#0 lore raw

PATCH 1/2 drm/amdgpu: Update total channel number for umc v8_10

Update total channel number for umc v8_10.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h       | 2 ++
 drivers/gpu/drm/amd/amdgpu/umc_v8_10.h        | 3 ++-
 3 files changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +1 -0
index 859882109f55d6..16cf7b199457e3 100644
@@ -1515,6 +1515,7 @@ static int amdgpu_discovery_get_mall_info(struct amdgpu_device *adev)
 				mall_size += mall_size_per_umc;
 		}
 		adev->gmc.mall_size = mall_size;
+		adev->gmc.m_half_use = half_use;
 		break;
 	default:
 		dev_err(adev->dev,
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h +2 -0
index 6794edd1d2d2ae..56d73fade56850 100644
@@ -301,6 +301,8 @@ struct amdgpu_gmc {
 
 	/* MALL size */
 	u64 mall_size;
+	uint32_t m_half_use;
+
 	/* number of UMC instances */
 	int num_umc;
 	/* mode2 save restore */
drivers/gpu/drm/amd/amdgpu/umc_v8_10.h +2 -1
index c6dfd433fec7bc..dc12e0af5451e9 100644
@@ -33,7 +33,8 @@
 
 /* Total channel instances for all available umc nodes */
 #define UMC_V8_10_TOTAL_CHANNEL_NUM(adev) \
-	(UMC_V8_10_CHANNEL_INSTANCE_NUM * UMC_V8_10_UMC_INSTANCE_NUM * (adev)->gmc.num_umc)
+	(UMC_V8_10_CHANNEL_INSTANCE_NUM * UMC_V8_10_UMC_INSTANCE_NUM * \
+	(adev)->gmc.num_umc - hweight32((adev)->gmc.m_half_use) * 2)
 
 /* UMC regiser per channel offset */
 #define UMC_V8_10_PER_CHANNEL_OFFSET	0x400
Signature · 1 line
2.25.1