linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Aaron Lu <aaron.lu@intel.com>
To: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Cc: "James Hogan" <james@albanarts.com>,
	"Mike Galbraith" <bitbucket@online.de>,
	"Felipe Contreras" <felipe.contreras@gmail.com>,
	dri-devel@lists.freedesktop.org,
	platform-driver-x86@vger.kernel.org,
	"Henrique de Moraes Holschuh" <hmh@hmh.eng.br>,
	"Matthew Garrett" <matthew.garrett@nebula.com>,
	linux-acpi@vger.kernel.org, "Kalle Valo" <kvalo@adurom.com>,
	"Yves-Alexis Perez" <corsac@debian.org>,
	"Martin Steigerwald" <Martin@lichtvoll.de>,
	"Lee Chun-Yi" <joeyli.kernel@gmail.com>,
	"Ben Jencks" <ben@bjencks.net>, "Jörg Otte" <jrg.otte@gmail.com>,
	intel-gfx@lists.freedesktop.org,
	"Kevin Smith" <thirdwiggin@gmail.com>,
	"Peter Weber" <bugs@ttyhoney.com>,
	"Joerg Platte" <jplatte@naasa.net>,
	"Seth Forshee" <seth.forshee@canonical.com>,
	"Lennart Poettering" <lennart@poettering.net>,
	"Mika Westerberg" <mika.westerberg@linux.intel.com>,
	"Theodore Tso" <tytso@mit.edu>,
	"Rafael J. Wysocki" <rjw@rjwysock>
Subject: [PATCH v2 rebased] ACPI / video: Add systems that should favor native backlight interface
Date: Thu, 21 Nov 2013 13:29:09 +0800	[thread overview]
Message-ID: <528D9A25.6040503@intel.com> (raw)
In-Reply-To: <1384980982.3487.3.camel@ThinkPad-X230.localdomain>

On 11/21/2013 04:56 AM, Igor Gnatenko wrote:
> Any news here? If no - I think we need re-send patch as new..

Since the v2 patch can't apply cleanly on top of pm's -next tree, I
think it's worth a re-send, so here it comes.

---
Subject: [PATCH] ACPI / video: Add systems that should favor native backlight
 interface
From: Aaron Lu <aaron.lu@intel.com>
Date: Thu, 21 Nov 2013 11:24:48 +0800

Some system's ACPI video backlight control interface is broken and the
native backlight control interface should be used by default. This patch
sets the use_native_backlight parameter to true for those systems so
that video backlight control interface will not be created. To be
specific, the ThinkPad T430s/X230, Lenovo Yoga 13, Dell Inspiron 7520
and Acer Aspire 5733Z are added here, if they appear in some other DMI
table before, they are removed from there.

Note that the user specified kernel cmdline option will always have the
highest priority, i.e. if use_native_backlight=0 is specified and the
system is in the DMI table, the video module will not skip registering
backlight interface for it.

Thinkpad T430s:
Reported-by: Theodore Tso <tytso@mit.edu>
Reported-and-tested-by: Peter Weber <bugs@ttyhoney.com>
Reference: https://bugzilla.kernel.org/show_bug.cgi?id=51231
Thinkpad X230:
Reported-and-tested-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Reference: https://bugzilla.kernel.org/show_bug.cgi?id=51231
Lenovo Yoga 13:
Reported-by: Lennart Poettering <lennart@poettering.net>
Reported-and-tested-by: Kevin Smith <thirdwiggin@gmail.com>
Reference: https://bugzilla.kernel.org/show_bug.cgi?id=63811
Dell Inspiron 7520:
Reported-by: Rinat Ibragimov <ibragimovrinat@mail.ru>
Acer Aspire 5733Z:
Reported-by: <sov.info@mail.ru>
Reference: https://bugzilla.kernel.org/show_bug.cgi?id=62941

Signed-off-by: Aaron Lu <aaron.lu@intel.com>
---
 drivers/acpi/blacklist.c    |  8 ------
 drivers/acpi/video.c        | 65 +++++++++++++++++++++++++++++++++++++++++----
 drivers/acpi/video_detect.c |  8 ------
 3 files changed, 60 insertions(+), 21 deletions(-)

