summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorMukul Joshi <mukul.joshi@amd.com>2026-09-28 16:40:04 -0400
committerAlex Deucher <alexander.deucher@amd.com>2026-10-07 11:54:20 -0400
commit9a0cdbdb0877f94abdec59a53c2fdea5fb47e7c0 (patch)
treeb5d2a0d4e3b2a93874815cc529cfd34ffef58bd5 /drivers/gpu
parent41505ac433cc4c5179deee8860d197b04f6d1c1d (diff)
downloadlinux-9a0cdbdb0877f94abdec59a53c2fdea5fb47e7c0.tar.gz
linux-9a0cdbdb0877f94abdec59a53c2fdea5fb47e7c0.zip
drm/amdgpu: Add SOC_V1_0_DIE_REV_AID() helper
Add a helper to extract the AID revision from adev->rev_id, matching the existing SOC_V1_0_DIE_REV_XCD(), and use it instead of open-coded rev_id bit checks for AID A1 in gmc_v12_1 and kfd_svm. Signed-off-by: Mukul Joshi <mukul.joshi@amd.com> Reviewed-by: David Yat Sin <david.yatsin@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gmc_v12_1.c3
-rw-r--r--drivers/gpu/drm/amd/amdgpu/soc_v1_0.h2
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_svm.c3
3 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v12_1.c b/drivers/gpu/drm/amd/amdgpu/gmc_v12_1.c
index 839d76183755..e056eb80b3a3 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v12_1.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v12_1.c
@@ -23,6 +23,7 @@
#include "amdgpu.h"
#include "gmc_v12_1.h"
#include "soc15_common.h"
+#include "soc_v1_0.h"
#include "soc_v1_0_enum.h"
#include "oss/osssys_7_1_0_offset.h"
#include "oss/osssys_7_1_0_sh_mask.h"
@@ -627,7 +628,7 @@ static void gmc_v12_1_get_mtypes(struct amdgpu_device *adev,
unsigned int *mtype_local,
unsigned int *mtype_remote)
{
- bool is_aid_a1 = (adev->rev_id & 0x10);
+ bool is_aid_a1 = SOC_V1_0_DIE_REV_AID(adev->rev_id) == 1;
/* Local memory: ASIC default depends on the AID stepping. */
*mtype_local = is_aid_a1 ? MTYPE_RW : MTYPE_NC;
diff --git a/drivers/gpu/drm/amd/amdgpu/soc_v1_0.h b/drivers/gpu/drm/amd/amdgpu/soc_v1_0.h
index 9bff7cc60121..861862bd85b9 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc_v1_0.h
+++ b/drivers/gpu/drm/amd/amdgpu/soc_v1_0.h
@@ -46,6 +46,8 @@ extern const struct amdgpu_ip_block_version soc_v1_0_common_ip_block;
((xcd) << SOC_V1_0_DIE_REV_XCD__SHIFT))
#define SOC_V1_0_DIE_REV_XCD(rev_id) \
(((rev_id) & SOC_V1_0_DIE_REV_XCD__MASK) >> SOC_V1_0_DIE_REV_XCD__SHIFT)
+#define SOC_V1_0_DIE_REV_AID(rev_id) \
+ (((rev_id) & SOC_V1_0_DIE_REV_AID__MASK) >> SOC_V1_0_DIE_REV_AID__SHIFT)
void soc_v1_0_grbm_select(struct amdgpu_device *adev,
u32 me, u32 pipe,
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
index a99dbedf3cd4..f99cb18e8e11 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
@@ -34,6 +34,7 @@
#include "amdgpu.h"
#include "amdgpu_xgmi.h"
#include "amdgpu_reset.h"
+#include "soc_v1_0.h"
#include "kfd_priv.h"
#include "kfd_svm.h"
#include "kfd_migrate.h"
@@ -1341,7 +1342,7 @@ svm_range_get_pte_flags(struct kfd_node *node, struct amdgpu_vm *vm,
mapping_flags |= AMDGPU_VM_MTYPE_NC;
break;
case IP_VERSION(12, 1, 0):
- is_aid_a1 = (node->adev->rev_id & 0x10);
+ is_aid_a1 = SOC_V1_0_DIE_REV_AID(node->adev->rev_id) == 1;
is_local = (domain == SVM_RANGE_VRAM_DOMAIN) &&
(bo_node->adev == node->adev);