summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSascha Sommer <saschasommer@freenet.de>2007-08-22 15:28:58 +0200
committerMichel Dänzer <michel@tungstengraphics.com>2007-08-23 12:07:06 +0200
commit6b736a5c25d968bb09e229e0fbb82162e8447783 (patch)
treefcee54a37c422d8a8b64845d0e455e356dc88d98
parent26aacfd90e2502c6e2a6c10761b4b2da7971b2bc (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_driver.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 466fd46..8d868f5 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -5797,21 +5797,23 @@ static void RADEONInitRMXRegisters(ScrnInfoPtr pScrn, 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 |
- ((info->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 |
+ ((info->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 |
- ((info->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 |
+ ((info->PanelYRes-1)<<12));
}
}