This allows us to query certain registers from userspace for profiling and harvest configuration. E.g., it can be used by the GALLIUM_HUD for profiling the status of various gfx blocks.
Unified · Split
| @@ -568,6 +568,14 @@ static int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file · 567 unmodified lines | ||
| 568 | 568 | else |
| 569 | 569 | *value = rdev->pm.current_mclk / 100; |
| 570 | 570 | break; |
| 571 | + case RADEON_INFO_READ_REG: | |
| 572 | + if (copy_from_user(value, value_ptr, sizeof(uint32_t))) { | |
| 573 | + DRM_ERROR("copy_from_user %s:%u\n", __func__, __LINE__); | |
| 574 | + return -EFAULT; | |
| 575 | + } | |
| 576 | + if (radeon_get_allowed_info_register(rdev, *value, value)) | |
| 577 | + return -EINVAL; | |
| 578 | + break; | |
| 571 | 579 | default: |
| 572 | 580 | DRM_DEBUG_KMS("Invalid request %d\n", info->request); |
| 573 | 581 | return -EINVAL; |
| @@ -1037,6 +1037,7 @@ struct drm_radeon_cs { · 1036 unmodified lines | ||
| 1037 | 1037 | #define RADEON_INFO_CURRENT_GPU_TEMP 0x21 |
| 1038 | 1038 | #define RADEON_INFO_CURRENT_GPU_SCLK 0x22 |
| 1039 | 1039 | #define RADEON_INFO_CURRENT_GPU_MCLK 0x23 |
| 1040 | +#define RADEON_INFO_READ_REG 0x24 | |
| 1040 | 1041 | |
| 1041 | 1042 | struct drm_radeon_info { |
| 1042 | 1043 | uint32_t request; |