mirror of
https://git.proxmox.com/git/mirror_ubuntu-kernels.git
synced 2025-12-08 10:36:54 +00:00
drm/amdkfd: Update coherence settings for svm ranges
Recently introduced commit "drm/amdgpu: Set cache coherency for GC 9.4.3" did not update the settings applicable for svm ranges. Add the coherence settings for svm ranges for GFX IP 9.4.3. Reviewed-by: Amber Lin <amber.lin@amd.com> Signed-off-by: Rajneesh Bhardwaj <rajneesh.bhardwaj@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
a8027fcd08
commit
ef75a6ef37
@ -1159,6 +1159,7 @@ svm_range_get_pte_flags(struct amdgpu_device *adev, struct svm_range *prange,
|
|||||||
uint64_t pte_flags;
|
uint64_t pte_flags;
|
||||||
bool snoop = (domain != SVM_RANGE_VRAM_DOMAIN);
|
bool snoop = (domain != SVM_RANGE_VRAM_DOMAIN);
|
||||||
bool coherent = flags & KFD_IOCTL_SVM_FLAG_COHERENT;
|
bool coherent = flags & KFD_IOCTL_SVM_FLAG_COHERENT;
|
||||||
|
bool uncached = flags & KFD_IOCTL_SVM_FLAG_UNCACHED;
|
||||||
|
|
||||||
if (domain == SVM_RANGE_VRAM_DOMAIN)
|
if (domain == SVM_RANGE_VRAM_DOMAIN)
|
||||||
bo_adev = amdgpu_ttm_adev(prange->svm_bo->bo->tbo.bdev);
|
bo_adev = amdgpu_ttm_adev(prange->svm_bo->bo->tbo.bdev);
|
||||||
@ -1198,6 +1199,22 @@ svm_range_get_pte_flags(struct amdgpu_device *adev, struct svm_range *prange,
|
|||||||
AMDGPU_VM_MTYPE_UC : AMDGPU_VM_MTYPE_NC;
|
AMDGPU_VM_MTYPE_UC : AMDGPU_VM_MTYPE_NC;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case IP_VERSION(9, 4, 3):
|
||||||
|
//TODO: Need more work for handling multiple memory partitions
|
||||||
|
//e.g. NPS4. Current approch is only applicable without memory
|
||||||
|
//partitions.
|
||||||
|
snoop = true;
|
||||||
|
if (uncached)
|
||||||
|
mapping_flags |= AMDGPU_VM_MTYPE_UC;
|
||||||
|
/* local HBM region close to partition*/
|
||||||
|
else if (bo_adev == adev)
|
||||||
|
mapping_flags |= AMDGPU_VM_MTYPE_RW;
|
||||||
|
/* local HBM region far from partition or remote XGMI GPU or
|
||||||
|
* system memory
|
||||||
|
*/
|
||||||
|
else
|
||||||
|
mapping_flags |= AMDGPU_VM_MTYPE_NC;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
mapping_flags |= coherent ?
|
mapping_flags |= coherent ?
|
||||||
AMDGPU_VM_MTYPE_UC : AMDGPU_VM_MTYPE_NC;
|
AMDGPU_VM_MTYPE_UC : AMDGPU_VM_MTYPE_NC;
|
||||||
|
|||||||
@ -623,6 +623,8 @@ enum kfd_mmio_remap {
|
|||||||
#define KFD_IOCTL_SVM_FLAG_GPU_READ_MOSTLY 0x00000020
|
#define KFD_IOCTL_SVM_FLAG_GPU_READ_MOSTLY 0x00000020
|
||||||
/* Keep GPU memory mapping always valid as if XNACK is disable */
|
/* Keep GPU memory mapping always valid as if XNACK is disable */
|
||||||
#define KFD_IOCTL_SVM_FLAG_GPU_ALWAYS_MAPPED 0x00000040
|
#define KFD_IOCTL_SVM_FLAG_GPU_ALWAYS_MAPPED 0x00000040
|
||||||
|
/* Uncached access to memory */
|
||||||
|
#define KFD_IOCTL_SVM_FLAG_UNCACHED 0x00000080
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* kfd_ioctl_svm_op - SVM ioctl operations
|
* kfd_ioctl_svm_op - SVM ioctl operations
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user