Received: by 10.192.165.148 with SMTP id m20csp820554imm; Fri, 27 Apr 2018 08:02:55 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr3Ch6kYPBIRRBq7PUb0DEOSjZS5Kza8keM5d5UR+L7ZyFlQyZqFqLgXL6Q+6ACVf0lmNyH X-Received: by 2002:a17:902:6bc1:: with SMTP id m1-v6mr2620223plt.91.1524841375329; Fri, 27 Apr 2018 08:02:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524841375; cv=none; d=google.com; s=arc-20160816; b=nJGr78L0b3qFeGrwy3APKdOX2Zz6uU8xWrN+yRlCPXlmJS8ezE1hM4mJKjGHPw6SY9 WX+4g89x6UKOuDfCfjwzQUTW2eFp7d+J7ga4Hb/Jf7wayLp8IPdxzXfZ/NVxvn+rGqvE DR70xtdLlZsEwENKaCPhsjBQCULze5rTABwsdankV47IKOAsvgWNr2otAF0v8uJuvHB5 63KxX8guBlImwMbqcVM8lK97PgOyRyDcNi3EuHO40Jm2bPrFgiqH0wan9f06xhoyk15o X917DkjifuuwVr6otTK1kk89q6kX95aPX3clZZT5/kC6QJ1Rg2ura36PwpaPwXAUDcF/ hzxg== 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=2l68avFnzBJA5vNU5fk+nFPo0bH0mxEt+tKWMCxvhmA=; b=w17i+xD7LO/DeSeWIimVLK9WbZKh07zlNHxFuxrYuTwY33ngSHucURaFbcQsZqafWO By8XKQkcuVMIOpBI+XM1lNiGL/xXwdU8ufOYo/1mMPMWzd2FU9aCs58L94cAzPHoi25I DN7wHJxuNhHpXmRW0nlI95QN3KcMNGgojaWSr80bIrehbmokoLuJhcnKTX9YP/85qndt pxwo5lbhqghn2A5FuHBKrmCijgcEUxB2aeKSTPGwxpAbL0FAGOmrEMMrbWPR5Tksg3Un Md5/y4LvayithPpi7XbdGl2OsjRUMI01bsvk1VDDHXtgh0XQJELK5vP09CN7rCjDlcwU EdSg== 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 w2-v6si1456834plz.226.2018.04.27.08.02.41; Fri, 27 Apr 2018 08:02:55 -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 S934135AbeD0PBK (ORCPT + 99 others); Fri, 27 Apr 2018 11:01:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:51834 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933952AbeD0OFi (ORCPT ); Fri, 27 Apr 2018 10:05:38 -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 7B20321890; Fri, 27 Apr 2018 14:05:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7B20321890 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.9 74/74] ACPI / video: Only default only_lcd to true on Win8-ready _desktops_ Date: Fri, 27 Apr 2018 15:59:04 +0200 Message-Id: <20180427135713.017836247@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180427135709.899303463@linuxfoundation.org> References: <20180427135709.899303463@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.9-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 @@ -2069,6 +2069,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; @@ -2089,8 +2108,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);