diff --git a/drivers/acpi/blacklist.c b/drivers/acpi/blacklist.c
index 078c4f7fe2dd..2b6a76b6d59a 100644
--- a/drivers/acpi/blacklist.c
+++ b/drivers/acpi/blacklist.c
@@ -261,14 +261,6 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = {
 	},
 	{
 	.callback = dmi_disable_osi_win8,
-	.ident = "Dell Inspiron 15R SE",
-	.matches = {
-		     DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-		     DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 7520"),
-		},
-	},
-	{
-	.callback = dmi_disable_osi_win8,
 	.ident = "ThinkPad Edge E530",
 	.matches = {
 		     DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 995e91bcb97b..7dc6071a04b6 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -82,11 +82,12 @@ static bool allow_duplicates;
 module_param(allow_duplicates, bool, 0644);
 
 /*
- * For Windows 8 systems: if set ture and the GPU driver has
- * registered a backlight interface, skip registering ACPI video's.
+ * For Windows 8 systems: used to decide if video module
+ * should skip registering backlight interface of its own.
  */
-static bool use_native_backlight = false;
-module_param(use_native_backlight, bool, 0644);
+static int use_native_backlight_param = -1;
+module_param_named(use_native_backlight, use_native_backlight_param, int, 0444);
+static bool use_native_backlight_dmi = false;
 
 static int register_count;
 static struct mutex video_list_lock;
@@ -232,9 +233,17 @@ static int acpi_video_get_next_level(struct acpi_video_device *device,
 static int acpi_video_switch_brightness(struct acpi_video_device *device,
 					 int event);
 
+static bool acpi_video_use_native_backlight(void)
+{
+	if (use_native_backlight_param != -1)
+		return use_native_backlight_param;
+	else
+		return use_native_backlight_dmi;
+}
+
 static bool acpi_video_verify_backlight_support(void)
 {
-	if (acpi_osi_is_win8() && use_native_backlight &&
+	if (acpi_osi_is_win8() && acpi_video_use_native_backlight() &&
 	    backlight_device_registered(BACKLIGHT_RAW))
 		return false;
 	return acpi_video_backlight_support();
@@ -399,6 +408,12 @@ static int __init video_set_bqc_offset(const struct dmi_system_id *d)
 	return 0;
 }
 
+static int __init video_set_use_native_backlight(const struct dmi_system_id *d)
+{
+	use_native_backlight_dmi = true;
+	return 0;
+}
+
 static struct dmi_system_id video_dmi_table[] __initdata = {
 	/*
 	 * Broken _BQC workaround http://bugzilla.kernel.org/show_bug.cgi?id=13121
@@ -443,6 +458,46 @@ static struct dmi_system_id video_dmi_table[] __initdata = {
 		DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 7720"),
 		},
 	},
+	{
+	 .callback = video_set_use_native_backlight,
+	 .ident = "ThinkPad T430s",
+	 .matches = {
+		DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+		DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T430s"),
+		},
+	},
+	{
+	 .callback = video_set_use_native_backlight,
+	 .ident = "ThinkPad X230",
+	 .matches = {
+		DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+		DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X230"),
+		},
+	},
+	{
+	 .callback = video_set_use_native_backlight,
+	 .ident = "Lenovo Yoga 13",
+	 .matches = {
+		 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+		 DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo IdeaPad Yoga 13"),
+		},
+	},
+	{
+	 .callback = video_set_use_native_backlight,
+	 .ident = "Dell Inspiron 7520",
+	 .matches = {
+		 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+		 DMI_MATCH(DMI_PRODUCT_VERSION, "Inspiron 7520"),
+		},
+	},
+	{
+	 .callback = video_set_use_native_backlight,
+	 .ident = "Acer Aspire 5733Z",
+	 .matches = {
+		 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
+		 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5733Z"),
+		},
+	},
 	{}
 };
 
diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c
index 84875fd4c74f..b6399343de51 100644
--- a/drivers/acpi/video_detect.c
+++ b/drivers/acpi/video_detect.c
@@ -168,14 +168,6 @@ static struct dmi_system_id video_detect_dmi_table[] = {
 		DMI_MATCH(DMI_PRODUCT_NAME, "UL30A"),
 		},
 	},
-	{
-	.callback = video_detect_force_vendor,
-	.ident = "Lenovo Yoga 13",
-	.matches = {
-		DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
-		DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo IdeaPad Yoga 13"),
-		},
-	},
 	{ },
 };
 
-- 
1.8.3.1

  reply	other threads:[~2013-11-21  5:29 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-11 13:27 [PATCH v5 0/4] Fix Win8 backlight issue Aaron Lu
2013-10-11 13:27 ` [PATCH v5 1/4] backlight: introduce backlight_device_registered Aaron Lu
2013-10-11 13:27 ` [PATCH v5 2/4] ACPI / video: seperate backlight control and event interface Aaron Lu
2013-10-11 13:27 ` [PATCH v5 3/4] ACPI / video: Do not register backlight if win8 and native interface exists Aaron Lu
2013-10-11 13:27 ` [PATCH v5 4/4] thinkpad-acpi: fix handle locate for video and query of _BCL Aaron Lu
2013-10-11 16:42 ` [PATCH v5 0/4] Fix Win8 backlight issue Josh Boyer
2013-10-11 21:01   ` Igor Gnatenko
2013-10-11 22:10   ` Rafael J. Wysocki
2013-10-11 22:01     ` Josh Boyer
2013-10-11 22:45       ` Rafael J. Wysocki
2013-10-11 22:53         ` Igor Gnatenko
2013-10-11 23:10           ` Rafael J. Wysocki
2013-10-11 23:27       ` Rafael J. Wysocki
2013-10-12  5:54         ` Yves-Alexis Perez
2013-10-12 14:10           ` Rafael J. Wysocki
2013-10-12 11:44         ` Josh Boyer
2013-10-12 13:34           ` Seth Forshee
2013-10-12 14:08             ` Rafael J. Wysocki
2013-10-12  6:00     ` Yves-Alexis Perez
2013-10-12 11:47       ` Josh Boyer
2013-10-15 23:33 ` Rafael J. Wysocki
2013-10-24  8:13   ` Aaron Lu
2013-10-25  6:35     ` Igor Gnatenko
2013-10-28  2:45       ` Aaron Lu
2013-10-28  8:09         ` Jani Nikula
2013-10-29  7:18           ` Aaron Lu
2013-11-15  6:07             ` [PATCH v2] ACPI / video: Add systems that should favor native backlight interface Aaron Lu
2013-11-20 20:56               ` Igor Gnatenko
2013-11-21  5:29                 ` Aaron Lu [this message]
2013-12-24 12:20                   ` [PATCH v2 rebased] " Igor Gnatenko
2013-12-24 13:59                   ` Igor Gnatenko
2013-10-30  0:40   ` [PATCH v5 0/4] Fix Win8 backlight issue Matthew Garrett
2013-10-30  0:56     ` Rafael J. Wysocki

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=528D9A25.6040503@intel.com \
    --to=aaron.lu@intel.com \
    --cc=Martin@lichtvoll.de \
    --cc=ben@bjencks.net \
    --cc=bitbucket@online.de \
    --cc=bugs@ttyhoney.com \
    --cc=corsac@debian.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=felipe.contreras@gmail.com \
    --cc=hmh@hmh.eng.br \
    --cc=i.gnatenko.brain@gmail.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=james@albanarts.com \
    --cc=joeyli.kernel@gmail.com \
    --cc=jplatte@naasa.net \
    --cc=jrg.otte@gmail.com \
    --cc=kvalo@adurom.com \
    --cc=lennart@poettering.net \
    --cc=linux-acpi@vger.kernel.org \
    --cc=matthew.garrett@nebula.com \
    --cc=mika.westerberg@linux.intel.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rjw@rjwysock \
    --cc=seth.forshee@canonical.com \
    --cc=thirdwiggin@gmail.com \
    --cc=tytso@mit.edu \
    /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).