mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Aaron Sowry <aaron@aeneby.se>
To: airlied@linux.ie
Cc: linux-kernel@vger.kernel.org, nouveau@lists.freedesktop.org
Subject: [PATCH] nouveau: Don't expose backlight control in presence of ACPI
Date: Wed, 3 Nov 2010 11:12:29 +0100	[thread overview]
Message-ID: <20101103101229.GA4523@aeneby.se> (raw)

[-- Attachment #1: Type: text/plain, Size: 1229 bytes --]

From: Aaron Sowry <aaron@aeneby.se>

Avoid confusing userspace by not publishing backlight controls if ACPI equivalents are available.
Signed-off-by: Aaron Sowry <aaron@aeneby.se>
---
--- linux-2.6/drivers/gpu/drm/nouveau/nouveau_state.c.orig      2010-11-03 09:56:29.502828966 +0100
+++ linux-2.6/drivers/gpu/drm/nouveau/nouveau_state.c   2010-11-03 10:46:27.765829000 +0100
@@ -23,6 +23,7 @@
  * DEALINGS IN THE SOFTWARE.
  */

+#include <linux/acpi.h>
 #include <linux/swab.h>
 #include <linux/slab.h>
 #include "drmP.h"
@@ -648,9 +649,14 @@ nouveau_card_init(struct drm_device *dev
                        goto out_fence;
        }

-       ret = nouveau_backlight_init(dev);
-       if (ret)
-               NV_ERROR(dev, "Error %d registering backlight\n", ret);
+       if (acpi_video_backlight_support())
+               NV_INFO(dev, "Detected ACPI backlight support, "
+                               "not registering interface\n");
+       else {
+               ret = nouveau_backlight_init(dev);
+               if (ret)
+                       NV_ERROR(dev, "Error %d registering backlight\n", ret);
+       }

        nouveau_fbcon_init(dev);
        drm_kms_helper_poll_init(dev);

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

             reply	other threads:[~2010-11-03 10:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-03 10:12 Aaron Sowry [this message]
2010-11-03 23:59 ` [Nouveau] " Ben Skeggs

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=20101103101229.GA4523@aeneby.se \
    --to=aaron@aeneby.se \
    --cc=airlied@linux.ie \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nouveau@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

Powered by JetHome