drm/gma500: Call acpi_video_register_backlight()
authorHans de Goede <hdegoede@redhat.com>
Sat, 17 Sep 2022 20:59:20 +0000 (22:59 +0200)
committerHans de Goede <hdegoede@redhat.com>
Sun, 18 Sep 2022 19:03:21 +0000 (21:03 +0200)
commitc989a62484ad75e0a06f2ffe67886e7cb6d41659
treea9f3300918ff504b2835e4176e47d4ee5050a3cf
parenta7b98d4dfe68654641d56cdc7eace2c36be93a2d
drm/gma500: Call acpi_video_register_backlight()

On machines without an Intel video opregion the acpi_video driver
immediately probes the ACPI video bus and used to also immediately
register acpi_video# backlight devices when supported.

Once the drm/kms driver then loaded later and possibly registered
a native backlight device then the drivers/acpi/video_detect.c code
unregistered the acpi_video0 device to avoid there being 2 backlight
devices (when acpi_video_get_backlight_type()==native).

This means that userspace used to briefly see 2 devices and the
disappearing of acpi_video0 after a brief time confuses the systemd
backlight level save/restore code, see e.g.:
https://bbs.archlinux.org/viewtopic.php?id=269920

To fix this the ACPI video code has been modified to make backlight class
device registration a separate step, relying on the drm/kms driver to
ask for the acpi_video backlight registration after it is done setting up
its native backlight device.

Add a call to the new acpi_video_register_backlight() function after
setting up the gma500's native backlight, so that the acpi_video backlight
device gets registered on systems where the gma500's native backlight
device is not registered.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220917205920.647212-6-hdegoede@redhat.com
drivers/gpu/drm/gma500/psb_drv.c