platform/x86: acer-wmi: Move backlight DMI quirks to acpi/video_detect.c
authorHans de Goede <hdegoede@redhat.com>
Sat, 4 Jun 2022 16:28:52 +0000 (18:28 +0200)
committerHans de Goede <hdegoede@redhat.com>
Sat, 3 Sep 2022 10:17:27 +0000 (12:17 +0200)
commit0172df18dc4309a7052cbb37a6939f7a8b0735d5
tree99c51f7d80386ff5fa30db66f917a1d14db1b061
parenta2ed70d0ecb11b7eb3ff14ed897cd0995c86651d
platform/x86: acer-wmi: Move backlight DMI quirks to acpi/video_detect.c

Move the backlight DMI quirks to acpi/video_detect.c, so that
the driver no longer needs to call acpi_video_set_dmi_backlight_type().

acpi_video_set_dmi_backlight_type() is troublesome because it may end up
getting called after other backlight drivers have already called
acpi_video_get_backlight_type() resulting in the other drivers
already being registered even though they should not.

Note that even though the DMI quirk table name was video_vendor_dmi_table,
5/6 quirks were actually quirks to use the GPU native backlight.

These 5 quirks also had a callback in their dmi_system_id entry which
disabled the acer-wmi vendor driver; and any DMI match resulted in:

acpi_video_set_dmi_backlight_type(acpi_backlight_vendor);

which disabled the acpi_video driver, so only the native driver was left.
The new entries for these 5/6 devices correctly marks these as needing
the native backlight driver.

Also note that other changes in this series change the native backlight
drivers to no longer unconditionally register their backlight. Instead
these drivers now do this check:

if (acpi_video_get_backlight_type(false) != acpi_backlight_native)
return 0; /* bail */

which without this patch would have broken these 5/6 "special" quirks.

Since I had to look at all the commits adding the quirks anyways, to make
sure that I understood the code correctly, I've also added links to
the various original bugzillas for these quirks to the new entries.

Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/acpi/video_detect.c
drivers/platform/x86/acer-wmi.c