diff options
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index d7d7ce1507ec..de69ab12bb55 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | |||
@@ -412,7 +412,6 @@ static bool amdgpu_cs_try_evict(struct amdgpu_cs_parser *p, | |||
412 | struct amdgpu_bo_list_entry *candidate = p->evictable; | 412 | struct amdgpu_bo_list_entry *candidate = p->evictable; |
413 | struct amdgpu_bo *bo = candidate->robj; | 413 | struct amdgpu_bo *bo = candidate->robj; |
414 | struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev); | 414 | struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev); |
415 | u64 initial_bytes_moved, bytes_moved; | ||
416 | bool update_bytes_moved_vis; | 415 | bool update_bytes_moved_vis; |
417 | uint32_t other; | 416 | uint32_t other; |
418 | 417 | ||
@@ -436,18 +435,15 @@ static bool amdgpu_cs_try_evict(struct amdgpu_cs_parser *p, | |||
436 | continue; | 435 | continue; |
437 | 436 | ||
438 | /* Good we can try to move this BO somewhere else */ | 437 | /* Good we can try to move this BO somewhere else */ |
439 | amdgpu_ttm_placement_from_domain(bo, other); | ||
440 | update_bytes_moved_vis = | 438 | update_bytes_moved_vis = |
441 | adev->gmc.visible_vram_size < adev->gmc.real_vram_size && | 439 | adev->gmc.visible_vram_size < adev->gmc.real_vram_size && |
442 | bo->tbo.mem.mem_type == TTM_PL_VRAM && | 440 | bo->tbo.mem.mem_type == TTM_PL_VRAM && |
443 | bo->tbo.mem.start < adev->gmc.visible_vram_size >> PAGE_SHIFT; | 441 | bo->tbo.mem.start < adev->gmc.visible_vram_size >> PAGE_SHIFT; |
444 | initial_bytes_moved = atomic64_read(&adev->num_bytes_moved); | 442 | amdgpu_ttm_placement_from_domain(bo, other); |
445 | r = ttm_bo_validate(&bo->tbo, &bo->placement, &ctx); | 443 | r = ttm_bo_validate(&bo->tbo, &bo->placement, &ctx); |
446 | bytes_moved = atomic64_read(&adev->num_bytes_moved) - | 444 | p->bytes_moved += ctx.bytes_moved; |
447 | initial_bytes_moved; | ||
448 | p->bytes_moved += bytes_moved; | ||
449 | if (update_bytes_moved_vis) | 445 | if (update_bytes_moved_vis) |
450 | p->bytes_moved_vis += bytes_moved; | 446 | p->bytes_moved_vis += ctx.bytes_moved; |
451 | 447 | ||
452 | if (unlikely(r)) | 448 | if (unlikely(r)) |
453 | break; | 449 | break; |