[Mesa-dev] [PATCH 2/2] Use floating point for VTotal when calculating refresh rate

ville.syrjala at linux.intel.com ville.syrjala at linux.intel.com
Mon Aug 11 06:31:08 PDT 2014


From: Foo Bar <foo at bar.com>

Interlaced modes generally have an odd VTotal, so we lose half a line
from VTotal when we divide by two. That causes the final refresh rate
to be slightly off. Make VTotal a double to avoid the problem.

Signed-off-by: Foo Bar <foo at bar.com>
---
 xrandr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xrandr.c b/xrandr.c
index 9467c29..f94cfab 100644
--- a/xrandr.c
+++ b/xrandr.c
@@ -541,7 +541,7 @@ static double
 mode_refresh (XRRModeInfo *mode_info)
 {
     double rate;
-    unsigned int vTotal = mode_info->vTotal;
+    double vTotal = mode_info->vTotal;
 
     if (mode_info->modeFlags & RR_DoubleScan) {
 	/* doublescan doubles the number of lines */
-- 
1.8.1.5



More information about the mesa-dev mailing list