Skip to content

Commit 084300f

Browse files
ChristianKoenigAMDalexdeucher
authored andcommitted
drm/amdgpu: rework gmc_v9_0_get_coherence_flags v2
Avoid using the mapping here. v2: use amdgpu_xgmi_same_hive() as suggested by Felix Signed-off-by: Christian König <[email protected]> Reviewed-by: Felix Kuehling <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent d7767a1 commit 084300f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,8 +1121,8 @@ static void gmc_v9_0_get_vm_pde(struct amdgpu_device *adev, int level,
11211121
}
11221122

11231123
static void gmc_v9_0_get_coherence_flags(struct amdgpu_device *adev,
1124+
struct amdgpu_vm *vm,
11241125
struct amdgpu_bo *bo,
1125-
struct amdgpu_bo_va_mapping *mapping,
11261126
uint64_t *flags)
11271127
{
11281128
struct amdgpu_device *bo_adev = amdgpu_ttm_adev(bo->tbo.bdev);
@@ -1132,7 +1132,6 @@ static void gmc_v9_0_get_coherence_flags(struct amdgpu_device *adev,
11321132
AMDGPU_GEM_CREATE_EXT_COHERENT);
11331133
bool ext_coherent = bo->flags & AMDGPU_GEM_CREATE_EXT_COHERENT;
11341134
bool uncached = bo->flags & AMDGPU_GEM_CREATE_UNCACHED;
1135-
struct amdgpu_vm *vm = mapping->bo_va->base.vm;
11361135
unsigned int mtype_local, mtype;
11371136
uint32_t gc_ip_version = amdgpu_ip_version(adev, GC_HWIP, 0);
11381137
bool snoop = false;
@@ -1162,7 +1161,7 @@ static void gmc_v9_0_get_coherence_flags(struct amdgpu_device *adev,
11621161
mtype = MTYPE_UC;
11631162
else
11641163
mtype = MTYPE_NC;
1165-
if (mapping->bo_va->is_xgmi)
1164+
if (amdgpu_xgmi_same_hive(adev, bo_adev))
11661165
snoop = true;
11671166
}
11681167
} else {
@@ -1254,7 +1253,8 @@ static void gmc_v9_0_get_vm_pte(struct amdgpu_device *adev,
12541253
}
12551254

12561255
if ((*flags & AMDGPU_PTE_VALID) && bo)
1257-
gmc_v9_0_get_coherence_flags(adev, bo, mapping, flags);
1256+
gmc_v9_0_get_coherence_flags(adev, mapping->bo_va->base.vm, bo,
1257+
flags);
12581258
}
12591259

12601260
static void gmc_v9_0_override_vm_pte_flags(struct amdgpu_device *adev,

0 commit comments

Comments
 (0)