From: Martin Peres <martin.peres@free.fr>
To: Alex Deucher <alexdeucher@gmail.com>
Cc: Maling list - DRI developers <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH] drm/radeon: use 0-255 rather than 0-100 for pwm fan range
Date: Wed, 15 Apr 2015 00:19:16 +0300 [thread overview]
Message-ID: <552D8454.7040400@free.fr> (raw)
In-Reply-To: <CADnq5_NQN7fhdbdE2pK1yFqbqsBpAQ2tMnWogsNQvC3qb2zOtA@mail.gmail.com>
On 13/04/2015 02:42, Alex Deucher wrote:
> On Sat, Apr 11, 2015 at 5:52 AM, Martin Peres <martin.peres@free.fr> wrote:
>> On 05/02/2015 11:49, Christian König wrote:
>>> Am 04.02.2015 um 23:27 schrieb Alex Deucher:
>>>> 0-255 seems to be the preferred range for the pwm interface.
>>>>
>>>> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
>>> Yeah, using 100 on a 8bit pwm timer sounds rather obviously wrong.
>>>
>>> Patch is Reviewed-by: Christian König <christian.koenig@amd.com>
>>>
>>>> ---
>>>> drivers/gpu/drm/radeon/radeon_pm.c | 8 ++++++--
>>>> 1 file changed, 6 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/drivers/gpu/drm/radeon/radeon_pm.c
>>>> b/drivers/gpu/drm/radeon/radeon_pm.c
>>>> index 91e1bd2..9f758d3 100644
>>>> --- a/drivers/gpu/drm/radeon/radeon_pm.c
>>>> +++ b/drivers/gpu/drm/radeon/radeon_pm.c
>>>> @@ -585,7 +585,7 @@ static ssize_t radeon_hwmon_set_pwm1_enable(struct
>>>> device *dev,
>>>> if (err)
>>>> return err;
>>>> - switch(value) {
>>>> + switch (value) {
>>>> case 1: /* manual, percent-based */
>>>> rdev->asic->dpm.fan_ctrl_set_mode(rdev,
>>>> FDO_PWM_MODE_STATIC);
>>>> break;
>>>> @@ -608,7 +608,7 @@ static ssize_t radeon_hwmon_get_pwm1_max(struct
>>>> device *dev,
>>>> struct device_attribute *attr,
>>>> char *buf)
>>>> {
>>>> - return sprintf(buf, "%i\n", 100); /* pwm uses percent-based
>>>> fan-control */
>>>> + return sprintf(buf, "%i\n", 255);
>>>> }
>>
>> This is not a standard name as it is not documented in
>> https://www.kernel.org/doc/Documentation/hwmon/sysfs-interface
>>
>> Apparently, the pwm value should always have been exposed as 0-255 and I
>> screwed it up in nouveau by having it be 0-100...
>>
>> Maybe we should ask pwm*_max to be defined so as new applications could do
>> the right thing while not having nouveau change its ABI. I guess it is ok to
>> change it for radeon as there are so few users currently but the interface
>> has been in nouveau for multiple years already!
>>
> IIRC, I changed it in the same kernel as the original patch went in.
>
> Alex
Wonderful!
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
prev parent reply other threads:[~2015-04-14 21:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-04 22:27 [PATCH] drm/radeon: use 0-255 rather than 0-100 for pwm fan range Alex Deucher
2015-02-05 9:49 ` Christian König
2015-04-11 9:52 ` Martin Peres
2015-04-12 23:42 ` Alex Deucher
2015-04-14 21:19 ` Martin Peres [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=552D8454.7040400@free.fr \
--to=martin.peres@free.fr \
--cc=alexdeucher@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox