--- Thomas Winischhofer <[EMAIL PROTECTED]> wrote:
> Alex Deucher wrote:
> > How is DPI supposed to work if you have a virtual desktop larger
> than
> > the current mode? the current code seems to produce the wrong DPI.
>
> > xf86SetDpi() has the following code:
> >
> > if (pScrn->widthmm > 0) {
> > pScrn->xDpi =
> > (int)((double)pScrn->virtualX * MMPERINCH /
> pScrn->widthmm);
> > }
> > if (pScrn->heightmm > 0) {
> > pScrn->yDpi =
> > (int)((double)pScrn->virtualY * MMPERINCH /
> pScrn->heightmm);
> > }
> >
> > if you have, for example,
> > DisplaySize 300 230
> > and a virtual resolution of say 2048x768 and a mode of 1024x768,
> the
> > DPI would get set to 173, 84. which (I think) is wrong. it should
> be
> > 86, 84 which is what you would get when your mode matches your
> virtual
> > resolution. I'm having the same problem with Mergedfb since it
> uses a
> > virtual resolution with two viewports looking into it. I could add
> the
> > heightmm or widthmm of both heads to make the DPI "correct" for the
> > virtual size with respect to the two heads. I'm not sure how
> xinerama
> > deals with it. maybe the current behavior is right? I dunno.
> >
> > Thoughts?
>
> Without actually having looked at this, my preliminary opinion is
> that
> what we do presently is correct. I don't see the mode dimensions
> anywhere in the calculation you quoted above.
Sorry, I just used that mode as an example. It doesn't get used in the
calculation. what I meant to say is "when your monitor's aspect ratio
matches your virtual screen's aspect ratio"
>
> virtualX and Y can be bigger than the viewport in any case (not just
> MergedFB mode). I think the whole DPI system is based on the
> assumption
> that you _see_ the whole (virtual) desktop, ie you're running at the
> maximum mode(s on each head). The only thing one has to do is to set
> DisplaySize correctly, namely to the over-all size of BOTH heads
> (depending on their relative location, of course).
And that's where the problem is. xf86SetDpi() only works right if the
virtual resolution and the monitor have the same aspect ratio.
>
> As Aitchison showed in his reply, Xinerama does basically the same as
> it
> just resizes the mmWidth/Height with regard to the second head,
> although
> it does this by calculating some sort of average.
>
> Be it adding the second head's dimension to the mmHeight/Width, be it
>
> calculating an average, both methods are likewise inaccurate if you
> use
> two output devices with different actual DPI values.
yup.
>
> But as said, this is my unqualified opinion without looking at it
> closer. I'll think about it.
>
> Thomas
>
> --
> Thomas Winischhofer
> Vienna/Austria
> thomas AT winischhofer DOT net http://www.winischhofer.net/
> twini AT xfree86 DOT org
>
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
_______________________________________________
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel