summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2022-09-17 22:59:19 +0200
committerHans de Goede <hdegoede@redhat.com>2022-09-18 21:03:17 +0200
commita7b98d4dfe68654641d56cdc7eace2c36be93a2d (patch)
tree9b343621da1ea2b949101b8470fc676f3a52e070
parentfbf3093466d05461e3f307ffe6b1150daa4b065b (diff)
downloadlinux-a7b98d4dfe68654641d56cdc7eace2c36be93a2d.tar.bz2
drm/gma500: Don't register backlight when another backlight should be used
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. 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-5-hdegoede@redhat.com
-rw-r--r--drivers/gpu/drm/gma500/backlight.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/drm/gma500/backlight.c b/drivers/gpu/drm/gma500/backlight.c
index e85fd181f2f3..577a4987b193 100644
--- a/drivers/gpu/drm/gma500/backlight.c
+++ b/drivers/gpu/drm/gma500/backlight.c
@@ -7,6 +7,8 @@
* Authors: Eric Knopp
*/
+#include <acpi/video.h>
+
#include "psb_drv.h"
#include "psb_intel_reg.h"
#include "psb_intel_drv.h"
@@ -80,6 +82,12 @@ int gma_backlight_init(struct drm_device *dev)
if (ret)
return ret;
+ if (!acpi_video_backlight_use_native()) {
+ drm_info(dev, "Skipping %s backlight registration\n",
+ dev_priv->ops->backlight_name);
+ return 0;
+ }
+
#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
props.brightness = dev_priv->backlight_level;
props.max_brightness = PSB_MAX_BRIGHTNESS;