linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RFC: Backlight Class sysfs attribute behaviour
@ 2006-03-05 15:08 Richard Purdie
  2006-03-05 22:09 ` Andrew Zabolotny
  2006-03-06  1:00 ` Antonino A. Daplas
  0 siblings, 2 replies; 10+ messages in thread
From: Richard Purdie @ 2006-03-05 15:08 UTC (permalink / raw)
  To: Antonino A. Daplas, Linux Fbdev development list,
	Andrew Zabolotny; +Cc: LKML

At present, the backlight class presents two attributes to sysfs,
brightness and power. I'm a little confused as to whether these
attributes are currently doing the right things.

Taking brightness, at any one time we have several different brightness
values:

* User requested brightness (echo y > /sys/class/backlight/xxx/brightness)
* Driver determined brightness which accounts for things like FB 
  blanking, low battery backlight limiting (an example from corgi_bl), 
  user requested power state, device suspend/resume.

The solution might be to have brightness always return the user
requested value y and have a new attribute returning the brightness as
determined by the driver once it accounts for all the factors it needs
to consider. Naming of such an attribute is tricky - "driver_brightness"
perthaps?

The same problem applies to the power attribute. This could easily
confused with the other forms of power attribute in sysfs but ignoring
that, should this report:

* The last user requested power state
* The current power state accounting for FB blanking.
* The current power state for device suspend/resume

Should the FB blanking override the user requested values? At the moment
it only does unless a user changes an attributes whilst the display is
blanked in which case the user's change overrides. This could be classed
as a bug but solving it as straight forward as it sounds using only the
existing backlight class functions.

Also, at the moment this attribute reports VESA power states which can
be confusing (0 = on, [1-3] = off).

Again, the solution would appear to be to return the last user requested
power state. The driver_brightness attribute would tell you if the
display was blanked for any other reason (although not why).

I have various patches that implement these changes but before I finish
them, does anyone have an views on what the correct behaviour should be?

Richard

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

end of thread, other threads:[~2006-03-08  9:48 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).