<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 8, 2015 at 2:42 PM, Keith Packard <span dir="ltr"><<a href="mailto:keithp@keithp.com" target="_blank">keithp@keithp.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">"Jasper St. Pierre" <<a href="mailto:jstpierre@mecheye.net">jstpierre@mecheye.net</a>> writes:<br>
<br>
> The kernel might want this information during modesetting.<br>
> ---<br>
>  hw/xfree86/drivers/modesetting/drmmode_display.c | 2 ++<br>
>  1 file changed, 2 insertions(+)<br>
><br>
> diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c<br>
> index 824500b..27b7fd8 100644<br>
> --- a/hw/xfree86/drivers/modesetting/drmmode_display.c<br>
> +++ b/hw/xfree86/drivers/modesetting/drmmode_display.c<br>
> @@ -145,6 +145,7 @@ drmmode_ConvertFromKMode(ScrnInfoPtr scrn,<br>
>      mode->VSyncEnd = kmode->vsync_end;<br>
>      mode->VTotal = kmode->vtotal;<br>
>      mode->VScan = kmode->vscan;<br>
> +    mode->VRefresh = kmode->vrefresh;<br>
<br>
</span>You probably want to compute this using xf86ModeVRefresh instead of just<br>
using the kernel value as the kernel holds an int while the X server<br>
makes this a float.<br>
<span class=""><br>
><br>
>      mode->Flags = kmode->flags; //& FLAG_BITS;<br>
>      mode->name = strdup(kmode->name);<br>
> @@ -174,6 +175,7 @@ drmmode_ConvertToKMode(ScrnInfoPtr scrn,<br>
>      kmode->vsync_end = mode->VSyncEnd;<br>
>      kmode->vtotal = mode->VTotal;<br>
>      kmode->vscan = mode->VScan;<br>
> +    kmode->vrefresh = xf86ModeVRefresh(mode);<br>
<br>
</span>Why compute this instead of just pulling from mode->VRefresh?<br>
And, you'll need to explicitly round this to the nearest int instead of<br>
truncating.<span class="HOEnZb"><font color="#888888"><br></font></span></blockquote><div><br></div><div>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.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="HOEnZb"><font color="#888888">
--<br>
-keith<br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">  Jasper<br></div>
</div></div>