aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h
diff options
context:
space:
mode:
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>2017-02-13 19:00:49 -0500
committerAlex Deucher <alexander.deucher@amd.com>2017-03-29 23:53:03 -0400
commitd6c29695e68ca911648dbe2294764dab6ef84fc7 (patch)
treeb14a6d711a6e8065e64b31599fdada9668163cee /drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h
parent75cb00dc0c9dbe5e7a971ac729384d8d05f0deb1 (diff)
drm/amdgpu: implement read_sensor() for pre-powerplay chips
Add the GPU temperature, the shader clock and eventually the memory clock (as well as the GPU load on CI). The main goal is to expose this info to the userspace like Radeon. v2: - add AMDGPU_PP_SENSOR_GPU_LOAD on CI - update the commit description Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h
index 5dd9daae9eef..8c96a4caa715 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h
@@ -270,6 +270,8 @@ struct amdgpu_dpm_funcs {
270 struct amdgpu_ps *cps, 270 struct amdgpu_ps *cps,
271 struct amdgpu_ps *rps, 271 struct amdgpu_ps *rps,
272 bool *equal); 272 bool *equal);
273 int (*read_sensor)(struct amdgpu_device *adev, int idx, void *value,
274 int *size);
273 275
274 struct amd_vce_state* (*get_vce_clock_state)(struct amdgpu_device *adev, unsigned idx); 276 struct amd_vce_state* (*get_vce_clock_state)(struct amdgpu_device *adev, unsigned idx);
275 int (*reset_power_profile_state)(struct amdgpu_device *adev, 277 int (*reset_power_profile_state)(struct amdgpu_device *adev,
@@ -293,7 +295,7 @@ struct amdgpu_dpm_funcs {
293#define amdgpu_dpm_read_sensor(adev, idx, value, size) \ 295#define amdgpu_dpm_read_sensor(adev, idx, value, size) \
294 ((adev)->pp_enabled ? \ 296 ((adev)->pp_enabled ? \
295 (adev)->powerplay.pp_funcs->read_sensor(adev->powerplay.pp_handle, (idx), (value), (size)) : \ 297 (adev)->powerplay.pp_funcs->read_sensor(adev->powerplay.pp_handle, (idx), (value), (size)) : \
296 -EINVAL) 298 (adev)->pm.funcs->read_sensor((adev), (idx), (value), (size)))
297 299
298#define amdgpu_dpm_get_temperature(adev) \ 300#define amdgpu_dpm_get_temperature(adev) \
299 ((adev)->pp_enabled ? \ 301 ((adev)->pp_enabled ? \