[PATCH] drm/amdgpu: expose amdgpu_sensors on pre-powerplay chips

Tom St Denis tom.stdenis at amd.com
Tue Feb 14 16:58:01 UTC 2017


On 14/02/17 11:57 AM, Deucher, Alexander wrote:
>> -----Original Message-----
>> From: amd-gfx [mailto:amd-gfx-bounces at lists.freedesktop.org] On Behalf
>> Of Samuel Pitoiset
>> Sent: Monday, February 13, 2017 7:23 PM
>> To: amd-gfx at lists.freedesktop.org
>> Cc: StDenis, Tom; Samuel Pitoiset
>> Subject: [PATCH] drm/amdgpu: expose amdgpu_sensors on pre-powerplay
>> chips
>>
>> Totally untested but as long as read_sensor() has been recently
>> implemented for dpm based boards, amdgpu_sensors can now be
>> exposed.
>>
>> Cc: Tom St Denis <tom.stdenis at amd.com>
>> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
>> ---
>>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 5 +----
>>  1 file changed, 1 insertion(+), 4 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> index 6f021e70f15f..1a8e3b9a2268 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> @@ -3202,10 +3202,7 @@ static ssize_t
>> amdgpu_debugfs_sensor_read(struct file *f, char __user *buf,
>>  	idx = *pos >> 2;
>>
>>  	valuesize = sizeof(values);
>> -	if (adev->powerplay.pp_funcs && adev->powerplay.pp_funcs-
>>> read_sensor)
>> -		r = adev->powerplay.pp_funcs->read_sensor(adev-
>>> powerplay.pp_handle, idx, &values[0], &valuesize);
>> -	else
>> -		return -EINVAL;
>> +	r = amdgpu_dpm_read_sensor(adev, idx, &values[0], &valuesize);
>
> amdgpu_dpm is handled by both powerplay and non-powerplay so I think if we check for that here, we should be fine.  E.g.,
> if (amdgpu_dpm != 0)
>         r = amdgpu_dpm_read_sensor(adev, idx, &values[0], &valuesize);

And a similar fix in the DRM ioctl too I suppose.

Tom


More information about the amd-gfx mailing list