drm/amdgpu: add AMDGPU_INFO_NUM_EVICTIONS
authorMarek Olšák <marek.olsak@amd.com>
Wed, 17 Aug 2016 21:58:58 +0000 (23:58 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 22 Aug 2016 17:47:21 +0000 (13:47 -0400)
For profiling.

v2: really bump the minor version

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
include/uapi/drm/amdgpu_drm.h

index 58b1db82f589d7a39ef1cfc210c4c74b2b19ecbb..f5c99a008717199f4f22bbf189d90923325d4dae 100644 (file)
  * - 3.2.0 - GFX8: Uses EOP_TC_WB_ACTION_EN, so UMDs don't have to do the same
  *           at the end of IBs.
  * - 3.3.0 - Add VM support for UVD on supported hardware.
+ * - 3.4.0 - Add AMDGPU_INFO_NUM_EVICTIONS.
  */
 #define KMS_DRIVER_MAJOR       3
-#define KMS_DRIVER_MINOR       3
+#define KMS_DRIVER_MINOR       4
 #define KMS_DRIVER_PATCHLEVEL  0
 
 int amdgpu_vram_limit = 0;
index d942654a1de0f08a4cf2970fce080cd9999b6807..4c8e68a82c47fdb09ada972e67371f7b8588e40d 100644 (file)
@@ -373,6 +373,9 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file
        case AMDGPU_INFO_NUM_BYTES_MOVED:
                ui64 = atomic64_read(&adev->num_bytes_moved);
                return copy_to_user(out, &ui64, min(size, 8u)) ? -EFAULT : 0;
+       case AMDGPU_INFO_NUM_EVICTIONS:
+               ui64 = atomic64_read(&adev->num_evictions);
+               return copy_to_user(out, &ui64, min(size, 8u)) ? -EFAULT : 0;
        case AMDGPU_INFO_VRAM_USAGE:
                ui64 = atomic64_read(&adev->vram_usage);
                return copy_to_user(out, &ui64, min(size, 8u)) ? -EFAULT : 0;
index 5aef0b71079b89f55b65c2a078b72c0f2171cdde..ae2845fdcb5fc0e8ad00d8518bb14ca5de0fa390 100644 (file)
@@ -485,6 +485,8 @@ struct drm_amdgpu_cs_chunk_data {
 #define AMDGPU_INFO_DEV_INFO                   0x16
 /* visible vram usage */
 #define AMDGPU_INFO_VIS_VRAM_USAGE             0x17
+/* number of TTM buffer evictions */
+#define AMDGPU_INFO_NUM_EVICTIONS              0x18
 
 #define AMDGPU_INFO_MMR_SE_INDEX_SHIFT 0
 #define AMDGPU_INFO_MMR_SE_INDEX_MASK  0xff