提交 c3c9e0fa 编写于 作者: E Eric Huang 提交者: Alex Deucher

drm/amdkfd: apply uncached flag for aldebaran

The flag is only applied on fine-grained memory.
Signed-off-by: NEric Huang <jinhuieric.huang@amd.com>
Reviewed-by: NOak Zeng <Oak.Zeng@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 2e2f197f
...@@ -405,6 +405,7 @@ static uint64_t get_pte_flags(struct amdgpu_device *adev, struct kgd_mem *mem) ...@@ -405,6 +405,7 @@ static uint64_t get_pte_flags(struct amdgpu_device *adev, struct kgd_mem *mem)
{ {
struct amdgpu_device *bo_adev = amdgpu_ttm_adev(mem->bo->tbo.bdev); struct amdgpu_device *bo_adev = amdgpu_ttm_adev(mem->bo->tbo.bdev);
bool coherent = mem->alloc_flags & KFD_IOC_ALLOC_MEM_FLAGS_COHERENT; bool coherent = mem->alloc_flags & KFD_IOC_ALLOC_MEM_FLAGS_COHERENT;
bool uncached = mem->alloc_flags & KFD_IOC_ALLOC_MEM_FLAGS_UNCACHED;
uint32_t mapping_flags; uint32_t mapping_flags;
uint64_t pte_flags; uint64_t pte_flags;
bool snoop = false; bool snoop = false;
...@@ -429,7 +430,12 @@ static uint64_t get_pte_flags(struct amdgpu_device *adev, struct kgd_mem *mem) ...@@ -429,7 +430,12 @@ static uint64_t get_pte_flags(struct amdgpu_device *adev, struct kgd_mem *mem)
} }
break; break;
case CHIP_ALDEBARAN: case CHIP_ALDEBARAN:
if (mem->alloc_flags & KFD_IOC_ALLOC_MEM_FLAGS_VRAM) { if (coherent && uncached) {
if (adev->gmc.xgmi.connected_to_cpu ||
!(mem->alloc_flags & KFD_IOC_ALLOC_MEM_FLAGS_VRAM))
snoop = true;
mapping_flags |= AMDGPU_VM_MTYPE_UC;
} else if (mem->alloc_flags & KFD_IOC_ALLOC_MEM_FLAGS_VRAM) {
if (bo_adev == adev) { if (bo_adev == adev) {
mapping_flags |= AMDGPU_VM_MTYPE_RW; mapping_flags |= AMDGPU_VM_MTYPE_RW;
if (adev->gmc.xgmi.connected_to_cpu) if (adev->gmc.xgmi.connected_to_cpu)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册