public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Richard Purdie <rpurdie@rpsys.net>
To: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: Zhang Rui <rui.zhang@intel.com>,
	linux-acpi <linux-acpi@vger.kernel.org>,
	Len Brown <lenb@kernel.org>
Subject: Re: [PATCH 1/2] video: always update the brightness when poking "brightness"
Date: Wed, 31 Dec 2008 14:16:00 +0000	[thread overview]
Message-ID: <1230732960.5325.10.camel@dax.rpnet.com> (raw)
In-Reply-To: <20081231134116.GA31733@srcf.ucam.org>

On Wed, 2008-12-31 at 13:41 +0000, Matthew Garrett wrote:
> Richard, how about something like this? If the hardware changes the 
> state of the backlight behind us, the current code may make it 
> impossible to set it back to the previous state without resynchronising 
> the value first. Is there any currently supported hardware where this 
> would be a sufficiently expensive or disruptive operation to warrant the 
> check?

I'll accept that argument. It is an expensive operation on some hardware
but that path already has sysfs writes etc. so it doesn't really matter.
If it really bothers some hardware they can make the check in the driver
I guess.

I'll be sorting out the backlight tree in the next day or so and will
queue something like this for merging.

Cheers,

Richard


> diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c
> index fab0bc8..064b428 100644
> --- a/drivers/video/backlight/backlight.c
> +++ b/drivers/video/backlight/backlight.c
> @@ -134,10 +134,8 @@ static ssize_t backlight_store_brightness(struct device *dev,
>  		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;
>  		}
>  	}
> 
-- 
Richard Purdie
Intel Open Source Technology Centre


      reply	other threads:[~2008-12-31 14:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

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=1230732960.5325.10.camel@dax.rpnet.com \
    --to=rpurdie@rpsys.net \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=mjg59@srcf.ucam.org \
    --cc=rui.zhang@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox