drm/amdgpu: Honor mtype overrides for NPA remote memory

Derive mtype_remote in gmc_v12_1_get_npa_flags() from
gmc_v12_1_get_mtypes() so the module-parameter override and ASIC
defaults are honored instead of recomputing with hard-coded values.

Signed-off-by: Mukul Joshi <mukul.joshi@amd.com>
Reviewed-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Mukul Joshi 2026-08-13 12:44:41 -04:00 committed by Alex Deucher
parent 05d8d181c9
commit 39cfb3fe53

View File

@ -28,6 +28,10 @@
#include "oss/osssys_7_1_0_sh_mask.h"
#include "ivsrcid/vmc/irqsrcs_vmc_1_0.h"
static void gmc_v12_1_get_mtypes(struct amdgpu_device *adev,
unsigned int *mtype_local,
unsigned int *mtype_remote);
static int gmc_v12_1_vm_fault_interrupt_state(struct amdgpu_device *adev,
struct amdgpu_irq_src *src,
unsigned int type,
@ -603,10 +607,9 @@ static void gmc_v12_1_get_vm_pde(struct amdgpu_device *adev, int level,
static void gmc_v12_1_get_npa_flags(struct amdgpu_device *adev,
uint64_t *flags)
{
bool is_aid_a1 = (adev->rev_id & 0x10);
unsigned int mtype_remote;
unsigned int mtype_local, mtype_remote;
mtype_remote = is_aid_a1 ? MTYPE_NC : MTYPE_UC;
gmc_v12_1_get_mtypes(adev, &mtype_local, &mtype_remote);
*flags = AMDGPU_PTE_MTYPE_GFX12(*flags, mtype_remote);
/* VSCT = 0011 to identify NPA. Additionally PTE.B = 1 */