drm/gma500: Use backlight_get_brightness() to get the brightness
authorHans de Goede <hdegoede@redhat.com>
Sat, 17 Sep 2022 20:59:18 +0000 (22:59 +0200)
committerHans de Goede <hdegoede@redhat.com>
Sun, 18 Sep 2022 19:03:10 +0000 (21:03 +0200)
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: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
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-4-hdegoede@redhat.com
drivers/gpu/drm/gma500/backlight.c

index 5a40414e574820580774f81f3fe3322bf4775d36..e85fd181f2f367944f04c0f8929e0e72743c0a4d 100644 (file)
@@ -52,7 +52,7 @@ static int gma_backlight_get_brightness(struct backlight_device *bd)
 static int gma_backlight_update_status(struct backlight_device *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 */
        if (level < 1)