Validating modes should be more fuzzy

Matthias Hopf mhopf at suse.de
Thu Aug 23 08:40:14 PDT 2007


On Aug 23, 07 10:07:54 -0400, Adam Jackson wrote:
> On Wed, 2007-08-22 at 15:14 +0200, Matthias Hopf wrote:
> > While testing the current Xserver + drivers it occurred to us that a
> > mode wasn't accepted though it looked perfectly sane. It turned out,
> > that its refresh rate (60.01fps) was *just* above the nominal maximum
> > refresh rate of the monitor (60fps).
> > 
> > As PLLs cannot be programmed exactly to any given value, there should be
> > a certain fuzziness in mode validation, like the attached patch will do
> > (in this case +/- 0.5Hz for vrefresh, +/- 0.5kHz for hrefresh, +/-
> > 0.5MHz for clock).
> > 
> > I chose these values arbitrarily, and it should be discussed what to use
> > here (absolute/relative? How much?). I would suggest going for 0.5
> > absolute like in this patch (because people tend to specify integer
> > values for limits), or 0.1% to 1% relative.
> > 
> > If nobody cares, I will commit it the way it is.
> 
> The classic mode selection code has some tolerance already.  In
> xf86str.h:
> 
> #define SYNC_TOLERANCE          0.01    /* 1 percent */
> 
> Which seems to have served us well.  So I'd prefer to either have the
> new mode code use the same fuzz, or else change it in both places.

Ah. I see. I think a relative tolerance is better anyway, so I'll change
it to use this constant (if xf86str.h can be included here) and push it.

Thanks

Matthias

-- 
Matthias Hopf <mhopf at suse.de>      __        __   __
Maxfeldstr. 5 / 90409 Nuernberg   (_   | |  (_   |__          mat at mshopf.de
Phone +49-911-74053-715           __)  |_|  __)  |__  R & D   www.mshopf.de



More information about the xorg mailing list