summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSascha Sommer <saschasommer@freenet.de>2007-08-23 12:11:51 +0200
committerMichel Dänzer <michel@tungstengraphics.com>2007-08-23 12:11:51 +0200
commitc66e5de26ae93caa368213f3cce139aacec955d2 (patch)
tree73e124911cb9f11bf89d834b0ecc809a4b638f72
parent633c1fff10a3be4c9f48c1995e330d60bf6abbb2 (diff)
radeon: Round down RMX stretch ratios.
Fixes issues with RMX scaling, see https://bugs.freedesktop.org/show_bug.cgi?id=8983 .
-rw-r--r--src/radeon_output.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/radeon_output.c b/src/radeon_output.c
index 9650a397..940bb015 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -848,21 +848,22 @@ static void RADEONInitRMXRegisters(xf86OutputPtr output, RADEONSavePtr save,
if (Hratio == 1.0 || !(mode->Flags & RADEON_USE_RMX)) {
save->fp_horz_stretch |= ((xres/8-1)<<16);
} else {
- save->fp_horz_stretch |= ((((unsigned long)(Hratio * RADEON_HORZ_STRETCH_RATIO_MAX +
- 0.5)) & RADEON_HORZ_STRETCH_RATIO_MASK) |
- RADEON_HORZ_STRETCH_BLEND |
- RADEON_HORZ_STRETCH_ENABLE |
- ((radeon_output->PanelXRes/8-1)<<16));
+ save->fp_horz_stretch |= ((((unsigned long)
+ (Hratio * RADEON_HORZ_STRETCH_RATIO_MAX)) &
+ RADEON_HORZ_STRETCH_RATIO_MASK) |
+ RADEON_HORZ_STRETCH_BLEND |
+ RADEON_HORZ_STRETCH_ENABLE |
+ ((radeon_output->PanelXRes/8-1)<<16));
}
if (Vratio == 1.0 || !(mode->Flags & RADEON_USE_RMX)) {
save->fp_vert_stretch |= ((yres-1)<<12);
} else {
- save->fp_vert_stretch |= ((((unsigned long)(Vratio * RADEON_VERT_STRETCH_RATIO_MAX +
- 0.5)) & RADEON_VERT_STRETCH_RATIO_MASK) |
- RADEON_VERT_STRETCH_ENABLE |
- RADEON_VERT_STRETCH_BLEND |
- ((radeon_output->PanelYRes-1)<<12));
+ save->fp_vert_stretch |= ((((unsigned long)(Vratio * RADEON_VERT_STRETCH_RATIO_MAX)) &
+ RADEON_VERT_STRETCH_RATIO_MASK) |
+ RADEON_VERT_STRETCH_ENABLE |
+ RADEON_VERT_STRETCH_BLEND |
+ ((radeon_output->PanelYRes-1)<<12));
}
}