public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] video: always update the brightness when poking "brightness"
@ 2008-12-24  3:07 Zhang Rui
  2008-12-30 10:34 ` Richard Purdie
  0 siblings, 1 reply; 12+ messages in thread
From: Zhang Rui @ 2008-12-24  3:07 UTC (permalink / raw)
  To: rpurdie; +Cc: linux-acpi, Len Brown, Zhang, Rui

bd->props.brightness is a cached value.
the current code has some potential problems when poking the
backlight I/F.

For example,
1. set the brightness level to 5 via sysfs I/F
2. set the backlight to another level via the procfs,
3. setting it back to 5 doesn't work because bd->props.brightness
is still 5.

http://bugzilla.kernel.org/show_bug.cgi?id=12249

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
---
 drivers/video/backlight/backlight.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Index: linux-2.6/drivers/video/backlight/backlight.c
===================================================================
--- linux-2.6.orig/drivers/video/backlight/backlight.c
+++ linux-2.6/drivers/video/backlight/backlight.c
@@ -134,10 +134,8 @@ static ssize_t backlight_store_brightnes
 		else {
 			pr_debug("backlight: set brightness to %d\n",
 				 brightness);
-			if (bd->props.brightness != brightness) {
-				bd->props.brightness = brightness;
-				backlight_update_status(bd);
-			}
+			bd->props.brightness = brightness;
+			backlight_update_status(bd);
 			rc = count;
 		}
 	}



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2008-12-31 14:16 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-24  3:07 [PATCH 1/2] video: always update the brightness when poking "brightness" Zhang Rui
2008-12-30 10:34 ` Richard Purdie
2008-12-31  1:22   ` Zhao Yakui
2008-12-31  1:21     ` Matthew Garrett
2008-12-31  1:43   ` Zhang Rui
2008-12-31  2:01     ` Matthew Garrett
2008-12-31  2:58       ` Zhang Rui
2008-12-31  3:11         ` Zhang Rui
2008-12-31  3:24           ` Matthew Garrett
2008-12-31  3:14         ` Matthew Garrett
2008-12-31 13:41           ` Matthew Garrett
2008-12-31 14:16             ` Richard Purdie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox