diff options
| author | xinhui pan <[email protected]> | 2021-01-30 00:41:04 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2021-02-02 17:06:21 +0000 |
| commit | e1a4b67aac9ee870b4d95a008d47910c47db3092 (patch) | |
| tree | 0cd08367c2b04935648e47ed92409f763d864f8f /drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | |
| parent | drm/amdgpu: Limit the maximum size of contiguous VRAM that can be encapsulate... (diff) | |
| download | kernel-e1a4b67aac9ee870b4d95a008d47910c47db3092.tar.gz kernel-e1a4b67aac9ee870b4d95a008d47910c47db3092.zip | |
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 <[email protected]>
Acked-by: Christian König <[email protected]>
Signed-off-by: xinhui pan <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_object.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c index 52f98e370a87..996147111c3e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c @@ -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; |
