summaryrefslogtreecommitdiff
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
parent5e04b5ad1b618655e201cbf1f5b2585aa6be0c17 (diff)
Add support for RepeatPad and RepeatReflect to 915 and 830-class Render accel.
-rw-r--r--src/i830_render.c22
-rw-r--r--src/i915_render.c23
2 files changed, 36 insertions, 9 deletions
diff --git a/src/i830_render.c b/src/i830_render.c
index c1ce856a..7b05daab 100644
--- a/src/i830_render.c
+++ b/src/i830_render.c
@@ -244,8 +244,8 @@ static Bool i830_check_composite_texture(PicturePtr pPict, int unit)
I830FALLBACK("Unsupported picture format 0x%x\n",
(int)pPict->format);
- if (pPict->repeat && pPict->repeatType != RepeatNormal)
- I830FALLBACK("unsupport repeat type\n");
+ if (pPict->repeatType > RepeatReflect)
+ I830FALLBACK("Unsupported picture repeat %d\n", pPict->repeatType);
if (pPict->filter != PictFilterNearest &&
pPict->filter != PictFilterBilinear)
@@ -276,7 +276,7 @@ i830_texture_setup(PicturePtr pPict, PixmapPtr pPix, int unit)
ScrnInfoPtr pScrn = xf86Screens[pPict->pDrawable->pScreen->myNum];
I830Ptr pI830 = I830PTR(pScrn);
uint32_t format, pitch, filter;
- uint32_t wrap_mode = TEXCOORDMODE_CLAMP_BORDER;
+ uint32_t wrap_mode;
pitch = intel_get_pixmap_pitch(pPix);
pI830->scale_units[unit][0] = pPix->drawable.width;
@@ -285,8 +285,22 @@ i830_texture_setup(PicturePtr pPict, PixmapPtr pPix, int unit)
format = i8xx_get_card_format(pPict);
- 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;
+ break;
+ case RepeatReflect:
+ wrap_mode = TEXCOORDMODE_MIRROR;
+ break;
+ default:
+ FatalError("Unkown repeat type %d\n", pPict->repeatType);
+ }
switch (pPict->filter) {
case PictFilterNearest:
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: