summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2009-04-23 15:46:44 +1000
committerDave Airlie <airlied@redhat.com>2009-04-23 15:46:44 +1000
commitdab3d61619d91ae6a3da3e9b29b8258313653813 (patch)
tree8d484994afccad81269f2e3c8d57b24fc789d420 /src
parentbbfd4625478e37d10fd58b23f46153f349370a52 (diff)
r300/r500: set R clamp mode.
On rs690 without this set, we appear to end up fetching from well outside the texture sometimes into memory that isn't mapped. This "shouldn't" have any effect.
Diffstat (limited to 'src')
-rw-r--r--src/radeon_exa_render.c11
-rw-r--r--src/radeon_textured_videofuncs.c6
2 files changed, 14 insertions, 3 deletions
diff --git a/src/radeon_exa_render.c b/src/radeon_exa_render.c
index 831a6ff5..b5e36e71 100644
--- a/src/radeon_exa_render.c
+++ b/src/radeon_exa_render.c
@@ -1117,23 +1117,28 @@ static Bool FUNC_NAME(R300TextureSetup)(PicturePtr pPict, PixmapPtr pPix,
else
txfilter |= R300_TX_CLAMP_T(R300_TX_CLAMP_CLAMP_GL);
+ txfilter |= R300_TX_CLAMP_R(R300_TX_CLAMP_CLAMP_GL);
break;
case RepeatPad:
txfilter |= R300_TX_CLAMP_S(R300_TX_CLAMP_CLAMP_LAST) |
- R300_TX_CLAMP_T(R300_TX_CLAMP_CLAMP_LAST);
+ R300_TX_CLAMP_T(R300_TX_CLAMP_CLAMP_LAST) |
+ R300_TX_CLAMP_R(R300_TX_CLAMP_CLAMP_LAST);
break;
case RepeatReflect:
txfilter |= R300_TX_CLAMP_S(R300_TX_CLAMP_MIRROR) |
+ R300_TX_CLAMP_T(R300_TX_CLAMP_MIRROR) |
R300_TX_CLAMP_T(R300_TX_CLAMP_MIRROR);
break;
case RepeatNone:
txfilter |= R300_TX_CLAMP_S(R300_TX_CLAMP_CLAMP_GL) |
- R300_TX_CLAMP_T(R300_TX_CLAMP_CLAMP_GL);
+ R300_TX_CLAMP_T(R300_TX_CLAMP_CLAMP_GL) |
+ R300_TX_CLAMP_R(R300_TX_CLAMP_CLAMP_GL);
break;
}
} else
txfilter |= R300_TX_CLAMP_S(R300_TX_CLAMP_CLAMP_GL) |
- R300_TX_CLAMP_T(R300_TX_CLAMP_CLAMP_GL);
+ R300_TX_CLAMP_T(R300_TX_CLAMP_CLAMP_GL) |
+ R300_TX_CLAMP_R(R300_TX_CLAMP_CLAMP_GL);
switch (pPict->filter) {
case PictFilterNearest:
diff --git a/src/radeon_textured_videofuncs.c b/src/radeon_textured_videofuncs.c
index dd6f862c..de0eeb6f 100644
--- a/src/radeon_textured_videofuncs.c
+++ b/src/radeon_textured_videofuncs.c
@@ -1079,6 +1079,7 @@ FUNC_NAME(R300DisplayTexturedVideo)(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv)
txfilter = (R300_TX_CLAMP_S(R300_TX_CLAMP_CLAMP_LAST) |
R300_TX_CLAMP_T(R300_TX_CLAMP_CLAMP_LAST) |
+ R300_TX_CLAMP_R(R300_TX_CLAMP_CLAMP_LAST) |
R300_TX_MAG_FILTER_LINEAR |
R300_TX_MIN_FILTER_LINEAR |
(0 << R300_TX_ID_SHIFT));
@@ -1107,6 +1108,7 @@ FUNC_NAME(R300DisplayTexturedVideo)(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv)
txpitch -= 1;
txfilter = (R300_TX_CLAMP_S(R300_TX_CLAMP_CLAMP_LAST) |
R300_TX_CLAMP_T(R300_TX_CLAMP_CLAMP_LAST) |
+ R300_TX_CLAMP_R(R300_TX_CLAMP_CLAMP_LAST) |
R300_TX_MIN_FILTER_LINEAR |
R300_TX_MAG_FILTER_LINEAR);
@@ -1139,6 +1141,7 @@ FUNC_NAME(R300DisplayTexturedVideo)(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv)
/* Tex filter */
txfilter = (R300_TX_CLAMP_S(R300_TX_CLAMP_WRAP) |
R300_TX_CLAMP_T(R300_TX_CLAMP_WRAP) |
+ R300_TX_CLAMP_R(R300_TX_CLAMP_WRAP) |
R300_TX_MIN_FILTER_NEAREST |
R300_TX_MAG_FILTER_NEAREST |
(1 << R300_TX_ID_SHIFT));
@@ -2505,6 +2508,7 @@ FUNC_NAME(R500DisplayTexturedVideo)(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv)
txfilter = (R300_TX_CLAMP_S(R300_TX_CLAMP_CLAMP_LAST) |
R300_TX_CLAMP_T(R300_TX_CLAMP_CLAMP_LAST) |
+ R300_TX_CLAMP_R(R300_TX_CLAMP_CLAMP_LAST) |
R300_TX_MAG_FILTER_LINEAR |
R300_TX_MIN_FILTER_LINEAR |
(0 << R300_TX_ID_SHIFT));
@@ -2537,6 +2541,7 @@ FUNC_NAME(R500DisplayTexturedVideo)(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv)
txpitch -= 1;
txfilter = (R300_TX_CLAMP_S(R300_TX_CLAMP_CLAMP_LAST) |
R300_TX_CLAMP_T(R300_TX_CLAMP_CLAMP_LAST) |
+ R300_TX_CLAMP_R(R300_TX_CLAMP_CLAMP_LAST) |
R300_TX_MIN_FILTER_LINEAR |
R300_TX_MAG_FILTER_LINEAR);
@@ -2569,6 +2574,7 @@ FUNC_NAME(R500DisplayTexturedVideo)(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv)
/* Tex filter */
txfilter = (R300_TX_CLAMP_S(R300_TX_CLAMP_WRAP) |
R300_TX_CLAMP_T(R300_TX_CLAMP_WRAP) |
+ R300_TX_CLAMP_R(R300_TX_CLAMP_WRAP) |
R300_TX_MIN_FILTER_NEAREST |
R300_TX_MAG_FILTER_NEAREST |
(1 << R300_TX_ID_SHIFT));