From patchwork Sat Jan 18 13:54:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Gnatenko X-Patchwork-Id: 3510491 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E92959F2D6 for ; Mon, 20 Jan 2014 01:48:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E2510200ED for ; Mon, 20 Jan 2014 01:48:49 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 8589F20122 for ; Mon, 20 Jan 2014 01:48:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5A3CDFA7C7; Sun, 19 Jan 2014 17:48:42 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com [209.85.217.169]) by gabe.freedesktop.org (Postfix) with ESMTP id B14DAFA5F4; Sat, 18 Jan 2014 05:54:22 -0800 (PST) Received: by mail-lb0-f169.google.com with SMTP id q8so3825354lbi.28 for ; Sat, 18 Jan 2014 05:54:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=NHZcHRXEMT2PhcCOZTjKdZngmRFywzLEQEmAlrvQ8BE=; b=HwQhb1eZdf0B3gHUhkmQLH9cxWONWBFFZb9ht2CZOUMzg/n8UcZmgMJr5GNwNWvWb0 Ix8fNCeSuMJcQ0thkfouzGYMZ3K2y4z5cItjd2IVo6ti0r6q35cUJZYik+82s68mVhbb daiPdbD/P2QmY1iQsuD3BYUENjhJ/styhAx0DrNePe19pvOJeMpf9wOeR8mx9Syy5ibA hiLCH5YTkvgS01MpBR4RwdQ/nuD4ke1kZR8Kp789S0eyYH1S/agbuNbTqjGh5eUh4XEa 0gZFEhqXkcipmjeF7VhG1GhJ9H7Q/Y5DITsqkVgv1vccgZPXWeDlZAaFRF/nVJAGptYe keuw== X-Received: by 10.152.115.130 with SMTP id jo2mr4612252lab.2.1390053259911; Sat, 18 Jan 2014 05:54:19 -0800 (PST) Received: from X1Carbon.localdomain (ppp91-76-53-153.pppoe.mtu-net.ru. [91.76.53.153]) by mx.google.com with ESMTPSA id t5sm986697lat.6.2014.01.18.05.54.16 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 18 Jan 2014 05:54:18 -0800 (PST) From: Igor Gnatenko To: linux-acpi@vger.kernel.org Subject: [PATCH v3] ACPI / video: Add systems that should favor native backlight interface Date: Sat, 18 Jan 2014 17:54:09 +0400 Message-Id: <1390053249-18919-1-git-send-email-i.gnatenko.brain@gmail.com> X-Mailer: git-send-email 1.8.4.2 X-Mailman-Approved-At: Sun, 19 Jan 2014 17:48:40 -0800 Cc: James Hogan , Mike Galbraith , dri-devel@lists.freedesktop.org, platform-driver-x86@vger.kernel.org, Henrique de Moraes Holschuh , Matthew Garrett , Kalle Valo , Yves-Alexis Perez , Martin Steigerwald , Lee Chun-Yi , Ben Jencks , =?UTF-8?q?J=C3=B6rg=20Otte?= , intel-gfx@lists.freedesktop.org, Kevin Smith , Rinat Ibragimov , Peter Weber , Joerg Platte , Seth Forshee , Igor Gnatenko , Lennart Poettering , Mika Westerberg , Aaron Lu , Theodore Tso , Kamal Mostafa , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, Richard Purdie , sov.info@mail.ru 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: , MIME-Version: 1.0 Sender: dri-devel-bounces@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 From: Aaron Lu 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/X1 Carbon, Lenovo Yoga 13, Dell Inspiron 7520, Acer Aspire 5733Z and HP ProBook 4340s 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 Reported-and-tested-by: Peter Weber Reference: https://bugzilla.kernel.org/show_bug.cgi?id=51231 Thinkpad X230: Reported-and-tested-by: Igor Gnatenko Reference: https://bugzilla.kernel.org/show_bug.cgi?id=51231 ThinkPad X1 Carbon: Reported-and-tested-by: Igor Gnatenko Lenovo Yoga 13: Reported-by: Lennart Poettering Reported-and-tested-by: Kevin Smith Reference: https://bugzilla.kernel.org/show_bug.cgi?id=63811 Dell Inspiron 7520: Reported-by: Rinat Ibragimov Acer Aspire 5733Z: Reported-by: Reference: https://bugzilla.kernel.org/show_bug.cgi?id=62941 HP ProBook 4340s: Reported-and-tested-by: Vladimir Sherenkov Reference: http://redmine.russianfedora.pro/issues/1258 Signed-off-by: Aaron Lu Signed-off-by: Igor Gnatenko --- drivers/acpi/blacklist.c | 8 ----- drivers/acpi/video.c | 81 ++++++++++++++++++++++++++++++++++++++++++--- drivers/acpi/video_detect.c | 8 ----- 3 files changed, 76 insertions(+), 21 deletions(-) diff --git a/drivers/acpi/blacklist.c b/drivers/acpi/blacklist.c index 078c4f7..2b6a76b 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 995e91b..2d2fb84 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,62 @@ 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 = "ThinkPad X1 Carbon", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X1 Carbon"), + }, + }, + { + .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"), + }, + }, + { + .callback = video_set_use_native_backlight, + .ident = "HP ProBook 4340s", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), + DMI_MATCH(DMI_PRODUCT_VERSION, "HP ProBook 4340s"), + }, + }, {} }; diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c index 84875fd..b639934 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"), - }, - }, { }, };