Received: by 10.192.165.148 with SMTP id m20csp793926imm; Fri, 27 Apr 2018 07:37:24 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpEzQtJTy9gEa3zVZDE0rSE7hUgw1Ol+fN7w2eTirZ7YGKFFTYUfnsQJqgr2Y/YhyQYy6ed X-Received: by 2002:a17:902:9a8c:: with SMTP id w12-v6mr2566446plp.333.1524839844802; Fri, 27 Apr 2018 07:37:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524839844; cv=none; d=google.com; s=arc-20160816; b=DYUPckKS1FkWeaVSqoJmDdjQJyoo3uX6v65dIo+Kqh+aMSUHRNQmF/maLSdQxphnuy m40qL2I/SL+qOqE7CQtfX1slm0eAwTifi7L8pRqF6rl3UbdZYHp1ERzFuZFJjHaXhruu EFI0CsTnoSpVsZagJTkAmDejH34QLTT6k43pqnq1QMVYVSUG/QzRfac0NCZjGYk9+oyb OrecKeEWxkDR4cjHkNETc7FyY+FIX5xLSbJoltWanM8FUV//OrR5ATw0V6lpWif7vuPx uilTzX51eajEre2wDRuid3i1do14vQWvq27FvriDLiq2G1PY0JmvRNkJPTWGuSsutlZH 7clQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dmarc-filter :arc-authentication-results; bh=J9NaCfWMEwZSlM/EOV7al3z9T0ViHEzL0Hl+SXIStQ0=; b=FG4MVkJ7J7HCPyy4Sgo+jG5E4X90PybdvcNyp0pZttd+vuS8/buvxkc19D6gFx4phQ QP2ykfV81LlPiRPWQ0hW93M9jdS1+1IcKTNf1oaj1CsLTeThUGmZjFPMAA98fLhrZKdI cVbh9LQaYFQy8xgCnkkkga3S5Lzr0chODRYYiYmTZGDoDyib7yM1HDmBkNLPsX5pTZQE G+RGH7R9nOcrzRF+0n4b7ekUk3DW4FCauVWmkaG3XK+FazpqTV2DcOlVwsUVj2TJgRig wnfPjnPbnR6srVusSiFJxQvq18GqqUUW6l8HeCgRabENeZiUOXCzw5dLaHdi6I4I5Tw0 96Ow== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 72si1427812pfn.44.2018.04.27.07.37.10; Fri, 27 Apr 2018 07:37:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934708AbeD0OJh (ORCPT + 99 others); Fri, 27 Apr 2018 10:09:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:54804 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934679AbeD0OJ2 (ORCPT ); Fri, 27 Apr 2018 10:09:28 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 71C4621864; Fri, 27 Apr 2018 14:09:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 71C4621864 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hans de Goede , "Rafael J. Wysocki" Subject: [PATCH 4.14 80/80] ACPI / video: Only default only_lcd to true on Win8-ready _desktops_ Date: Fri, 27 Apr 2018 15:59:13 +0200 Message-Id: <20180427135737.079225306@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180427135732.928644313@linuxfoundation.org> References: <20180427135732.928644313@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Hans de Goede commit 53fa1f6e8a5958da698a31edf366ffe90596b490 upstream. Commit 5928c281524f (ACPI / video: Default lcd_only to true on Win8-ready and newer machines) made only_lcd default to true on all machines where acpi_osi_is_win8() returns true, including laptops. The purpose of this is to avoid the bogus / non-working acpi backlight interface which many newer BIOS-es define on desktop machines. But this is causing a regression on some laptops, specifically on the Dell XPS 13 2013 model, which does not have the LCD flag set for its fully functional ACPI backlight interface. Rather then DMI quirking our way out of this, this commits changes the logic for setting only_lcd to true, to only do this on machines with a desktop (or server) dmi chassis-type. Note that we cannot simply only check the chassis-type and not register the backlight interface based on that as there are some laptops and tablets which have their chassis-type set to "3" aka desktop. Hopefully the combination of checking the LCD flag, but only on devices with a desktop(ish) chassis-type will avoid the needs for DMI quirks for this, or at least limit the amount of DMI quirks which we need to a minimum. Fixes: 5928c281524f (ACPI / video: Default lcd_only to true on Win8-ready and newer machines) Reported-and-tested-by: James Hogan Signed-off-by: Hans de Goede Cc: 4.15+ # 4.15+ Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman --- drivers/acpi/acpi_video.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) --- a/drivers/acpi/acpi_video.c +++ b/drivers/acpi/acpi_video.c @@ -2123,6 +2123,25 @@ static int __init intel_opregion_present return opregion; } +static bool dmi_is_desktop(void) +{ + const char *chassis_type; + + chassis_type = dmi_get_system_info(DMI_CHASSIS_TYPE); + if (!chassis_type) + return false; + + if (!strcmp(chassis_type, "3") || /* 3: Desktop */ + !strcmp(chassis_type, "4") || /* 4: Low Profile Desktop */ + !strcmp(chassis_type, "5") || /* 5: Pizza Box */ + !strcmp(chassis_type, "6") || /* 6: Mini Tower */ + !strcmp(chassis_type, "7") || /* 7: Tower */ + !strcmp(chassis_type, "11")) /* 11: Main Server Chassis */ + return true; + + return false; +} + int acpi_video_register(void) { int ret = 0; @@ -2143,8 +2162,12 @@ int acpi_video_register(void) * win8 ready (where we also prefer the native backlight driver, so * normally the acpi_video code should not register there anyways). */ - if (only_lcd == -1) - only_lcd = acpi_osi_is_win8(); + if (only_lcd == -1) { + if (dmi_is_desktop() && acpi_osi_is_win8()) + only_lcd = true; + else + only_lcd = false; + } dmi_check_system(video_dmi_table);