diff mbox

Fan control in nouveau driver with geforce 9600gt

Message ID 50CFA14D.4000703@free.fr (mailing list archive)
State New, archived
Headers show

Commit Message

Martin Peres Dec. 17, 2012, 10:48 p.m. UTC
On 17/12/2012 13:35, Ozan Ça?layan wrote:
>> Hi Ozan,
>>
>> Please have a look at this documentation:
>> http://cgit.freedesktop.org/nouveau/linux-2.6/tree/Documentation/thermal/nouveau_thermal
>> It will tell you how to use fan management on your card :)
>>
>> Please report back! I am interested in your results!
>>
>> Martin
> Hey this is nice! I'll try it tonight when I'm back home.
>
> Thanks :)
>
Here you go :)

I managed to reproduce the issue. Please test this patch!

Thanks for reporting,
Martin

Comments

Ozan Ça?layan Dec. 19, 2012, 7:39 p.m. UTC | #1
> Here you go :)
>
> I managed to reproduce the issue. Please test this patch!

Okay switching to automatic mode when pwm1 == 100 now gradually (in a
few seconds, it is not cut down to 35 suddenly) lowers it down to 35.
Switching to automatic mode while in manual mode doesn't make the pwm
increase until 100.

It seems okay I think.

(Another point,

Shouldn't we expect that the pwm is set to full power back again when
I disable thermal management? Currently when I echo 0 to pwm1_enable,
the fan power stays the same, e.g. 35 for example.)

You can add a <Tested-by> for me for a future reference.

Thanks!
Ozan Ça?layan
Martin Peres Dec. 20, 2012, 12:27 a.m. UTC | #2
On 19/12/2012 20:39, Ozan Ça?layan wrote:
>> Here you go :)
>>
>> I managed to reproduce the issue. Please test this patch!
> Okay switching to automatic mode when pwm1 == 100 now gradually (in a
> few seconds, it is not cut down to 35 suddenly) lowers it down to 35.
> Switching to automatic mode while in manual mode doesn't make the pwm
> increase until 100.
Yep, exactly what I meant to :)
> It seems okay I think.
>
> (Another point,
>
> Shouldn't we expect that the pwm is set to full power back again when
> I disable thermal management? Currently when I echo 0 to pwm1_enable,
> the fan power stays the same, e.g. 35 for example.)
So, we had some discussions within the nouveau community about
this and we decided that 0 would mean, no updates on the current status.

Anything against it?
>
> You can add a <Tested-by> for me for a future reference.
Sure, let me send a pull-request to the nouveau maintainer then :)
>
> Thanks!
> Ozan Ça?layan
Thanks for your testing and feedback!

Martin
Ozan Ça?layan Dec. 20, 2012, 1:07 p.m. UTC | #3
> So, we had some discussions within the nouveau community about
> this and we decided that 0 would mean, no updates on the current status.
>
> Anything against it?

So if I switch automatic mode on and then disable it then do some heavy GPU
processing, the fan power will stay at what it was in the low-load
state, am I wrong?
Isn't this dangerous?
Martin Peres Dec. 20, 2012, 6:33 p.m. UTC | #4
Le 20/12/2012 14:07, Ozan Ça?layan a écrit :
>> So, we had some discussions within the nouveau community about
>> this and we decided that 0 would mean, no updates on the current status.
>>
>> Anything against it?
> So if I switch automatic mode on and then disable it then do some heavy GPU
> processing, the fan power will stay at what it was in the low-load
> state, am I wrong?
> Isn't this dangerous?
Of course it is, but why would you disable automatic fan management?

You are supposed to activate it and let it activated at all time.
Ozan Ça?layan Dec. 21, 2012, 12:04 p.m. UTC | #5
> Of course it is, but why would you disable automatic fan management?
>
> You are supposed to activate it and let it activated at all time.

It's not me but someone inexperienced playing with sysfs tunables for example :)
Martin Peres Dec. 21, 2012, 11:43 p.m. UTC | #6
On 21/12/2012 13:04, Ozan Ça?layan wrote:
>> Of course it is, but why would you disable automatic fan management?
>>
>> You are supposed to activate it and let it activated at all time.
> It's not me but someone inexperienced playing with sysfs tunables for example :)

Ah, sure. Well, there is documentation. And it isn't more dangerous than 
the current situation (always disabled).

We will be waiting a until one kernel is released before activating fan 
management by default.
Ozan Ça?layan Jan. 7, 2013, 4:25 p.m. UTC | #7
> We will be waiting a until one kernel is released before activating fan
> management by default.

So these fan stuff will be merged into 3.9?
Martin Peres Jan. 14, 2013, 2:12 p.m. UTC | #8
Le 07/01/2013 17:25, Ozan Ça?layan a écrit :
>> We will be waiting a until one kernel is released before activating fan
>> management by default.
> So these fan stuff will be merged into 3.9?
Yeah, quite likely :)

I see no reasons for us not to. So far, all bugs have been fixed.
diff mbox

Patch

From 0227e8a93c697c325fb89b31b16aa5fe565c64d5 Mon Sep 17 00:00:00 2001
From: Martin Peres <martin.peres@labri.fr>
Date: Mon, 17 Dec 2012 23:46:22 +0100
Subject: [PATCH] drm/nouveau/fan: handle the cases where we are outside of the
 linear zone

Signed-off-by: Martin Peres <martin.peres@labri.fr>
---
 drivers/gpu/drm/nouveau/core/subdev/therm/base.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/nouveau/core/subdev/therm/base.c b/drivers/gpu/drm/nouveau/core/subdev/therm/base.c
index b35b4a2..25b7f6a 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/therm/base.c
+++ b/drivers/gpu/drm/nouveau/core/subdev/therm/base.c
@@ -71,6 +71,13 @@  nouveau_therm_update_linear(struct nouveau_therm *therm)
 	u8  temp = therm->temp_get(therm);
 	u16 duty;
 
+	/* handle the non-linear part first */
+	if (temp < linear_min_temp)
+		return priv->fan->bios.min_duty;
+	else if (temp > linear_max_temp)
+		return priv->fan->bios.max_duty;
+
+	/* we are in the linear zone */
 	duty  = (temp - linear_min_temp);
 	duty *= (priv->fan->bios.max_duty - priv->fan->bios.min_duty);
 	duty /= (linear_max_temp - linear_min_temp);
-- 
1.8.0.2