From: Alex Deucher <alexander.deucher@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: Likun Gao <Likun.Gao@amd.com>, Le Ma <le.ma@amd.com>,
Alex Deucher <alexander.deucher@amd.com>
Subject: [PATCH 1/7] drm/amdgpu: Add gmc v12_1 support
Date: Wed, 19 Nov 2025 10:05:54 -0500 [thread overview]
Message-ID: <20251119150600.3663611-2-alexander.deucher@amd.com> (raw)
In-Reply-To: <20251119150600.3663611-1-alexander.deucher@amd.com>
From: Likun Gao <Likun.Gao@amd.com>
Add gmc support for gc version 12_1_0.
Signed-off-by: Likun Gao <Likun.Gao@amd.com>
Reviewed-by: Le Ma <le.ma@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c | 34 +++++++++++++++++++++-----
1 file changed, 28 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c
index 69d90a26ecf50..d22c762473424 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c
@@ -38,7 +38,9 @@
#include "soc15_common.h"
#include "nbif_v6_3_1.h"
#include "gfxhub_v12_0.h"
+#include "gfxhub_v12_1.h"
#include "mmhub_v4_1_0.h"
+#include "mmhub_v4_2_0.h"
#include "athub_v4_1_0.h"
#include "umc_v8_14.h"
@@ -594,6 +596,9 @@ static void gmc_v12_0_set_mmhub_funcs(struct amdgpu_device *adev)
case IP_VERSION(4, 1, 0):
adev->mmhub.funcs = &mmhub_v4_1_0_funcs;
break;
+ case IP_VERSION(4, 2, 0):
+ adev->mmhub.funcs = &mmhub_v4_2_0_funcs;
+ break;
default:
break;
}
@@ -606,6 +611,9 @@ static void gmc_v12_0_set_gfxhub_funcs(struct amdgpu_device *adev)
case IP_VERSION(12, 0, 1):
adev->gfxhub.funcs = &gfxhub_v12_0_funcs;
break;
+ case IP_VERSION(12, 1, 0):
+ adev->gfxhub.funcs = &gfxhub_v12_1_funcs;
+ break;
default:
break;
}
@@ -759,6 +767,7 @@ static int gmc_v12_0_sw_init(struct amdgpu_ip_block *ip_block)
switch (amdgpu_ip_version(adev, GC_HWIP, 0)) {
case IP_VERSION(12, 0, 0):
case IP_VERSION(12, 0, 1):
+ case IP_VERSION(12, 1, 0):
set_bit(AMDGPU_GFXHUB(0), adev->vmhubs_mask);
set_bit(AMDGPU_MMHUB0(0), adev->vmhubs_mask);
/*
@@ -780,9 +789,14 @@ static int gmc_v12_0_sw_init(struct amdgpu_ip_block *ip_block)
if (r)
return r;
- r = amdgpu_irq_add_id(adev, SOC21_IH_CLIENTID_GFX,
- UTCL2_1_0__SRCID__FAULT,
- &adev->gmc.vm_fault);
+ if (amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(12, 1, 0))
+ r = amdgpu_irq_add_id(adev, SOC21_IH_CLIENTID_UTCL2,
+ UTCL2_1_0__SRCID__FAULT,
+ &adev->gmc.vm_fault);
+ else
+ r = amdgpu_irq_add_id(adev, SOC21_IH_CLIENTID_GFX,
+ UTCL2_1_0__SRCID__FAULT,
+ &adev->gmc.vm_fault);
if (r)
return r;
@@ -829,7 +843,11 @@ static int gmc_v12_0_sw_init(struct amdgpu_ip_block *ip_block)
* amdgpu graphics/compute will use VMIDs 1-7
* amdkfd will use VMIDs 8-15
*/
- adev->vm_manager.first_kfd_vmid = adev->gfx.disable_kq ? 1 : 8;
+ adev->vm_manager.first_kfd_vmid =
+ amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(12, 1, 0) ?
+ 3 : 8;
+ adev->vm_manager.first_kfd_vmid =
+ adev->gfx.disable_kq ? 1 : (adev->vm_manager.first_kfd_vmid);
amdgpu_vm_manager_init(adev);
@@ -997,7 +1015,10 @@ static int gmc_v12_0_set_clockgating_state(struct amdgpu_ip_block *ip_block,
if (r)
return r;
- return athub_v4_1_0_set_clockgating(adev, state);
+ if (amdgpu_ip_version(adev, GC_HWIP, 0) != IP_VERSION(12, 1, 0))
+ return athub_v4_1_0_set_clockgating(adev, state);
+ else
+ return 0;
}
static void gmc_v12_0_get_clockgating_state(struct amdgpu_ip_block *ip_block, u64 *flags)
@@ -1006,7 +1027,8 @@ static void gmc_v12_0_get_clockgating_state(struct amdgpu_ip_block *ip_block, u6
adev->mmhub.funcs->get_clockgating(adev, flags);
- athub_v4_1_0_get_clockgating(adev, flags);
+ if (amdgpu_ip_version(adev, GC_HWIP, 0) != IP_VERSION(12, 1, 0))
+ athub_v4_1_0_get_clockgating(adev, flags);
}
static int gmc_v12_0_set_powergating_state(struct amdgpu_ip_block *ip_block,
--
2.51.1
next prev parent reply other threads:[~2025-11-19 15:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-19 15:05 [PATCH 0/7] Add gmc 12.1 support Alex Deucher
2025-11-19 15:05 ` Alex Deucher [this message]
2025-11-19 15:05 ` [PATCH 2/7] drm/amdgpu: Add gmc v12_1 gmc callbacks Alex Deucher
2025-11-19 15:05 ` [PATCH 3/7] drm/amdgpu: Add per-ASIC PTE init flag Alex Deucher
2025-11-19 15:05 ` [PATCH 4/7] drm/amdgpu: Always set snoop bit in PDE on GFX 12.1 Alex Deucher
2025-11-19 15:05 ` [PATCH 5/7] drm/amdgpu: Enable PDE.C usage " Alex Deucher
2025-11-19 15:05 ` [PATCH 6/7] drm/amdkfd: Fix PTE clearing during SVM unmap " Alex Deucher
2025-11-19 15:06 ` [PATCH 7/7] drm/amdgpu: Add gmc v12_1_0 to discovery list Alex Deucher
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251119150600.3663611-2-alexander.deucher@amd.com \
--to=alexander.deucher@amd.com \
--cc=Likun.Gao@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=le.ma@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.