diff options
author | Tom St Denis <tom.stdenis@amd.com> | 2017-02-09 14:29:01 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-03-29 23:52:59 -0400 |
commit | 9f8df7d71e382c9afa808a08c11a990e90ac7df4 (patch) | |
tree | 9002abe9daf71a55c7bcde6022f4ed6b67d657e6 /drivers/gpu/drm/amd/powerplay/amd_powerplay.c | |
parent | 603adfe83a568d50542c9e7b9829d7baa497f0de (diff) | |
download | linux-9f8df7d71e382c9afa808a08c11a990e90ac7df4.tar.gz |
drm/amd/amdgpu: Update read_sensor calls to have size parameter (v3)
This update allows sensors to return more than 1 value and
indicates to the caller how many bytes are written.
The debugfs interface has been updated to handle reading all
of the values. Simply seek to the enum value (multiplied
by 4) and then read as many bytes as the sensor provides.
(v2): Don't set size to 4 before reading GPU_POWER
(v3): agd: rebase
Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/powerplay/amd_powerplay.c')
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c index 81e6856ffa11..fde8fcd46b58 100644 --- a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c +++ b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c @@ -880,7 +880,8 @@ static int pp_dpm_set_mclk_od(void *handle, uint32_t value) return hwmgr->hwmgr_func->set_mclk_od(hwmgr, value); } -static int pp_dpm_read_sensor(void *handle, int idx, void *value) +static int pp_dpm_read_sensor(void *handle, int idx, + void *value, int *size) { struct pp_hwmgr *hwmgr; struct pp_instance *pp_handle = (struct pp_instance *)handle; @@ -898,7 +899,7 @@ static int pp_dpm_read_sensor(void *handle, int idx, void *value) return 0; } - return hwmgr->hwmgr_func->read_sensor(hwmgr, idx, value); + return hwmgr->hwmgr_func->read_sensor(hwmgr, idx, value, size); } static struct amd_vce_state* |