diff options
| author | Christian König <[email protected]> | 2021-04-27 09:17:59 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2021-05-20 02:32:14 +0000 |
| commit | abf91e0d33166ba1afcf10e239aec966275da3c1 (patch) | |
| tree | c5aed0a9f84d6ad876676bccd4e6e92fa646c0c0 /drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | |
| parent | drm/amdgpu: use cursor functions in amdgpu_bo_in_cpu_visible_vram (diff) | |
| download | kernel-abf91e0d33166ba1afcf10e239aec966275da3c1.tar.gz kernel-abf91e0d33166ba1afcf10e239aec966275da3c1.zip | |
drm/amdgpu: set the contiguous flag if possible
This avoids reallocating scanout BOs on first pin in a lot of cases.
Signed-off-by: Christian König <[email protected]>
Acked-by: Felix Kuehling <[email protected]>
Tested-by: Nirmoy Das <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c index e2cbe19404c0..87c40c4cdd50 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c @@ -446,10 +446,11 @@ static int amdgpu_vram_mgr_new(struct ttm_resource_manager *man, } spin_unlock(&mgr->lock); - atomic64_add(vis_usage, &mgr->vis_usage); + if (i == 1) + mem->placement |= TTM_PL_FLAG_CONTIGUOUS; + atomic64_add(vis_usage, &mgr->vis_usage); mem->mm_node = nodes; - return 0; error: |
