All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aaron Sowry <aaron+nv-+1tCnOwpXBmzQB+pC5nmwQ@public.gmane.org>
To: Ben Skeggs <skeggsb-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: nouveau exposes backlight controls in presence of	ACPI
Date: Tue, 2 Nov 2010 15:51:53 +0100	[thread overview]
Message-ID: <20101102145153.GA4075@aeneby.se> (raw)
In-Reply-To: <1288670315.6477.2.camel@nisroch>


[-- Attachment #1.1.1: Type: text/plain, Size: 1508 bytes --]

> However.  There's also the platform-specific modules (thinkpad etc) that
> will provide their own backlight methods if the standard ACPI mechanism
> isn't available.  I didn't see any immediately obvious way of knowing
> whether or not they were being provided.
> 
> I'm not too certain the best way to deal with this, any ideas? :)

See attached patch, which prevents nouveau registering a backlight control if ACPI already provides one. If there are no glaring errors in the code/implementation then I would like to submit it.

Dealing with platform-specific modules is tricky because it looks like nouveau initialises itself quite early on in the boot process:

[aaron@jules ~]$ dmesg | grep ACPI
...
[    3.359377] nouveau 0000:01:00.0: power state changed by ACPI to D0
[    3.359560] nouveau 0000:01:00.0: power state changed by ACPI to D0
[    4.860678] [drm] nouveau 0000:01:00.0: Detected ACPI backlight support, not registering control
[   14.206997] ACPI: WMI: Skipping duplicate GUID 05901221-D566-11D1-B2F0-00A0C9062910
[   14.207693] ACPI: WMI: Mapper loaded
[   17.686907] thinkpad_acpi: ThinkPad ACPI Extras v0.24
[   17.689517] thinkpad_acpi: This ThinkPad has standard ACPI backlight brightness control, supported by the ACPI video driver
[   17.756039] thinkpad_acpi: Standard ACPI backlight interface available, not loading native one.

My suggestion would be that it is the responsibility of user-space to select an appropriate ACPI backlight control.

/Aaron

[-- Attachment #1.1.2: nouveau_state.patch --]
[-- Type: text/x-diff, Size: 839 bytes --]

--- kernel-2.6.35.fc14.orig/drivers/gpu/drm/nouveau/nouveau_state.c	2010-11-02 13:04:25.433000083 +0100
+++ kernel-2.6.35.fc14.new/drivers/gpu/drm/nouveau/nouveau_state.c	2010-11-02 15:18:26.116693011 +0100
@@ -23,6 +23,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
+#include <linux/acpi.h>
 #include <linux/swab.h>
 #include <linux/slab.h>
 #include "drmP.h"
@@ -600,9 +601,13 @@ nouveau_card_init(struct drm_device *dev
 			goto out_irq;
 	}
 
+	if (acpi_video_backlight_support())
+		NV_INFO(dev, "Detected ACPI backlight support, not registering control\n");
+	else {
 	ret = nouveau_backlight_init(dev);
-	if (ret)
-		NV_ERROR(dev, "Error %d registering backlight\n", ret);
+		if (ret)
+			NV_ERROR(dev, "Error %d registering backlight\n", ret);
+	}
 
 	nouveau_fbcon_init(dev);
 	drm_kms_helper_poll_init(dev);

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 489 bytes --]

[-- Attachment #2: Type: text/plain, Size: 181 bytes --]

_______________________________________________
Nouveau mailing list
Nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
http://lists.freedesktop.org/mailman/listinfo/nouveau

  reply	other threads:[~2010-11-02 14:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-29 15:49 nouveau exposes backlight controls in presence of ACPI Aaron Sowry
     [not found] ` <20101029154934.GA2076-+1tCnOwpXBmzQB+pC5nmwQ@public.gmane.org>
2010-11-02  3:58   ` Ben Skeggs
2010-11-02 14:51     ` Aaron Sowry [this message]
     [not found]       ` <20101102145153.GA4075-+1tCnOwpXBmzQB+pC5nmwQ@public.gmane.org>
2010-11-02 22:37         ` Ben Skeggs
2010-11-02 16:37     ` Calvin Walton
2010-11-02 19:28       ` Aaron Sowry

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=20101102145153.GA4075@aeneby.se \
    --to=aaron+nv-+1tcnowpxbmzqb+pc5nmwq@public.gmane.org \
    --cc=nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=skeggsb-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.