All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Purdie <rpurdie@rpsys.net>
To: Jiri Kosina <jikos@jikos.cz>
Cc: Henrique de Moraes Holschuh <hmh@hmh.eng.br>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ACPI: ibm-acpi: improve backlight power handling (v2)
Date: Mon, 26 Feb 2007 21:42:01 +0000	[thread overview]
Message-ID: <1172526121.24429.15.camel@localhost.localdomain> (raw)
In-Reply-To: <Pine.LNX.4.64.0702262217490.10496@twin.jikos.cz>

On Mon, 2007-02-26 at 22:25 +0100, Jiri Kosina wrote:
> On Mon, 26 Feb 2007, Henrique de Moraes Holschuh wrote:
> 
> >  static int brightness_update_status(struct backlight_device *bd)
> >  {
> > -	return brightness_set(bd->props.brightness);
> > +	return brightness_set(
> > +		(bd->props.fb_blank == FB_BLANK_UNBLANK &&
> > +		 bd->props.power == FB_BLANK_UNBLANK) ?
> > +				bd->props.brightness : 0);
> >  }
> 
> Are you sure about the '&&'? The original patch I submitted to you earlier 
> today was checking for (bd->props.fb_blank == FB_BLANK_UNBLANK || 
> bd->props.power == FB_BLANK_UNBLANK), and I tested it (to some extent) and 
> it worked well - no sudden unblanking without reason, no blinking, etc.
> 
> I also think that common sense implies that the condition should be 
> logical or - backlight layer could request blanking without requesting 
> powering the device off, right? We want to handle unblanking from such 
> situation properly, which doesn't necessairly mean we will get 
> bd->props.power == FB_BLANK_UNBLANK, right?

In the above context, && is correct, || isn't.

We want to blank (set to 0) if either fb_blank or power isn't set to
FB_BLANK_UNBLANK. This is the same as setting to brightness if both
fb_blank and power are set to FB_BLANK_UNBLANK. This is what the above
expression does.

Richard


  reply	other threads:[~2007-02-26 21:42 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-26  0:59 2.6.21-rc1 dims my LCD Jiri Kosina
2007-02-26 11:41 ` Richard Purdie
2007-02-26 12:35   ` Jiri Kosina
2007-02-26 14:21     ` Henrique de Moraes Holschuh
2007-02-26 14:49       ` Richard Purdie
2007-02-26 15:20         ` Henrique de Moraes Holschuh
2007-02-26 16:12           ` [PATCH] ACPI: ibm-acpi: improve backlight power handling Henrique de Moraes Holschuh
2007-02-26 16:38             ` Richard Purdie
2007-02-26 18:12               ` Henrique de Moraes Holschuh
2007-02-26 18:26                 ` [PATCH] ACPI: ibm-acpi: improve backlight power handling (v2) Henrique de Moraes Holschuh
2007-02-26 21:25                   ` Jiri Kosina
2007-02-26 21:42                     ` Richard Purdie [this message]
2007-02-26 21:46                       ` Henrique de Moraes Holschuh
2007-02-26 21:53                   ` Richard Purdie
2007-02-26 17:21             ` [PATCH] ACPI: ibm-acpi: improve backlight power handling Jiri Kosina
2007-02-26 18:17               ` Henrique de Moraes Holschuh
2007-02-26 15:24         ` 2.6.21-rc1 dims my LCD Jiri Kosina
2007-02-26 15:43           ` Richard Purdie
2007-02-26 15:43             ` Richard Purdie
2007-02-26 17:13             ` Antonino A. Daplas
2007-02-26 17:13               ` [Linux-fbdev-devel] " Antonino A. Daplas
2007-02-26 16:03           ` Henrique de Moraes Holschuh
2007-02-26 17:01             ` Richard Purdie

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=1172526121.24429.15.camel@localhost.localdomain \
    --to=rpurdie@rpsys.net \
    --cc=hmh@hmh.eng.br \
    --cc=jikos@jikos.cz \
    --cc=linux-kernel@vger.kernel.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.