Skip to content

Commit fb1836c

Browse files
jwrdegoederafaeljw
authored andcommitted
ACPI: video: Prefer native over vendor
When available prefer native backlight control over vendor backlight control. Testing has shown that there are quite a few laptop models which rely on native backlight control (they don't have ACPI video bus backlight control) and on which acpi_osi_is_win8() returns false. Currently __acpi_video_get_backlight_type() returns vendor on these laptops, leading to an empty /sys/class/backlight. As a workaround for this acpi_video_backlight_use_native() has been temporarily changed to always return true. This re-introduces the problem of having multiple backlight devices under /sys/class/backlight for a single panel. Change __acpi_video_get_backlight_type() to prefer native over vendor when available. So that it returns native on these models. And change acpi_video_backlight_use_native() back to only return true when __acpi_video_get_backlight_type() returns native. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent a5df425 commit fb1836c

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

drivers/acpi/video_detect.c

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -776,10 +776,10 @@ static enum acpi_backlight_type __acpi_video_get_backlight_type(bool native)
776776
return acpi_backlight_video;
777777

778778
/* Use native if available */
779-
if (native_available && prefer_native_over_acpi_video())
779+
if (native_available)
780780
return acpi_backlight_native;
781781

782-
/* No ACPI video (old hw), use vendor specific fw methods. */
782+
/* No ACPI video/native (old hw), use vendor specific fw methods. */
783783
return acpi_backlight_vendor;
784784
}
785785

@@ -791,18 +791,6 @@ EXPORT_SYMBOL(acpi_video_get_backlight_type);
791791

792792
bool acpi_video_backlight_use_native(void)
793793
{
794-
/*
795-
* Call __acpi_video_get_backlight_type() to let it know that
796-
* a native backlight is available.
797-
*/
798-
__acpi_video_get_backlight_type(true);
799-
800-
/*
801-
* For now just always return true. There is a whole bunch of laptop
802-
* models where (video_caps & ACPI_VIDEO_BACKLIGHT) is false causing
803-
* __acpi_video_get_backlight_type() to return vendor, while these
804-
* models only have a native backlight control.
805-
*/
806-
return true;
794+
return __acpi_video_get_backlight_type(true) == acpi_backlight_native;
807795
}
808796
EXPORT_SYMBOL(acpi_video_backlight_use_native);

0 commit comments

Comments
 (0)