All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>,
	Sam Ravnborg <sam@ravnborg.org>
Cc: Hans de Goede <hdegoede@redhat.com>, dri-devel@lists.freedesktop.org
Subject: [PATCH v2 3/5] drm/gma500: Use backlight_get_brightness() to get the brightness
Date: Sat, 17 Sep 2022 16:03:50 +0200	[thread overview]
Message-ID: <20220917140352.526507-4-hdegoede@redhat.com> (raw)
In-Reply-To: <20220917140352.526507-1-hdegoede@redhat.com>

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>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
Changes in v2 of the patch-set:
- New patch in v2 of the patch-set
---
 drivers/gpu/drm/gma500/backlight.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/gma500/backlight.c b/drivers/gpu/drm/gma500/backlight.c
index d113c5810ca5..9be28dc0bdd1 100644
--- a/drivers/gpu/drm/gma500/backlight.c
+++ b/drivers/gpu/drm/gma500/backlight.c
@@ -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)
-- 
2.37.3


  parent reply	other threads:[~2022-09-17 14:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-17 14:03 [PATCH v2 0/5] drm/gma500: Backlight handling changes Hans de Goede
2022-09-17 14:03 ` [PATCH v2 1/5] drm/gma500: Refactor backlight support Hans de Goede
2022-09-17 17:35   ` kernel test robot
2022-09-17 20:47     ` Hans de Goede
2022-09-17 20:47       ` Hans de Goede
2022-09-17 14:03 ` [PATCH v2 2/5] drm/gma500: Change registered backlight device type to raw/native Hans de Goede
2022-09-17 14:03 ` Hans de Goede [this message]
2022-09-17 20:46   ` [PATCH v2 3/5] drm/gma500: Use backlight_get_brightness() to get the brightness Sam Ravnborg
2022-09-17 21:00     ` Hans de Goede
2022-09-17 21:20       ` Sam Ravnborg
2022-09-17 14:03 ` [PATCH v2 4/5] drm/gma500: Don't register backlight when another backlight should be used Hans de Goede
2022-09-17 14:03 ` [PATCH v2 5/5] drm/gma500: Call acpi_video_register_backlight() Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220917140352.526507-4-hdegoede@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=patrik.r.jakobsson@gmail.com \
    --cc=sam@ravnborg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.