mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 19:29:37 +00:00
drm/amdgpu: Fix a false positive when pin non-VRAM memory
Flag TTM_PL_FLAG_CONTIGUOUS is only valid for VRAM domain. So fix the false positive by checking memory type too. Suggested-by: Felix Kuehling <Felix.Kuehling@amd.com> Acked-by: Christian König <christian.koenig@amd.com> Signed-off-by: xinhui pan <xinhui.pan@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
b131c363c8
commit
e1a4b67aac
1 changed files with 2 additions and 1 deletions
|
@ -916,7 +916,8 @@ int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain,
|
|||
if (!(domain & amdgpu_mem_type_to_domain(mem_type)))
|
||||
return -EINVAL;
|
||||
|
||||
if ((bo->flags & AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS) &&
|
||||
if ((mem_type == TTM_PL_VRAM) &&
|
||||
(bo->flags & AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS) &&
|
||||
!(mem_flags & TTM_PL_FLAG_CONTIGUOUS))
|
||||
return -EINVAL;
|
||||
|
||||
|
|
Loading…
Reference in a new issue