v2: bump the DRM version
Unified · Split
| @@ -1529,6 +1529,7 @@ struct amdgpu_device { · 1528 unmodified lines | ||
| 1529 | 1529 | atomic64_t gtt_usage; |
| 1530 | 1530 | atomic64_t num_bytes_moved; |
| 1531 | 1531 | atomic64_t num_evictions; |
| 1532 | + atomic64_t num_vram_cpu_page_faults; | |
| 1532 | 1533 | atomic_t gpu_reset_counter; |
| 1533 | 1534 | atomic_t vram_lost_counter; |
| 1534 | 1535 | |
| @@ -66,9 +66,10 @@ · 65 unmodified lines | ||
| 66 | 66 | * - 3.14.0 - Fix race in amdgpu_ctx_get_fence() and note new functionality |
| 67 | 67 | * - 3.15.0 - Export more gpu info for gfx9 |
| 68 | 68 | * - 3.16.0 - Add reserved vmid support |
| 69 | + * - 3.17.0 - Add AMDGPU_NUM_VRAM_CPU_PAGE_FAULTS. | |
| 69 | 70 | */ |
| 70 | 71 | #define KMS_DRIVER_MAJOR 3 |
| 71 | −#define KMS_DRIVER_MINOR 16 | |
| 72 | +#define KMS_DRIVER_MINOR 17 | |
| 72 | 73 | #define KMS_DRIVER_PATCHLEVEL 0 |
| 73 | 74 | |
| 74 | 75 | int amdgpu_vram_limit = 0; |
| @@ -417,6 +417,9 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file · 416 unmodified lines | ||
| 417 | 417 | case AMDGPU_INFO_NUM_EVICTIONS: |
| 418 | 418 | ui64 = atomic64_read(&adev->num_evictions); |
| 419 | 419 | return copy_to_user(out, &ui64, min(size, 8u)) ? -EFAULT : 0; |
| 420 | + case AMDGPU_INFO_NUM_VRAM_CPU_PAGE_FAULTS: | |
| 421 | + ui64 = atomic64_read(&adev->num_vram_cpu_page_faults); | |
| 422 | + return copy_to_user(out, &ui64, min(size, 8u)) ? -EFAULT : 0; | |
| 420 | 423 | case AMDGPU_INFO_VRAM_USAGE: |
| 421 | 424 | ui64 = atomic64_read(&adev->vram_usage); |
| 422 | 425 | return copy_to_user(out, &ui64, min(size, 8u)) ? -EFAULT : 0; |
| @@ -960,6 +960,7 @@ int amdgpu_bo_fault_reserve_notify(struct ttm_buffer_object *bo) · 959 unmodified lines | ||
| 960 | 960 | return -EINVAL; |
| 961 | 961 | |
| 962 | 962 | /* hurrah the memory is not visible ! */ |
| 963 | + atomic64_inc(&adev->num_vram_cpu_page_faults); | |
| 963 | 964 | amdgpu_ttm_placement_from_domain(abo, AMDGPU_GEM_DOMAIN_VRAM); |
| 964 | 965 | lpfn = adev->mc.visible_vram_size >> PAGE_SHIFT; |
| 965 | 966 | for (i = 0; i < abo->placement.num_placement; i++) { |
| @@ -603,6 +603,8 @@ struct drm_amdgpu_cs_chunk_data { · 602 unmodified lines | ||
| 603 | 603 | #define AMDGPU_INFO_SENSOR_VDDNB 0x6 |
| 604 | 604 | /* Subquery id: Query graphics voltage */ |
| 605 | 605 | #define AMDGPU_INFO_SENSOR_VDDGFX 0x7 |
| 606 | +/* Number of VRAM page faults on CPU access. */ | |
| 607 | +#define AMDGPU_INFO_NUM_VRAM_CPU_PAGE_FAULTS 0x1E | |
| 606 | 608 | |
| 607 | 609 | #define AMDGPU_INFO_MMR_SE_INDEX_SHIFT 0 |
| 608 | 610 | #define AMDGPU_INFO_MMR_SE_INDEX_MASK 0xff |