summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2013-05-31 17:01:54 +0300
committerAaron Plattner <aplattner@nvidia.com>2014-02-19 16:10:53 -0800
commit00c795e99fe29ecd56e05e915e508c7af0ac39ad (patch)
tree90f2fb832b65917efea00d43d2986f9d54186f17
parent8f9b993342fddfceaa1afbec2996ce10038f10d7 (diff)
xrandr: Use floating point for VTotal when calculating refresh rate
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: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
-rw-r--r--xrandr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/xrandr.c b/xrandr.c
index 3254573..ee72f5a 100644
--- a/xrandr.c
+++ b/xrandr.c
@@ -543,7 +543,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 */