From patchwork Mon Dec 17 22:48:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Martin Peres X-Patchwork-Id: 1889191 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 92A8FDF266 for ; Mon, 17 Dec 2012 22:49:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 54FB5E5DE9 for ; Mon, 17 Dec 2012 14:49:08 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from smtp6-g21.free.fr (smtp6-g21.free.fr [212.27.42.6]) by gabe.freedesktop.org (Postfix) with ESMTP id DF505E5C5C for ; Mon, 17 Dec 2012 14:48:53 -0800 (PST) Received: from [192.168.1.101] (unknown [89.159.199.232]) (Authenticated sender: martin.peres) by smtp6-g21.free.fr (Postfix) with ESMTPA id 3D988822B7; Mon, 17 Dec 2012 23:48:47 +0100 (CET) Message-ID: <50CFA14D.4000703@free.fr> Date: Mon, 17 Dec 2012 23:48:45 +0100 From: Martin Peres User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: =?UTF-8?B?T3phbiDDh2HEn2xheWFu?= Subject: Re: Fan control in nouveau driver with geforce 9600gt References: <50CE791A.4040801@free.fr> In-Reply-To: Cc: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org 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 From 0227e8a93c697c325fb89b31b16aa5fe565c64d5 Mon Sep 17 00:00:00 2001 From: Martin Peres 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 --- 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