linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeremiah Mahler <jmmahler@gmail.com>
To: David Airlie <airlied@linux.ie>
Cc: Ben Skeggs <bskeggs@redhat.com>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Hans de Goede <hdegoede@redhat.com>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	Jeremiah Mahler <jmmahler@gmail.com>
Subject: [PATCH] nouveau: fix ambiguous backlight controls
Date: Fri, 26 Dec 2014 13:26:27 -0800	[thread overview]
Message-ID: <1419629187-13916-1-git-send-email-jmmahler@gmail.com> (raw)

If a display supports backlight control using the nouveau driver, and
also supports standard ACPI backlight control, there will be two sets of
controls.

/sys/class/backlight/acpi_video0
/sys/class/backlight/nv_backlight

This creates ambiguity because these controls can be out of sync with
each other.  One could be at 100% while the other is at 0% and the
actual display brightness depends on which one was used last.  This also
creates anomalies in Powertop which will show two values for brightness
with potentially different values.

Fix this ambiguity by having the nouveau driver only enable its
backlight controls if the standard ACPI controls are not present.

Signed-off-by: Jeremiah Mahler <jmmahler@gmail.com>
---
 drivers/gpu/drm/nouveau/nouveau_backlight.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/nouveau/nouveau_backlight.c b/drivers/gpu/drm/nouveau/nouveau_backlight.c
index e566c5b..3a52bd4 100644
--- a/drivers/gpu/drm/nouveau/nouveau_backlight.c
+++ b/drivers/gpu/drm/nouveau/nouveau_backlight.c
@@ -221,6 +221,11 @@ nouveau_backlight_init(struct drm_device *dev)
 	struct nvif_device *device = &drm->device;
 	struct drm_connector *connector;
 
+	if (acpi_video_backlight_support()) {
+		dev_info(dev->dev, "Standard ACPI backlight control supported, disabling local control.\n");
+		return 0;
+	}
+
 	list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
 		if (connector->connector_type != DRM_MODE_CONNECTOR_LVDS &&
 		    connector->connector_type != DRM_MODE_CONNECTOR_eDP)
-- 
2.1.4


             reply	other threads:[~2014-12-26 21:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-26 21:26 Jeremiah Mahler [this message]
2014-12-26 21:39 ` [PATCH] nouveau: fix ambiguous backlight controls Ilia Mirkin
2014-12-26 23:51   ` Jeremiah Mahler
2014-12-27 13:39     ` Hans de Goede
2014-12-28 14:30       ` Jeremiah Mahler
2014-12-28 14:54         ` Hans de Goede

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=1419629187-13916-1-git-send-email-jmmahler@gmail.com \
    --to=jmmahler@gmail.com \
    --cc=airlied@linux.ie \
    --cc=bskeggs@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hdegoede@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).