summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2013-05-31 17:01:53 +0300
committerAaron Plattner <aplattner@nvidia.com>2014-02-19 16:10:44 -0800
commit8f9b993342fddfceaa1afbec2996ce10038f10d7 (patch)
tree35935966fbaf2c81e642797c296cdb4b8319c165
parent7ede207f9064fd88427026e38818819c2c8422bb (diff)
xrandr: Use more decimal places when printing various rates
Using just one decimal place for dotclock and refresh rates loses quite a bit of information. When dealing with 60Hz vs. 59.94Hz refresh rate modes for example, it's useful to see at least two decimal places. For the dotclock in similar cases, three decimal places seems quite a bit better than just one. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
-rw-r--r--xrandr.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/xrandr.c b/xrandr.c
index 0a182c3..3254573 100644
--- a/xrandr.c
+++ b/xrandr.c
@@ -1566,7 +1566,7 @@ crtc_apply (crtc_t *crtc)
rr_outputs[o] = crtc->outputs[o]->output.xid;
mode = crtc->mode_info->id;
if (verbose) {
- printf ("crtc %d: %12s %6.1f +%d+%d", crtc->crtc.index,
+ printf ("crtc %d: %12s %6.2f +%d+%d", crtc->crtc.index,
crtc->mode_info->name, mode_refresh (crtc->mode_info),
crtc->x, crtc->y);
for (o = 0; o < crtc->noutput; o++)
@@ -3641,7 +3641,7 @@ main (int argc, char **argv)
XRRModeInfo *mode = find_mode_by_xid (output_info->modes[j]);
int f;
- printf (" %s (0x%x) %6.1fMHz",
+ printf (" %s (0x%x) %6.3fMHz",
mode->name, (int)mode->id,
(double)mode->dotClock / 1000000.0);
for (f = 0; mode_flags[f].flag; f++)
@@ -3652,10 +3652,10 @@ main (int argc, char **argv)
if (j < output_info->npreferred)
printf (" +preferred");
printf ("\n");
- printf (" h: width %4d start %4d end %4d total %4d skew %4d clock %6.1fKHz\n",
+ printf (" h: width %4d start %4d end %4d total %4d skew %4d clock %6.2fKHz\n",
mode->width, mode->hSyncStart, mode->hSyncEnd,
mode->hTotal, mode->hSkew, mode_hsync (mode) / 1000);
- printf (" v: height %4d start %4d end %4d total %4d clock %6.1fHz\n",
+ printf (" v: height %4d start %4d end %4d total %4d clock %6.2fHz\n",
mode->height, mode->vSyncStart, mode->vSyncEnd, mode->vTotal,
mode_refresh (mode));
mode->modeFlags |= ModeShown;
@@ -3682,7 +3682,7 @@ main (int argc, char **argv)
if (strcmp (jmode->name, kmode->name) != 0) continue;
mode_shown[k] = True;
kmode->modeFlags |= ModeShown;
- printf (" %6.1f", mode_refresh (kmode));
+ printf (" %6.2f", mode_refresh (kmode));
if (kmode == output->mode_info)
printf ("*");
else
@@ -3703,13 +3703,13 @@ main (int argc, char **argv)
if (!(mode->modeFlags & ModeShown))
{
- printf (" %s (0x%x) %6.1fMHz\n",
+ printf (" %s (0x%x) %6.3fMHz\n",
mode->name, (int)mode->id,
(double)mode->dotClock / 1000000.0);
- printf (" h: width %4d start %4d end %4d total %4d skew %4d clock %6.1fKHz\n",
+ printf (" h: width %4d start %4d end %4d total %4d skew %4d clock %6.2fKHz\n",
mode->width, mode->hSyncStart, mode->hSyncEnd,
mode->hTotal, mode->hSkew, mode_hsync (mode) / 1000);
- printf (" v: height %4d start %4d end %4d total %4d clock %6.1fHz\n",
+ printf (" v: height %4d start %4d end %4d total %4d clock %6.2fHz\n",
mode->height, mode->vSyncStart, mode->vSyncEnd, mode->vTotal,
mode_refresh (mode));
}
@@ -3799,7 +3799,7 @@ main (int argc, char **argv)
if (rate == rates[i])
break;
if (i == nrate) {
- fprintf (stderr, "Rate %.1f Hz not available for this size\n", rate);
+ fprintf (stderr, "Rate %.2f Hz not available for this size\n", rate);
exit (1);
}
}