aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2016-06-21 16:28:14 +0200
committerAlex Deucher <alexander.deucher@amd.com>2016-07-07 14:54:49 -0400
commitdbd5ed60ac856632609491229e6d7ad70115fb09 (patch)
tree63947ebcb6273c20c88cf5348f790ab46b7615aa /drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
parent0eaeb070ed6d22e5b42e47210c249283ddf5b08f (diff)
downloadlinux-stericsson-dbd5ed60ac856632609491229e6d7ad70115fb09.tar.gz
drm/amdgpu: add eviction counter
Keep track of the number of evictions since boot. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Christian König <christian.koenig@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.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index f85527fbbac5..b7742e62972a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -397,6 +397,11 @@ static int amdgpu_bo_move(struct ttm_buffer_object *bo,
return -EINVAL;
adev = amdgpu_get_adev(bo->bdev);
+
+ /* remember the eviction */
+ if (evict)
+ atomic64_inc(&adev->num_evictions);
+
if (old_mem->mem_type == TTM_PL_SYSTEM && bo->ttm == NULL) {
amdgpu_move_null(bo, new_mem);
return 0;