linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Antonino A. Daplas" <adaplas@hotpop.com>
To: Kronos <kronos@people.it>, linux-fbdev-devel@lists.sourceforge.net
Subject: Re: [PATCH][RFC][0/3] mode attribute in sysfs tree
Date: Wed, 16 Jun 2004 10:43:28 +0800	[thread overview]
Message-ID: <200406161043.28807.adaplas@hotpop.com> (raw)
In-Reply-To: <20040615172138.GA8823@dreamland.darkstar.lan>

On Wednesday 16 June 2004 01:21, Kronos wrote:

I still haven't seen the rest of your patch.  I assume you have 3 more pending.

> Hi,
> I played with sysfs for a while, this is the result. Note that is a RFC,
> the code is not meant for inclusion.
>
> The patch a "mode" attribute to each fb device. This attribute is not
> writable (yet). The attribute show the current video mode in the form
> <xres>x<yres>-<bpp>@<refresh>.
>
> This interface is simple and usable by the user but it's not possible to
> pass a detailed mode using a fb_var_screeninfo (like the ioctl). It may
> be worth adding another attribute (binary) - say "mode_detailed" - that
> deals with fb_var_screeninfo and not with strings.
>
> This is how sysfs tree looks like:
>
> kronos@notebook:~$ tree /sys/class/graphics
> /sys/class/graphics
> `-- fb0
>
>     |-- dev
>
>     `-- mode
>
> 1 directory, 2 files
>
> And the output is the following:
> kronos@notebook:~$ cat /sys/class/graphics/fb0/mode
> 1024x768-16@58
>
> Note that 58 is really 60Hz, I'm having problems with the approx.
> Does anyone have a better method to calculate the refresh rate?

refresh = hfreq/vtotal

where:
	hfreq = pixclock/htotal
	pixclock = in Hz
	htotal = xres + left_margin + right_margin + hsync_len
	vtotal = yres + upper_margin + lower_margin + vsync_len

The above is not an approximation, but should give the actual refresh rate, 
assuming the driver properly normalized all variables in fb_var_screeninfo.

>
> The patch is composed by 2 parts: the first add a class_device field to
> the struct fb_info. In this way modules can attach attributes to this
> class_device. The problem with the current code is that class_dev is
> initialized in register_framebuffer so you can use it only after current
> fb is registered. This happens because with the class_simple interface
> it's not possibile to split the creation of the class_device and its
> insertion into the hierarchy (this is possible with normal class_device
> interface though).
>
> Another problem is that the driver's private modedb is not available,
> so the code will search only standard modedb (using fb_find_mode).
> This issue can be solved adding a "modedb" field to the struct fb_info.

We already have info->monspecs.modedb. If driver has DDC/EDID support, it
can run fb_edid_to_monspecs() in fbmon.c.  Of course, info->monspecs.edid 
is valid only for the monitor.  This can still be further filtered against the 
capability of graphics card.
 
Tony




-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND

  reply	other threads:[~2004-06-16  2:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-15 17:21 [PATCH][RFC][0/3] mode attribute in sysfs tree Kronos
2004-06-16  2:43 ` Antonino A. Daplas [this message]
2004-06-16  9:28 ` [PATCH][RFC][1/3] " Kronos
2004-06-16  9:30 ` [PATCH][RFC][2/3] " Kronos
2004-06-16  9:32 ` [PATCH][RFC][3/3] " Kronos

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=200406161043.28807.adaplas@hotpop.com \
    --to=adaplas@hotpop.com \
    --cc=adaplas@pol.net \
    --cc=kronos@people.it \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    /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).