Thread (24 messages) flat view 24 messages, 4 authors, 2005-02-25

Re: Patch to add mode setting to sysfs

From: Antonino A. Daplas <hidden>
Date: 2005-02-17 13:50:33

On Thursday 17 February 2005 06:30, Jon Smirl wrote:
This is a first pass at adding two new sysfs attributes to
/sys/class/graphics/fb0 for setting modes. There are two attributes:
modes which contains a list of valid modes, and mode which is the
current mode. To switch modes echo one of the entries from the modes
list to the mode attribute.
The D,V,S on the modes represents Detailed, Vesa, Standard from the DDC
info.

modes is root writable. It can also be used to set the list of modes.
For example a /etc file could add modes that are not in the monitor's
DDC.

mode is user writable. PAM would set ownership of mode at user login
time. This provides a safe way  for a user to set the mode without
being root. You can only set the mode to one of the modes on the list.

If this code looks good I'll do another pass that adds some more
features and makes it more robust.
Looks very interesting, and I will try it soon.  A few comments:

+                       fb_videomode_to_var(&var, mode);
+                       var.activate |= FB_ACTIVATE_FORCE;
+                       var.bits_per_pixel = 32;

Instead of hardcoding some of the fields in var, why not
copy it from the current var?  Ie:

var = info->var;
fb_videomode_to_var(&var, mode);

Tony




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help