Fix a regression in backlight interfaces for some laptops (rhbz 1571036)
This commit is contained in:
parent
0edfe4f286
commit
37525c2620
|
@ -0,0 +1,88 @@
|
|||
From patchwork Tue Apr 17 16:23:50 2018
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
Subject: ACPI / video: Only default only_lcd to true on Win8-ready _desktops_
|
||||
From: Hans de Goede <hdegoede@redhat.com>
|
||||
X-Patchwork-Id: 10345845
|
||||
Message-Id: <20180417162350.12227-1-hdegoede@redhat.com>
|
||||
To: "Rafael J . Wysocki" <rjw@rjwysocki.net>, Len Brown <lenb@kernel.org>
|
||||
Cc: Hans de Goede <hdegoede@redhat.com>,
|
||||
Zhang Rui <rui.zhang@intel.com>, linux-acpi@vger.kernel.org,
|
||||
James Hogan <jhogan@kernel.org>
|
||||
Date: Tue, 17 Apr 2018 18:23:50 +0200
|
||||
|
||||
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.
|
||||
|
||||
Cc: James Hogan <jhogan@kernel.org>
|
||||
Reported-and-tested-by: James Hogan <jhogan@kernel.org>
|
||||
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
||||
---
|
||||
drivers/acpi/acpi_video.c | 27 +++++++++++++++++++++++++--
|
||||
1 file changed, 25 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/acpi/acpi_video.c b/drivers/acpi/acpi_video.c
|
||||
index 76fb96966f7b..2f2e737be0f8 100644
|
||||
--- a/drivers/acpi/acpi_video.c
|
||||
+++ b/drivers/acpi/acpi_video.c
|
||||
@@ -2123,6 +2123,25 @@ static int __init intel_opregion_present(void)
|
||||
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);
|
||||
|
|
@ -663,6 +663,10 @@ Patch504: ipmi-fixes.patch
|
|||
# rhbz 1566510
|
||||
Patch505: net-Revert-macsec-missing-dev_put-on-error-in-macsec_newlink.patch
|
||||
|
||||
# rhbz 1571036
|
||||
# https://patchwork.kernel.org/patch/10345845/
|
||||
Patch506: ACPI-video-Only-default-only_lcd-to-true-on-Win8-ready-_desktops_.patch
|
||||
|
||||
# END OF PATCH DEFINITIONS
|
||||
|
||||
%endif
|
||||
|
@ -1915,6 +1919,9 @@ fi
|
|||
#
|
||||
#
|
||||
%changelog
|
||||
* Tue Apr 24 2018 Jeremy Cline <jeremy@jcline.org>
|
||||
- Fix a regression in backlight interfaces for some laptops (rhbz 1571036)
|
||||
|
||||
* Sun Apr 22 2018 Peter Robinson <pbrobinson@fedoraproject.org>
|
||||
- Add quirk patch to fix X-Gene 1 console on HP m400/Mustang (RHBZ 1531140)
|
||||
- Add fixes for Marvell a37xx EspressoBin
|
||||
|
|
Loading…
Reference in New Issue