mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 10:33:41 +02:00
drm/amdgpu: support for DCC feature
Deal with AMDGPU_GEM_CREATE_GFX12_DCC to set DCC bit when needed. Signed-off-by: Likun Gao <Likun.Gao@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
6b83b94a94
commit
7c85e97083
|
|
@ -334,6 +334,7 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data,
|
|||
AMDGPU_GEM_CREATE_VM_ALWAYS_VALID |
|
||||
AMDGPU_GEM_CREATE_EXPLICIT_SYNC |
|
||||
AMDGPU_GEM_CREATE_ENCRYPTED |
|
||||
AMDGPU_GEM_CREATE_GFX12_DCC |
|
||||
AMDGPU_GEM_CREATE_DISCARDABLE))
|
||||
return -EINVAL;
|
||||
|
||||
|
|
@ -341,6 +342,11 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data,
|
|||
if (args->in.domains & ~AMDGPU_GEM_DOMAIN_MASK)
|
||||
return -EINVAL;
|
||||
|
||||
if ((flags & AMDGPU_GEM_CREATE_GFX12_DCC) &&
|
||||
((amdgpu_ip_version(adev, GC_HWIP, 0) < IP_VERSION(12, 0, 0)) ||
|
||||
!(args->in.domains & AMDGPU_GEM_DOMAIN_VRAM)))
|
||||
return -EINVAL;
|
||||
|
||||
if (!amdgpu_is_tmz(adev) && (flags & AMDGPU_GEM_CREATE_ENCRYPTED)) {
|
||||
DRM_NOTE_ONCE("Cannot allocate secure buffer since TMZ is disabled\n");
|
||||
return -EINVAL;
|
||||
|
|
|
|||
|
|
@ -532,6 +532,9 @@ static void gmc_v12_0_get_vm_pte(struct amdgpu_device *adev,
|
|||
is_system = (bo->tbo.resource->mem_type == TTM_PL_TT) ||
|
||||
(bo->tbo.resource->mem_type == AMDGPU_PL_PREEMPT);
|
||||
|
||||
if (bo && bo->flags & AMDGPU_GEM_CREATE_GFX12_DCC)
|
||||
*flags |= AMDGPU_PTE_DCC;
|
||||
|
||||
/* WA for HW bug */
|
||||
if (is_system || ((bo_adev != adev) && coherent))
|
||||
*flags = AMDGPU_PTE_MTYPE_GFX12(*flags, MTYPE_NC);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user