diff options
author | Hans de Goede <hdegoede@redhat.com> | 2022-04-28 18:41:46 +0300 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2022-09-02 10:57:14 +0300 |
commit | 3dbc80a3e4c55c4a5b89ef207bed7b7de36157b4 (patch) | |
tree | b046fbf0214b2962fe207b30d806c418546157cd /drivers/xen/pcpu.c | |
parent | 038a8191ae7a636586a4415b001cece831ab7019 (diff) | |
download | linux-3dbc80a3e4c55c4a5b89ef207bed7b7de36157b4.tar.xz |
ACPI: video: Make backlight class device registration a separate step (v2)
On x86/ACPI boards the acpi_video driver will usually initialize before
the kms driver (except i915). This causes /sys/class/backlight/acpi_video0
to show up and then the kms driver registers its own native backlight
device after which the drivers/acpi/video_detect.c code unregisters
the acpi_video0 device (when acpi_video_get_backlight_type()==native).
This means that userspace briefly sees 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 make backlight class device registration a separate step
done by a new acpi_video_register_backlight() function. The intend is for
this to be called by the drm/kms driver *after* it is done setting up its
own native backlight device. So that acpi_video_get_backlight_type() knows
if a native backlight will be available or not at acpi_video backlight
registration time, avoiding the add + remove dance.
Note the new acpi_video_register_backlight() function is also called from
a delayed work to ensure that the acpi_video backlight devices does get
registered if necessary even if there is no drm/kms driver or when it is
disabled.
Changes in v2:
- Make register_backlight_delay a module parameter, mainly so that it can
be disabled by Nvidia binary driver users
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/xen/pcpu.c')
0 files changed, 0 insertions, 0 deletions