summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLe Ma <le.ma@amd.com>2025-06-11 20:35:50 +0800
committerAlex Deucher <alexander.deucher@amd.com>2025-12-16 13:23:04 -0500
commita848986a384562bd64cf4e37bc128a8d78685add (patch)
tree3c316ff7a4eaa8a9b5bc59648e276993cb1316c0
parentbb562c955e174f028ed06e92fdb23411ad456f0a (diff)
drm/amdgpu: Use AMDGPU_IS_GFXHUB to screen out GFXHUB for GMC v12.1
There're multiple gfxhubs on GMC v12.1 Signed-off-by: Le Ma <le.ma@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gmc_v12_1.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v12_1.c b/drivers/gpu/drm/amd/amdgpu/gmc_v12_1.c
index c54d2d10a8ca..e4b12b15bc94 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v12_1.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v12_1.c
@@ -255,7 +255,7 @@ static void gmc_v12_1_flush_vm_hub(struct amdgpu_device *adev, uint32_t vmid,
unsigned int i;
unsigned char hub_ip = 0;
- hub_ip = (vmhub == AMDGPU_GFXHUB(0)) ?
+ hub_ip = (AMDGPU_IS_GFXHUB(vmhub)) ?
GC_HWIP : MMHUB_HWIP;
spin_lock(&adev->gmc.invalidate_lock);
@@ -274,7 +274,7 @@ static void gmc_v12_1_flush_vm_hub(struct amdgpu_device *adev, uint32_t vmid,
}
/* Issue additional private vm invalidation to MMHUB */
- if ((vmhub != AMDGPU_GFXHUB(0)) &&
+ if (!AMDGPU_IS_GFXHUB(vmhub) &&
(hub->vm_l2_bank_select_reserved_cid2) &&
!amdgpu_sriov_vf(adev)) {
inv_req = RREG32_NO_KIQ(hub->vm_l2_bank_select_reserved_cid2);
@@ -307,7 +307,7 @@ static void gmc_v12_1_flush_vm_hub(struct amdgpu_device *adev, uint32_t vmid,
static void gmc_v12_1_flush_gpu_tlb(struct amdgpu_device *adev, uint32_t vmid,
uint32_t vmhub, uint32_t flush_type)
{
- if ((vmhub == AMDGPU_GFXHUB(0)) && !adev->gfx.is_poweron)
+ if (AMDGPU_IS_GFXHUB(vmhub) && !adev->gfx.is_poweron)
return;
/* This is necessary for SRIOV as well as for GFXOFF to function