summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolai Haehnle <nhaehnle@gmail.com>2008-07-29 19:56:51 +0200
committerNicolai Haehnle <nhaehnle@gmail.com>2008-07-29 19:59:08 +0200
commit90b90c65dc78648ddded5eff7628749182c73295 (patch)
tree8f1a00564c1063dd04e372b05d84d80a73493581
parent6b903f5edfbba19980a5518df9a89643378516d4 (diff)
r300: Fix cliprect emit
This makes our handling of cliprects sane. drm_clip_rect always has exclusive bottom-right corners, but the hardware expects inclusive bottom-right corners, so we adjust this here. This complements Michel Daenzer's commit 57aea290e1e0a26d1e74df6cff777eb9f038f1f8 to Mesa. See also http://bugs.freedesktop.org/show_bug.cgi?id=16123 .
-rw-r--r--shared-core/r300_cmdbuf.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/shared-core/r300_cmdbuf.c b/shared-core/r300_cmdbuf.c
index ed787461..7546e839 100644
--- a/shared-core/r300_cmdbuf.c
+++ b/shared-core/r300_cmdbuf.c
@@ -77,6 +77,9 @@ static int r300_emit_cliprects(drm_radeon_private_t *dev_priv,
return -EFAULT;
}
+ box.x2--; /* Hardware expects inclusive bottom-right corner */
+ box.y2--;
+
if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_RV515) {
box.x1 = (box.x1) &
R300_CLIPRECT_MASK;
@@ -95,8 +98,8 @@ static int r300_emit_cliprects(drm_radeon_private_t *dev_priv,
R300_CLIPRECT_MASK;
box.y2 = (box.y2 + R300_CLIPRECT_OFFSET) &
R300_CLIPRECT_MASK;
-
}
+
OUT_RING((box.x1 << R300_CLIPRECT_X_SHIFT) |
(box.y1 << R300_CLIPRECT_Y_SHIFT));
OUT_RING((box.x2 << R300_CLIPRECT_X_SHIFT) |