Skip to content

Commit e506731

Browse files
jwrdegoederafaeljw
authored andcommitted
ACPI: video: Make acpi_backlight=video work independent from GPU driver
Commit 3dbc80a ("ACPI: video: Make backlight class device registration a separate step (v2)") combined with commit 5aa9d94 ("ACPI: video: Don't enable fallback path for creating ACPI backlight by default") Means that the video.ko code now fully depends on the GPU driver calling acpi_video_register_backlight() for the acpi_video# backlight class devices to get registered. This means that if the GPU driver does not do this, acpi_backlight=video on the cmdline, or DMI quirks for selecting acpi_video# will not work. This is a problem on for example Apple iMac14,1 all-in-ones where the monitor's LCD panel shows up as a regular DP connection instead of eDP so the GPU driver will not call acpi_video_register_backlight() [1]. Fix this by making video.ko directly register the acpi_video# devices when these have been explicitly requested either on the cmdline or through DMI quirks (rather then auto-detection being used). [1] GPU drivers only call acpi_video_register_backlight() when an internal panel is detected, to avoid non working acpi_video# devices getting registered on desktops which unfortunately is a real issue. Fixes: 5aa9d94 ("ACPI: video: Don't enable fallback path for creating ACPI backlight by default") Cc: All applicable <[email protected]> Reviewed-by: Mario Limonciello <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 78dfc9d commit e506731

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

drivers/acpi/acpi_video.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1984,6 +1984,7 @@ static int instance;
19841984
static int acpi_video_bus_add(struct acpi_device *device)
19851985
{
19861986
struct acpi_video_bus *video;
1987+
bool auto_detect;
19871988
int error;
19881989
acpi_status status;
19891990

@@ -2045,10 +2046,20 @@ static int acpi_video_bus_add(struct acpi_device *device)
20452046
mutex_unlock(&video_list_lock);
20462047

20472048
/*
2048-
* The userspace visible backlight_device gets registered separately
2049-
* from acpi_video_register_backlight().
2049+
* If backlight-type auto-detection is used then a native backlight may
2050+
* show up later and this may change the result from video to native.
2051+
* Therefor normally the userspace visible /sys/class/backlight device
2052+
* gets registered separately by the GPU driver calling
2053+
* acpi_video_register_backlight() when an internal panel is detected.
2054+
* Register the backlight now when not using auto-detection, so that
2055+
* when the kernel cmdline or DMI-quirks are used the backlight will
2056+
* get registered even if acpi_video_register_backlight() is not called.
20502057
*/
20512058
acpi_video_run_bcl_for_osi(video);
2059+
if (__acpi_video_get_backlight_type(false, &auto_detect) == acpi_backlight_video &&
2060+
!auto_detect)
2061+
acpi_video_bus_register_backlight(video);
2062+
20522063
acpi_video_bus_add_notify_handler(video);
20532064

20542065
return 0;

0 commit comments

Comments
 (0)