Skip to content

Commit 00a7341

Browse files
superm1rafaeljw
authored andcommitted
ACPI: video: Allow GPU drivers to report no panels
The current logic for the ACPI backlight detection will create a backlight device if no native or vendor drivers have created 8 seconds after the system has booted if the ACPI tables included backlight control methods. If the GPU drivers have loaded, they may be able to report whether any LCD panels were found. Allow using this information to factor in whether to enable the fallback logic for making an acpi_video0 backlight device. Suggested-by: Hans de Goede <[email protected]> Signed-off-by: Mario Limonciello <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 057b40f commit 00a7341

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

drivers/acpi/acpi_video.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2176,6 +2176,17 @@ static bool should_check_lcd_flag(void)
21762176
return false;
21772177
}
21782178

2179+
/*
2180+
* At least one graphics driver has reported that no LCD is connected
2181+
* via the native interface. cancel the registration for fallback acpi_video0.
2182+
* If another driver still deems this necessary, it can explicitly register it.
2183+
*/
2184+
void acpi_video_report_nolcd(void)
2185+
{
2186+
cancel_delayed_work(&video_bus_register_backlight_work);
2187+
}
2188+
EXPORT_SYMBOL(acpi_video_report_nolcd);
2189+
21792190
int acpi_video_register(void)
21802191
{
21812192
int ret = 0;

include/acpi/video.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ enum acpi_backlight_type {
5353
};
5454

5555
#if IS_ENABLED(CONFIG_ACPI_VIDEO)
56+
extern void acpi_video_report_nolcd(void);
5657
extern int acpi_video_register(void);
5758
extern void acpi_video_unregister(void);
5859
extern void acpi_video_register_backlight(void);
@@ -69,6 +70,7 @@ extern int acpi_video_get_levels(struct acpi_device *device,
6970
struct acpi_video_device_brightness **dev_br,
7071
int *pmax_level);
7172
#else
73+
static inline void acpi_video_report_nolcd(void) { return; };
7274
static inline int acpi_video_register(void) { return -ENODEV; }
7375
static inline void acpi_video_unregister(void) { return; }
7476
static inline void acpi_video_register_backlight(void) { return; }

0 commit comments

Comments
 (0)