[PATCHv2] modesetting: Add common widescreen resolutions

Adam Jackson ajax at nwnk.net
Mon Feb 22 19:22:42 UTC 2016


On Mon, 2016-02-22 at 11:41 -0500, Alex Deucher wrote:
> On Sun, Feb 21, 2016 at 6:12 AM, Adel Gadllah <adel.gadllah at gmail.com> wrote:
> > Stolen from the intel ddx driver, see:
> > https://cgit.freedesktop.org/xorg/driver/xf86-video-intel/commit/?id=26fd6bec
> > https://bugs.freedesktop.org/show_bug.cgi?id=37858
> > 
> > it makes those common modes selectable when using the modesetting driver.
> > 
> > Signed-off-by: Adel Gadllah <adel.gadllah at gmail.com>
> 
> NACK.  There's no reason to add this to the modesetting ddx.  Just fix
> it in the xserver.  E.g., they should be added to
> hw/xfree86/etc/extramodes.c as per
> https://bugs.freedesktop.org/show_bug.cgi?id=37858#c4

Indeed.  And also...

> 
> > +                       for (n = 0; n < ARRAY_SIZE(common_16_9); n++) {
> > +                               if (preferred->HDisplay <= common_16_9[n].width ||
> > +                                   preferred->VDisplay <= common_16_9[n].height)
> > +                                       break;
> > +
> > +                               m = xf86GTFMode(common_16_9[n].width,
> > +                                               common_16_9[n].height,
> > +                                               xf86ModeVRefresh(preferred),
> > +                                               FALSE, FALSE);

xf86GTFMode is almost certainly the wrong thing to call unconditionally
from this kind of logic; I suspect the only reason it works for intel
is that the drm just ignores the timings you ask for and only looks at
the sizes. Ideally you'd be looking these timings up from the DMTModes
list (which is probably out of sync with the kernel's copy of it by
now), and you need to pay attention to the timing level supported by
the sink so you can know to generate CVT-R modes.

dmt:~% gtf 3840 2160 60 | grep Mode
  Modeline "3840x2160_60.00"  712.34  3840 4152 4576 5312  2160 2161 2164 2235  -HSync +Vsync
dmt:~% cvt -r 3840 2160 60 | grep Mode
Modeline "3840x2160R"  533.00  3840 3888 3920 4000  2160 2163 2168 2222 +hsync -vsync

A 180MHz difference in dotclock is... significant.

- ajax


More information about the xorg-devel mailing list