From: Richard Purdie <rpurdie@rpsys.net>
To: "Antonino A. Daplas" <adaplas@gmail.com>
Cc: Linux Fbdev development list
<linux-fbdev-devel@lists.sourceforge.net>,
Andrew Zabolotny <zap@homelink.ru>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: RFC: Backlight Class sysfs attribute behaviour
Date: Mon, 06 Mar 2006 08:45:28 +0000 [thread overview]
Message-ID: <1141634729.6524.14.camel@localhost.localdomain> (raw)
In-Reply-To: <440B89AB.3020203@gmail.com>
On Mon, 2006-03-06 at 09:00 +0800, Antonino A. Daplas wrote:
> Why not just agree on a normal range of values (ie, 0-255), and let the
> driver "denormalize" them? Thus, a driver that has only 2 levels of
> brightness, will treat 0-127 as 0 and 128-255 as 1, and will return only
> two possible values 0 and 255.
>
> If a user requests max brightness (255), and the driver is capable of setting
> it, then it returns 255. But if for some reason it can't (ie low power state),
> it returns the current max brightness, normalized, (ie 128 instead of 255 and
> because that the scale is 0-255, a value of 128 tells the user that only
> half of max brightness was set).
We already have a max_brightness attribute and brightness can vary
between 0 and max_brightness (hence avoiding scaling issues which we
leave to userspace).
> And instead of a new "driver_brightness" attribute, why not just a new
> attribute that returns the number of brightness levels?
The idea of the driver_brightness attribute is to separate the user
requested brightness value from the actual brightness value decided by
the driver. The driver determines the real brightness by combining:
* the user supplied power sysfs attribute
* the user supplied brightness sysfs attribute
* the current FB blanking state
* any other driver specific factors
At present, the user specified values through the sysfs attributes can
easily get lost as other factors overwrite it (FB blanking overwrites
user specified power for example). This leads to a class interface with
unpredictable behaviour.
I'm therefore suggesting separation of the values so each attribute
reads and writes in a predicable manner and the actual state determined
by the driver becomes a new readonly sysfs attribute
("driver_brightness" although I'm open to suggestions of a better name).
Richard
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
next prev parent reply other threads:[~2006-03-06 8:45 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-05 15:08 RFC: Backlight Class sysfs attribute behaviour Richard Purdie
2006-03-05 22:09 ` Andrew Zabolotny
2006-03-06 0:08 ` Richard Purdie
2006-03-06 21:47 ` Pavel Machek
2006-03-06 1:00 ` Antonino A. Daplas
2006-03-06 8:45 ` Richard Purdie [this message]
2006-03-06 21:07 ` Andrew Zabolotny
2006-03-06 23:05 ` Richard Purdie
2006-03-08 9:48 ` Andrew Zabolotny
2006-03-06 21:44 ` Pavel Machek
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=1141634729.6524.14.camel@localhost.localdomain \
--to=rpurdie@rpsys.net \
--cc=adaplas@gmail.com \
--cc=linux-fbdev-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=zap@homelink.ru \
/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;
as well as URLs for NNTP newsgroup(s).