summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2014-09-30 11:33:30 -0400
committerAlex Deucher <alexander.deucher@amd.com>2015-03-19 12:26:36 -0400
commit5c363a860398e2a09e5cff7f4654cf82ed8485e1 (patch)
tree4f9ead64d2eaad9495c39b51d752b3d1f3bf233f /drivers/gpu/drm/radeon
parent9b23bad03263c5496bac2cbb2c2630cb3b8b38be (diff)
downloadop-kernel-dev-5c363a860398e2a09e5cff7f4654cf82ed8485e1.zip
op-kernel-dev-5c363a860398e2a09e5cff7f4654cf82ed8485e1.tar.gz
drm/radeon: add INFO query for current sclk/mclk
Allow the UMDs to query the current sclk/mclk for profiling, etc. Tested-by: Marek Olšák <marek.olsak@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon')
-rw-r--r--drivers/gpu/drm/radeon/radeon_kms.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c
index 7904887..cf7e54e 100644
--- a/drivers/gpu/drm/radeon/radeon_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_kms.c
@@ -554,6 +554,20 @@ static int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file
else
*value = 0;
break;
+ case RADEON_INFO_CURRENT_GPU_SCLK:
+ /* get sclk in Mhz */
+ if (rdev->pm.dpm_enabled)
+ *value = radeon_dpm_get_current_sclk(rdev) / 100;
+ else
+ *value = rdev->pm.current_sclk / 100;
+ break;
+ case RADEON_INFO_CURRENT_GPU_MCLK:
+ /* get mclk in Mhz */
+ if (rdev->pm.dpm_enabled)
+ *value = radeon_dpm_get_current_mclk(rdev) / 100;
+ else
+ *value = rdev->pm.current_mclk / 100;
+ break;
default:
DRM_DEBUG_KMS("Invalid request %d\n", info->request);
return -EINVAL;
OpenPOWER on IntegriCloud