Skip to content

Commit 53fa1f6

Browse files
jwrdegoederafaeljw
authored andcommitted
ACPI / video: Only default only_lcd to true on Win8-ready _desktops_
Commit 5928c28 (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: 5928c28 (ACPI / video: Default lcd_only to true on Win8-ready and newer machines) Reported-and-tested-by: James Hogan <jhogan@kernel.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Cc: 4.15+ <stable@vger.kernel.org> # 4.15+ Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 6d08b06 commit 53fa1f6

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

drivers/acpi/acpi_video.c

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2123,6 +2123,25 @@ static int __init intel_opregion_present(void)
21232123
return opregion;
21242124
}
21252125

2126+
static bool dmi_is_desktop(void)
2127+
{
2128+
const char *chassis_type;
2129+
2130+
chassis_type = dmi_get_system_info(DMI_CHASSIS_TYPE);
2131+
if (!chassis_type)
2132+
return false;
2133+
2134+
if (!strcmp(chassis_type, "3") || /* 3: Desktop */
2135+
!strcmp(chassis_type, "4") || /* 4: Low Profile Desktop */
2136+
!strcmp(chassis_type, "5") || /* 5: Pizza Box */
2137+
!strcmp(chassis_type, "6") || /* 6: Mini Tower */
2138+
!strcmp(chassis_type, "7") || /* 7: Tower */
2139+
!strcmp(chassis_type, "11")) /* 11: Main Server Chassis */
2140+
return true;
2141+
2142+
return false;
2143+
}
2144+
21262145
int acpi_video_register(void)
21272146
{
21282147
int ret = 0;
@@ -2143,8 +2162,12 @@ int acpi_video_register(void)
21432162
* win8 ready (where we also prefer the native backlight driver, so
21442163
* normally the acpi_video code should not register there anyways).
21452164
*/
2146-
if (only_lcd == -1)
2147-
only_lcd = acpi_osi_is_win8();
2165+
if (only_lcd == -1) {
2166+
if (dmi_is_desktop() && acpi_osi_is_win8())
2167+
only_lcd = true;
2168+
else
2169+
only_lcd = false;
2170+
}
21482171

21492172
dmi_check_system(video_dmi_table);
21502173

0 commit comments

Comments
 (0)