summaryrefslogtreecommitdiff
path: root/src/i915_render.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2008-10-01 16:13:09 -0700
committerEric Anholt <eric@anholt.net>2008-10-06 17:00:28 -0700
commit080d36648f92d3b9a559e5458687fa82afab411f (patch)
treeb4edbca13ec9c33d28af94aedaa873393cd5b357 /src/i915_render.c
parent5e04b5ad1b618655e201cbf1f5b2585aa6be0c17 (diff)
Add support for RepeatPad and RepeatReflect to 915 and 830-class Render accel.
Diffstat (limited to 'src/i915_render.c')
-rw-r--r--src/i915_render.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/i915_render.c b/src/i915_render.c
index 970c42ad..039db3bf 100644
--- a/src/i915_render.c
+++ b/src/i915_render.c
@@ -201,9 +201,8 @@ static Bool i915_check_composite_texture(PicturePtr pPict, int unit)
I830FALLBACK("Unsupported picture format 0x%x\n",
(int)pPict->format);
- if (pPict->repeat && pPict->repeatType != RepeatNormal)
- I830FALLBACK("extended repeat (%d) not supported\n",
- pPict->repeatType);
+ if (pPict->repeatType > RepeatReflect)
+ I830FALLBACK("Unsupported picture repeat %d\n", pPict->repeatType);
if (pPict->filter != PictFilterNearest &&
pPict->filter != PictFilterBilinear)
@@ -252,7 +251,7 @@ i915_texture_setup(PicturePtr pPict, PixmapPtr pPix, int unit)
I830Ptr pI830 = I830PTR(pScrn);
uint32_t format, pitch, filter;
int w, h, i;
- uint32_t wrap_mode = TEXCOORDMODE_CLAMP_BORDER;
+ uint32_t wrap_mode;
pitch = intel_get_pixmap_pitch(pPix);
w = pPict->pDrawable->width;
@@ -270,8 +269,22 @@ i915_texture_setup(PicturePtr pPict, PixmapPtr pPix, int unit)
I830FALLBACK("unknown texture format\n");
format = i915_tex_formats[i].card_fmt;
- if (pPict->repeat)
+ switch (pPict->repeatType) {
+ case RepeatNone:
+ wrap_mode = TEXCOORDMODE_CLAMP_BORDER;
+ break;
+ case RepeatNormal:
wrap_mode = TEXCOORDMODE_WRAP;
+ break;
+ case RepeatPad:
+ wrap_mode = TEXCOORDMODE_CLAMP_EDGE;
+ break;
+ case RepeatReflect:
+ wrap_mode = TEXCOORDMODE_MIRROR;
+ break;
+ default:
+ FatalError("Unkown repeat type %d\n", pPict->repeatType);
+ }
switch (pPict->filter) {
case PictFilterNearest: