diff options
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_object.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c index 93601fbea695..6e24339ecc46 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | |||
@@ -974,18 +974,21 @@ int amdgpu_bo_fault_reserve_notify(struct ttm_buffer_object *bo) | |||
974 | 974 | ||
975 | /* hurrah the memory is not visible ! */ | 975 | /* hurrah the memory is not visible ! */ |
976 | atomic64_inc(&adev->num_vram_cpu_page_faults); | 976 | atomic64_inc(&adev->num_vram_cpu_page_faults); |
977 | amdgpu_ttm_placement_from_domain(abo, AMDGPU_GEM_DOMAIN_VRAM); | 977 | amdgpu_ttm_placement_from_domain(abo, AMDGPU_GEM_DOMAIN_VRAM | |
978 | AMDGPU_GEM_DOMAIN_GTT); | ||
979 | |||
980 | /* Avoid costly evictions; only set GTT as a busy placement */ | ||
981 | abo->placement.num_busy_placement = 1; | ||
982 | abo->placement.busy_placement = &abo->placements[1]; | ||
983 | |||
978 | r = ttm_bo_validate(bo, &abo->placement, false, false); | 984 | r = ttm_bo_validate(bo, &abo->placement, false, false); |
979 | if (unlikely(r == -ENOMEM)) { | 985 | if (unlikely(r != 0)) |
980 | amdgpu_ttm_placement_from_domain(abo, AMDGPU_GEM_DOMAIN_GTT); | ||
981 | return ttm_bo_validate(bo, &abo->placement, false, false); | ||
982 | } else if (unlikely(r != 0)) { | ||
983 | return r; | 986 | return r; |
984 | } | ||
985 | 987 | ||
986 | offset = bo->mem.start << PAGE_SHIFT; | 988 | offset = bo->mem.start << PAGE_SHIFT; |
987 | /* this should never happen */ | 989 | /* this should never happen */ |
988 | if ((offset + size) > adev->mc.visible_vram_size) | 990 | if (bo->mem.mem_type == TTM_PL_VRAM && |
991 | (offset + size) > adev->mc.visible_vram_size) | ||
989 | return -EINVAL; | 992 | return -EINVAL; |
990 | 993 | ||
991 | return 0; | 994 | return 0; |