9b82ecd
Bugzilla: 1093171
9b82ecd
Upstream-status: Queued for 3.16
9b82ecd
9b82ecd
From abf17f7885656ccc181a608d2a9ee770b23d9e23 Mon Sep 17 00:00:00 2001
9b82ecd
From: Hans de Goede <hdegoede@redhat.com>
9b82ecd
Date: Mon, 2 Jun 2014 17:41:07 +0200
9b82ecd
Subject: [PATCH 10/14] nouveau: Don't check acpi_video_backlight_support()
9b82ecd
 before registering backlight
9b82ecd
9b82ecd
acpi_video_backlight_support() is supposed to be called by other (vendor
9b82ecd
specific) firmware backlight controls, not by native / raw backlight controls
9b82ecd
like nv_backlight.
9b82ecd
9b82ecd
Userspace will normally prefer firmware interfaces over raw interfaces, so
9b82ecd
if acpi_video backlight support is present it will use that even if
9b82ecd
nv_backlight is registered as well.
9b82ecd
9b82ecd
Except when video.use_native_backlight is present on the kernel cmdline
9b82ecd
(or enabled through a dmi based quirk). As the name indicates the goal here
9b82ecd
is to make only the raw interface available to userspace so that it will use
9b82ecd
that (it only does this when it sees a win8 compliant bios).
9b82ecd
9b82ecd
This is done by:
9b82ecd
1) Not registering any acpi_video# backlight devices; and
9b82ecd
2) Making acpi_video_backlight_support() return true so that other firmware
9b82ecd
drivers, ie acer_wmi, thinkpad_acpi, dell_laptop, etc. Don't register their
9b82ecd
own vender specific interfaces.
9b82ecd
9b82ecd
Currently nouveau breaks this setup, as when acpi_video_backlight_support()
9b82ecd
returns true, it does not register itself, resulting in no backlight control
9b82ecd
at all.
9b82ecd
9b82ecd
This is esp. going to be a problem with 3.16 which will default to
9b82ecd
video.use_native_backlight=1, and thus nouveau based laptops with a win8 bios
9b82ecd
will get no backlight control at all.
9b82ecd
9b82ecd
This also likely explains why the previous attempt to make
9b82ecd
video.use_native_backlight=1 the default was not a success, as without this
9b82ecd
patch having a default of video.use_native_backlight=1 will cause regressions.
9b82ecd
9b82ecd
Note this effectively reverts commit 5bead799
9b82ecd
9b82ecd
Also see: https://bugzilla.redhat.com/show_bug.cgi?id=1093171
9b82ecd
9b82ecd
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
9b82ecd
---
9b82ecd
 drivers/gpu/drm/nouveau/nouveau_backlight.c | 9 ---------
9b82ecd
 1 file changed, 9 deletions(-)
9b82ecd
9b82ecd
diff --git a/drivers/gpu/drm/nouveau/nouveau_backlight.c b/drivers/gpu/drm/nouveau/nouveau_backlight.c
9b82ecd
index 630f6e84fc01..2c1e4aad7da3 100644
9b82ecd
--- a/drivers/gpu/drm/nouveau/nouveau_backlight.c
9b82ecd
+++ b/drivers/gpu/drm/nouveau/nouveau_backlight.c
9b82ecd
@@ -31,7 +31,6 @@
9b82ecd
  */
9b82ecd
 
9b82ecd
 #include <linux/backlight.h>
9b82ecd
-#include <linux/acpi.h>
9b82ecd
 
9b82ecd
 #include "nouveau_drm.h"
9b82ecd
 #include "nouveau_reg.h"
9b82ecd
@@ -222,14 +221,6 @@ nouveau_backlight_init(struct drm_device *dev)
9b82ecd
 	struct nouveau_device *device = nv_device(drm->device);
9b82ecd
 	struct drm_connector *connector;
9b82ecd
 
9b82ecd
-#ifdef CONFIG_ACPI
9b82ecd
-	if (acpi_video_backlight_support()) {
9b82ecd
-		NV_INFO(drm, "ACPI backlight interface available, "
9b82ecd
-			     "not registering our own\n");
9b82ecd
-		return 0;
9b82ecd
-	}
9b82ecd
-#endif
9b82ecd
-
9b82ecd
 	list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
9b82ecd
 		if (connector->connector_type != DRM_MODE_CONNECTOR_LVDS &&
9b82ecd
 		    connector->connector_type != DRM_MODE_CONNECTOR_eDP)
9b82ecd
-- 
9b82ecd
1.9.0
9b82ecd