[PATCH] modesetting: Copy over VRefresh to/from KMS modes
Jasper St. Pierre
jstpierre at mecheye.net
Thu Jan 8 16:40:54 PST 2015
On Thu, Jan 8, 2015 at 2:42 PM, Keith Packard <keithp at keithp.com> wrote:
> "Jasper St. Pierre" <jstpierre at mecheye.net> writes:
>
> > The kernel might want this information during modesetting.
> > ---
> > hw/xfree86/drivers/modesetting/drmmode_display.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c
> b/hw/xfree86/drivers/modesetting/drmmode_display.c
> > index 824500b..27b7fd8 100644
> > --- a/hw/xfree86/drivers/modesetting/drmmode_display.c
> > +++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
> > @@ -145,6 +145,7 @@ drmmode_ConvertFromKMode(ScrnInfoPtr scrn,
> > mode->VSyncEnd = kmode->vsync_end;
> > mode->VTotal = kmode->vtotal;
> > mode->VScan = kmode->vscan;
> > + mode->VRefresh = kmode->vrefresh;
>
> You probably want to compute this using xf86ModeVRefresh instead of just
> using the kernel value as the kernel holds an int while the X server
> makes this a float.
>
> >
> > mode->Flags = kmode->flags; //& FLAG_BITS;
> > mode->name = strdup(kmode->name);
> > @@ -174,6 +175,7 @@ drmmode_ConvertToKMode(ScrnInfoPtr scrn,
> > kmode->vsync_end = mode->VSyncEnd;
> > kmode->vtotal = mode->VTotal;
> > kmode->vscan = mode->VScan;
> > + kmode->vrefresh = xf86ModeVRefresh(mode);
>
> Why compute this instead of just pulling from mode->VRefresh?
> And, you'll need to explicitly round this to the nearest int instead of
> truncating.
>
Because several functions do not properly fill in mode->VRefresh. A simple
example is xf86RandRModeConvert. I figured it would be easier when we fill
in vrefresh rather than fill all callers.
> --
> -keith
>
--
Jasper
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.x.org/archives/xorg-devel/attachments/20150108/6fdc99bd/attachment.html>
More information about the xorg-devel
mailing list