diff options
author | Christian König <christian.koenig@amd.com> | 2017-06-30 06:19:42 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-07-14 11:06:21 -0400 |
commit | 5e7e83963fcf7688c2a171bedd9e76e2aa4eb85a (patch) | |
tree | b24cd3a6765716ac894e0b93bad5e498ac01882b /drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | |
parent | abca90f1c8103528ca4b194fdc69e933bd23db4c (diff) |
drm/amdgpu: stop mapping BOs to GTT
No need to map BOs to GTT on eviction and intermediate transfers any more.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index 4a34b61d44ef..fb9c6988f5f2 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | |||
@@ -199,7 +199,6 @@ static void amdgpu_evict_flags(struct ttm_buffer_object *bo, | |||
199 | .lpfn = 0, | 199 | .lpfn = 0, |
200 | .flags = TTM_PL_MASK_CACHING | TTM_PL_FLAG_SYSTEM | 200 | .flags = TTM_PL_MASK_CACHING | TTM_PL_FLAG_SYSTEM |
201 | }; | 201 | }; |
202 | unsigned i; | ||
203 | 202 | ||
204 | if (!amdgpu_ttm_bo_is_amdgpu_bo(bo)) { | 203 | if (!amdgpu_ttm_bo_is_amdgpu_bo(bo)) { |
205 | placement->placement = &placements; | 204 | placement->placement = &placements; |
@@ -217,20 +216,6 @@ static void amdgpu_evict_flags(struct ttm_buffer_object *bo, | |||
217 | amdgpu_ttm_placement_from_domain(abo, AMDGPU_GEM_DOMAIN_CPU); | 216 | amdgpu_ttm_placement_from_domain(abo, AMDGPU_GEM_DOMAIN_CPU); |
218 | } else { | 217 | } else { |
219 | amdgpu_ttm_placement_from_domain(abo, AMDGPU_GEM_DOMAIN_GTT); | 218 | amdgpu_ttm_placement_from_domain(abo, AMDGPU_GEM_DOMAIN_GTT); |
220 | for (i = 0; i < abo->placement.num_placement; ++i) { | ||
221 | if (!(abo->placements[i].flags & | ||
222 | TTM_PL_FLAG_TT)) | ||
223 | continue; | ||
224 | |||
225 | if (abo->placements[i].lpfn) | ||
226 | continue; | ||
227 | |||
228 | /* set an upper limit to force directly | ||
229 | * allocating address space for the BO. | ||
230 | */ | ||
231 | abo->placements[i].lpfn = | ||
232 | adev->mc.gtt_size >> PAGE_SHIFT; | ||
233 | } | ||
234 | } | 219 | } |
235 | break; | 220 | break; |
236 | case TTM_PL_TT: | 221 | case TTM_PL_TT: |
@@ -391,7 +376,7 @@ static int amdgpu_move_vram_ram(struct ttm_buffer_object *bo, | |||
391 | placement.num_busy_placement = 1; | 376 | placement.num_busy_placement = 1; |
392 | placement.busy_placement = &placements; | 377 | placement.busy_placement = &placements; |
393 | placements.fpfn = 0; | 378 | placements.fpfn = 0; |
394 | placements.lpfn = adev->mc.gtt_size >> PAGE_SHIFT; | 379 | placements.lpfn = 0; |
395 | placements.flags = TTM_PL_MASK_CACHING | TTM_PL_FLAG_TT; | 380 | placements.flags = TTM_PL_MASK_CACHING | TTM_PL_FLAG_TT; |
396 | r = ttm_bo_mem_space(bo, &placement, &tmp_mem, | 381 | r = ttm_bo_mem_space(bo, &placement, &tmp_mem, |
397 | interruptible, no_wait_gpu); | 382 | interruptible, no_wait_gpu); |
@@ -438,7 +423,7 @@ static int amdgpu_move_ram_vram(struct ttm_buffer_object *bo, | |||
438 | placement.num_busy_placement = 1; | 423 | placement.num_busy_placement = 1; |
439 | placement.busy_placement = &placements; | 424 | placement.busy_placement = &placements; |
440 | placements.fpfn = 0; | 425 | placements.fpfn = 0; |
441 | placements.lpfn = adev->mc.gtt_size >> PAGE_SHIFT; | 426 | placements.lpfn = 0; |
442 | placements.flags = TTM_PL_MASK_CACHING | TTM_PL_FLAG_TT; | 427 | placements.flags = TTM_PL_MASK_CACHING | TTM_PL_FLAG_TT; |
443 | r = ttm_bo_mem_space(bo, &placement, &tmp_mem, | 428 | r = ttm_bo_mem_space(bo, &placement, &tmp_mem, |
444 | interruptible, no_wait_gpu); | 429 | interruptible, no_wait_gpu); |