Skip to content

Commit

Permalink
drm/i915: Don't register backlight when another backlight should be u…
Browse files Browse the repository at this point in the history
…sed (v2)

Before this commit when we want userspace to use the acpi_video backlight
device we register both the GPU's native backlight device and acpi_video's
firmware acpi_video# backlight device. This relies on userspace preferring
firmware type backlight devices over native ones.

Registering 2 backlight devices for a single display really is
undesirable, don't register the GPU's native backlight device when
another backlight device should be used.

Changes in v2:
- Use drm_info(drm_dev,  ...) for log messages

Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
  • Loading branch information
Hans de Goede committed Aug 25, 2022
1 parent 2600bfa commit b1d36e7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/gpu/drm/i915/display/intel_backlight.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#include <linux/pwm.h>
#include <linux/string_helpers.h>

#include <acpi/video.h>

#include "intel_backlight.h"
#include "intel_connector.h"
#include "intel_de.h"
Expand Down Expand Up @@ -950,6 +952,11 @@ int intel_backlight_device_register(struct intel_connector *connector)

WARN_ON(panel->backlight.max == 0);

if (!acpi_video_backlight_use_native()) {
drm_info(&i915->drm, "Skipping intel_backlight registration\n");
return 0;
}

memset(&props, 0, sizeof(props));
props.type = BACKLIGHT_RAW;

Expand Down

0 comments on commit b1d36e7

Please sign in to comment.