diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2014-09-30 10:04:40 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2015-03-19 12:26:27 -0400 |
commit | d6d2a1882a79c1a5425d6f82b2fc7b934916f893 (patch) | |
tree | 57d42a81db39f27a5bc5b8e1ca362aea98fbb64f | |
parent | b9729b17a414f99c61f4db9ac9f9ed987fa0cbfe (diff) |
drm/radeon: add INFO query for GPU temperature
Useful for profiling.
Tested-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_kms.c | 7 | ||||
-rw-r--r-- | include/uapi/drm/radeon_drm.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c index 686411e4e4f6..7904887c6cc7 100644 --- a/drivers/gpu/drm/radeon/radeon_kms.c +++ b/drivers/gpu/drm/radeon/radeon_kms.c | |||
@@ -547,6 +547,13 @@ static int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file | |||
547 | else | 547 | else |
548 | *value = 1; | 548 | *value = 1; |
549 | break; | 549 | break; |
550 | case RADEON_INFO_CURRENT_GPU_TEMP: | ||
551 | /* get temperature in millidegrees C */ | ||
552 | if (rdev->asic->pm.get_temperature) | ||
553 | *value = radeon_get_temperature(rdev); | ||
554 | else | ||
555 | *value = 0; | ||
556 | break; | ||
550 | default: | 557 | default: |
551 | DRM_DEBUG_KMS("Invalid request %d\n", info->request); | 558 | DRM_DEBUG_KMS("Invalid request %d\n", info->request); |
552 | return -EINVAL; | 559 | return -EINVAL; |
diff --git a/include/uapi/drm/radeon_drm.h b/include/uapi/drm/radeon_drm.h index 50d0fb41a3bf..66b1131bb296 100644 --- a/include/uapi/drm/radeon_drm.h +++ b/include/uapi/drm/radeon_drm.h | |||
@@ -1034,6 +1034,7 @@ struct drm_radeon_cs { | |||
1034 | #define RADEON_INFO_VRAM_USAGE 0x1e | 1034 | #define RADEON_INFO_VRAM_USAGE 0x1e |
1035 | #define RADEON_INFO_GTT_USAGE 0x1f | 1035 | #define RADEON_INFO_GTT_USAGE 0x1f |
1036 | #define RADEON_INFO_ACTIVE_CU_COUNT 0x20 | 1036 | #define RADEON_INFO_ACTIVE_CU_COUNT 0x20 |
1037 | #define RADEON_INFO_CURRENT_GPU_TEMP 0x21 | ||
1037 | 1038 | ||
1038 | struct drm_radeon_info { | 1039 | struct drm_radeon_info { |
1039 | uint32_t request; | 1040 | uint32_t request; |