From patchwork Thu Oct 24 08:13:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Lu X-Patchwork-Id: 3094381 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B194ABF924 for ; Fri, 25 Oct 2013 06:53:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5A037203EC for ; Fri, 25 Oct 2013 06:53:04 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 5194B20378 for ; Fri, 25 Oct 2013 06:53:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3C6F9E7F36 for ; Thu, 24 Oct 2013 23:53:03 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 934FEE5C95; Thu, 24 Oct 2013 01:13:10 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 24 Oct 2013 01:09:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.93,535,1378882800"; d="scan'208";a="397745468" Received: from aaronlu.sh.intel.com ([10.239.37.146]) by orsmga001.jf.intel.com with ESMTP; 24 Oct 2013 01:13:05 -0700 Message-ID: <5268D6BB.3010207@intel.com> Date: Thu, 24 Oct 2013 16:13:47 +0800 From: Aaron Lu Organization: Intel, Shanghai, PRC MIME-Version: 1.0 To: "Rafael J. Wysocki" Subject: Re: [PATCH v5 0/4] Fix Win8 backlight issue References: <1381498066-16011-1-git-send-email-aaron.lu@intel.com> <2140073.U60XyxRqVZ@vostro.rjw.lan> In-Reply-To: <2140073.U60XyxRqVZ@vostro.rjw.lan> X-Mailman-Approved-At: Thu, 24 Oct 2013 23:43:49 -0700 Cc: James Hogan , Martin Steigerwald , dri-devel@lists.freedesktop.org, platform-driver-x86@vger.kernel.org, Henrique de Moraes Holschuh , Matthew Garrett , linux-acpi@vger.kernel.org, Kalle Valo , Yves-Alexis Perez , Mike Galbraith , Lee Chun-Yi , Ben Jencks , =?UTF-8?B?SsO2cmcgT3R0ZQ==?= , intel-gfx@lists.freedesktop.org, Peter Weber , Joerg Platte , Seth Forshee , Igor Gnatenko , Lennart Poettering , Mika Westerberg , Theodore Tso , Kamal Mostafa , linux-kernel@vger.kernel.org, Richard Purdie X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 10/16/2013 07:33 AM, Rafael J. Wysocki wrote: > On Friday, October 11, 2013 09:27:42 PM Aaron Lu wrote: >> v5: >> 1 Introduce video.use_native_backlight module parameter and set its >> value to false by default as suggested by Rafael. For Win8 systems >> which have broken ACPI video backlight control, the parameter can be >> set to 1 in kernel cmdline to skip registering ACPI video's backlight >> interface. Due to this change, the acpi_video_verify_backlight_support >> is moved from video_detect.c to video.c - patch 3/4; >> 2 Rename bd_list_head and bd_list_mutex in backlight.c to >> backlight_dev_list and backlight_dev_list_mutex as suggested by Rafael >> - patch 1/4. >> >> v4: >> Remove decleration and stub for acpi_video_unregister_backlight in >> video.h of patch 2/4 since that function doesn't exist anymore in v3. >> >> v3: >> 1 Add a new patch 4/4 to fix some problems in thinkpad-acpi module; >> 2 Remove unnecessary function acpi_video_unregister_backlight introduced >> in patch 2/4 as pointed out by Jani Nikula. >> >> v2: >> v1 has the subject of "Rework ACPI video driver" and is posted here: >> http://lkml.org/lkml/2013/9/9/74 >> Since the objective is really to fix Win8 backlight issues, I changed >> the subject in this version, sorry about that. >> >> This patchset has four patches, the first introduced a new API named >> backlight_device_registered in backlight layer that can be used for >> backlight interface provider module to check if a specific type backlight >> interface has been registered, see changelog for patch 1/4 for details. >> Then patch 2/4 does the cleanup to sepeate the backlight control and >> event delivery functionality in the ACPI video module and patch 3/4 >> solves some Win8 backlight control problems by avoiding register ACPI >> video's backlight interface if: >> 1 Kernel cmdline option acpi_backlight=video is not given; >> 2 This is a Win8 system; >> 3 Native backlight control interface exists. >> Patch 4/4 fixes some problems in thinkpad-acpi module. >> >> Technically, patch 2/4 is not required to fix the issue here. So if you >> think it is not necessary, I can remove it from the series. >> >> Aaron Lu (4): >> backlight: introduce backlight_device_registered >> ACPI / video: seperate backlight control and event interface >> ACPI / video: Do not register backlight if win8 and native interface >> exists >> thinkpad-acpi: fix handle locate for video and query of _BCL >> >> drivers/acpi/internal.h | 4 +- >> drivers/acpi/video.c | 457 ++++++++++++++++++++--------------- >> drivers/acpi/video_detect.c | 4 +- >> drivers/platform/x86/thinkpad_acpi.c | 31 ++- >> drivers/video/backlight/backlight.c | 31 +++ >> include/linux/backlight.h | 4 + >> 6 files changed, 326 insertions(+), 205 deletions(-) > > I've added this series to my queue for 3.13. > > Since the next step will be to introduce a list of systems that need > video.use_native_backlight=1 *and* don't break in that configuration, I don't > see much point adding another Kconfig option for the default. > > Hopefully, in the future we'll be able to fix the problems causing > video.use_native_backlight=1 to fail of the systems where it fails and then > we'll be able to make that the default behavior and drop the option altogether. I've prepared a patch(at the end of the mail) to set use_native_backlight by default for some systems. There are 3 systems currently that I'm kind of sure that should be added: The ThinkPad T430s and X230 is: Reported-by: Theodore Tso Reported-and-tested-by: Peter Weber Reported-by: Igor Gnatenko Reference: https://bugzilla.kernel.org/show_bug.cgi?id=51231 The Lenovo Yoga is: Reported-by: Lennart Poettering Reference: https://lkml.org/lkml/2013/10/13/178 From: Aaron Lu Subject: [PATCH] ACPI / video: Add systems that should favor native backlight interface 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 clear, the ThinkPad T430s/X230 and Lenovo Yoga 13 are added here. Reported-by: Theodore Tso Reported-and-tested-by: Peter Weber Reported-by: Lennart Poettering Reported-by: Igor Gnatenko Signed-off-by: Aaron Lu --- drivers/acpi/video.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index d020df5..9a80a94 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c @@ -412,6 +412,12 @@ static int video_ignore_initial_backlight(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 = true; + return 0; +} + static struct dmi_system_id video_dmi_table[] __initdata = { /* * Broken _BQC workaround http://bugzilla.kernel.org/show_bug.cgi?id=13121 @@ -504,6 +510,30 @@ static struct dmi_system_id video_dmi_table[] __initdata = { DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion m4 Notebook PC"), }, }, + { + .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"), + }, + }, {} };