public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nouveau: fix ambiguous backlight controls
@ 2014-12-26 21:26 Jeremiah Mahler
  2014-12-26 21:39 ` Ilia Mirkin
  0 siblings, 1 reply; 6+ messages in thread
From: Jeremiah Mahler @ 2014-12-26 21:26 UTC (permalink / raw)
  To: David Airlie
  Cc: Ben Skeggs, Rafael J. Wysocki, Hans de Goede, dri-devel,
	linux-kernel, Jeremiah Mahler

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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-12-28 14:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-26 21:26 [PATCH] nouveau: fix ambiguous backlight controls Jeremiah Mahler
2014-12-26 21:39 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox