Commit fbf30934 authored by Hans de Goede's avatar Hans de Goede

drm/gma500: Use backlight_get_brightness() to get the brightness

Use backlight_get_brightness() instead of directly referencing
bd->props.brightness. This will take backlight_is_blank() into account,
properly setting brightness to 0 when screen-blanking has been requested
through the backlight sysfs interface.
Suggested-by: default avatarSam Ravnborg <sam@ravnborg.org>
Acked-by: default avatarSam Ravnborg <sam@ravnborg.org>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Acked-by: default avatarPatrik Jakobsson <patrik.r.jakobsson@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220917205920.647212-4-hdegoede@redhat.com
parent dec4ddbe
...@@ -52,7 +52,7 @@ static int gma_backlight_get_brightness(struct backlight_device *bd) ...@@ -52,7 +52,7 @@ static int gma_backlight_get_brightness(struct backlight_device *bd)
static int gma_backlight_update_status(struct backlight_device *bd) static int gma_backlight_update_status(struct backlight_device *bd)
{ {
struct drm_device *dev = bl_get_data(bd); struct drm_device *dev = bl_get_data(bd);
int level = bd->props.brightness; int level = backlight_get_brightness(bd);
/* Percentage 1-100% being valid */ /* Percentage 1-100% being valid */
if (level < 1) if (level < 1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment