mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 12:11:40 +00:00
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>
This commit is contained in:
parent
9b23bad032
commit
5c363a8603
@ -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;
|
||||
|
@ -1035,6 +1035,8 @@ struct drm_radeon_cs {
|
||||
#define RADEON_INFO_GTT_USAGE 0x1f
|
||||
#define RADEON_INFO_ACTIVE_CU_COUNT 0x20
|
||||
#define RADEON_INFO_CURRENT_GPU_TEMP 0x21
|
||||
#define RADEON_INFO_CURRENT_GPU_SCLK 0x22
|
||||
#define RADEON_INFO_CURRENT_GPU_MCLK 0x23
|
||||
|
||||
struct drm_radeon_info {
|
||||
uint32_t request;
|
||||
|
Loading…
Reference in New Issue
Block a user