diff options
author | Christian König | 2016-06-21 16:28:14 +0200 |
---|---|---|
committer | Alex Deucher | 2016-07-07 20:54:49 +0200 |
commit | dbd5ed60ac856632609491229e6d7ad70115fb09 (patch) | |
tree | 63947ebcb6273c20c88cf5348f790ab46b7615aa /drivers/gpu/drm | |
parent | drm/amdgpu: add amdgpu_irq_gpu_reset_resume_helper (diff) | |
download | kernel-qcow2-linux-dbd5ed60ac856632609491229e6d7ad70115fb09.tar.gz kernel-qcow2-linux-dbd5ed60ac856632609491229e6d7ad70115fb09.tar.xz kernel-qcow2-linux-dbd5ed60ac856632609491229e6d7ad70115fb09.zip |
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')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index c1abe0900f48..f4d269931dbe 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h @@ -2042,6 +2042,7 @@ struct amdgpu_device { atomic64_t vram_vis_usage; atomic64_t gtt_usage; atomic64_t num_bytes_moved; + atomic64_t num_evictions; atomic_t gpu_reset_counter; /* display */ 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; |