linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <syrjala@sci.fi>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: "Helge Deller" <deller@gmx.de>,
	"Linux Frame Buffer Device Development"
	<linux-fbdev-devel@lists.sourceforge.net>,
	"Michel Dänzer" <michel@tungstengraphics.com>
Subject: Re: [PATCH] Add fb_check_var() for fixed mode	device.
Date: Fri, 29 Aug 2008 20:38:38 +0300	[thread overview]
Message-ID: <20080829173838.GP16680@sci.fi> (raw)
In-Reply-To: <Pine.LNX.4.64.0808291127510.18326@anakin>

On Fri, Aug 29, 2008 at 02:16:50PM +0200, Geert Uytterhoeven wrote:
> On Fri, 29 Aug 2008, Michel D?nzer wrote:
> > On Fri, 2008-08-29 at 14:15 +0900, Takashi Yoshii wrote:
> > > +	/* bigger is error, smaller is OK */
> > > +	if( ( var->xres > constant->xres )
> > > +	  ||( var->yres > constant->yres )
> > 
> > The resolution must match, otherwise userspace thinks it can e.g. set
> > 800x600 when the fixed mode is 1024x768.
> 
> It will be set later to the correct resolution. The above hunk just taks
> care of the rounding rules.
> 
> Anyway, I'm still wondering whether this check is really needed. If your
> application doesn't look at how fb_var_screeninfo was changed by calling
> FBIOPUT_VSCREENINFO, you're in deep trouble anyway, due to the rounding
> rules.

It can be used to to quickly check a bunch of modes for with 
FB_ACTIVATE_TEST. In fact FB_ACTIVATE_TEST's comment says that rounding
up should not happen here but no driver implements that. It could be
implemented in the common code by keeping a copy of the original var and
comparing them after the driver has done the rounding.

But what are the rounding rules anyway?
My take on the matter:
- xres_virtual/yres_virtual can be rounded up.
- xres/yres shouldn't be rounded since this is the first thing users
  usually care about.
- bits_per_pixel/red/gren/blue/transp shouldn't be rounded since
  it's the second thing users care about. I think most driver do round
  these though. In fact most drivers don't really even look at anything
  besides bits_per_pixel and green.length. Perhaps if the user has set
  some of them to zero the driver could pick freely.
- Timing values can be rounded. Which way or by how much I'm not sure.
  Refresh rate is the third thing users care about so huge rounding here
  could be problematic but some rounding is probably needed due to
  hardware constraints. In the "hardware supports only one mode" case
  the rounding should probably be unlimited though.
- xoffset/yoffset should be checked against panstep/wrap.
  FBIOPAN_DISPLAY doesn't allow any rounding but should
  FBIOPUT_VSCREENINFO?

Maybe some of the constraints (like limiting the refresh rate rounding to
some %) should only be enforced with FB_ACTIVATE_TEST. That would
prevent it breaking some stupid application that just sets some
randomish mode and expects the driver to hand out something that's supported.

-- 
Ville Syrjälä
syrjala@sci.fi
http://www.sci.fi/~syrjala/

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

  parent reply	other threads:[~2008-08-29 17:38 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-27  5:09 [PATCH] Do set var even if no fb_check_var() provided Takashi Yoshii
2008-08-27  7:08 ` Geert Uytterhoeven
2008-08-27 21:49   ` Helge Deller
2008-08-28  6:53     ` Michel Dänzer
2008-08-28 21:43       ` Helge Deller
2008-08-28 22:08         ` Michel Dänzer
2008-08-28 22:16           ` Helge Deller
2008-08-28 22:18             ` Michel Dänzer
2008-08-28 22:23               ` Helge Deller
2008-08-28 22:30                 ` Michel Dänzer
2008-08-28 22:35                   ` Helge Deller
2008-08-28 22:47                     ` Michel Dänzer
2008-08-28  7:45     ` Ville Syrjälä
2008-08-28 21:45       ` Helge Deller
2008-08-29  5:15       ` [PATCH] Add fb_check_var() for fixed mode device Takashi Yoshii
2008-08-29  7:07         ` Michel Dänzer
2008-08-29  7:48           ` Takashi Yoshii
2008-08-29  7:10         ` Geert Uytterhoeven
2008-09-04  1:56           ` Takashi Yoshii
2008-08-29  8:49         ` Michel Dänzer
2008-08-29 12:16           ` Geert Uytterhoeven
2008-08-29 13:51             ` Michel Dänzer
2008-08-29 14:14               ` Geert Uytterhoeven
2008-08-29 14:23                 ` Michel Dänzer
2008-08-30  8:58                   ` Helge Deller
2008-09-02 19:11                     ` Helge Deller
2008-09-03 10:11                       ` Michel Dänzer
2008-09-03 19:24                         ` Helge Deller
2008-09-04  7:21                       ` Takashi Yoshii
2008-08-29 17:38             ` Ville Syrjälä [this message]
2008-08-29  2:06   ` [PATCH] Do set var even if no fb_check_var() provided Takashi Yoshii
2008-08-29  7:03     ` Geert Uytterhoeven
2008-09-04  7:38       ` Takashi Yoshii

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=20080829173838.GP16680@sci.fi \
    --to=syrjala@sci.fi \
    --cc=deller@gmx.de \
    --cc=geert@linux-m68k.org \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    --cc=michel@tungstengraphics.com \
    /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).