xf86-video-intel: Branch 'exa' - 2 commits - src/i915_exa_render.c
Eric Anholt
anholt at kemper.freedesktop.org
Thu Aug 10 02:14:47 EEST 2006
src/i915_exa_render.c | 73 +++++++++++++++++++++++---------------------------
1 files changed, 34 insertions(+), 39 deletions(-)
New commits:
diff-tree 7458a6adb5ea62f56bb3d4ab19ad7d1aa6ad2d19 (from 7ea74843bbdbf54b6804727be9b41d26832c8f76)
Author: Eric Anholt <anholt at FreeBSD.org>
Date: Mon Jul 31 10:09:17 2006 -0700
Move MAPSURF_XBIT settings into the texture formats structure.
diff --git a/src/i915_exa_render.c b/src/i915_exa_render.c
index 24b5752..90240b8 100644
--- a/src/i915_exa_render.c
+++ b/src/i915_exa_render.c
@@ -109,14 +109,14 @@ static struct blendinfo I915BlendOp[] =
};
static struct formatinfo I915TexFormats[] = {
- {PICT_a8r8g8b8, MT_32BIT_ARGB8888 },
- {PICT_x8r8g8b8, MT_32BIT_XRGB8888 },
- {PICT_a8b8g8r8, MT_32BIT_ABGR8888 },
- {PICT_x8b8g8r8, MT_32BIT_XBGR8888 },
- {PICT_r5g6b5, MT_16BIT_RGB565 },
- {PICT_a1r5g5b5, MT_16BIT_ARGB1555 },
- {PICT_x1r5g5b5, MT_16BIT_ARGB1555 },
- {PICT_a8, MT_8BIT_A8 },
+ {PICT_a8r8g8b8, MAPSURF_32BIT | MT_32BIT_ARGB8888 },
+ {PICT_x8r8g8b8, MAPSURF_32BIT | MT_32BIT_XRGB8888 },
+ {PICT_a8b8g8r8, MAPSURF_32BIT | MT_32BIT_ABGR8888 },
+ {PICT_x8b8g8r8, MAPSURF_32BIT | MT_32BIT_XBGR8888 },
+ {PICT_r5g6b5, MAPSURF_16BIT | MT_16BIT_RGB565 },
+ {PICT_a1r5g5b5, MAPSURF_16BIT | MT_16BIT_ARGB1555 },
+ {PICT_x1r5g5b5, MAPSURF_16BIT | MT_16BIT_ARGB1555 },
+ {PICT_a8, MAPSURF_8BIT | MT_8BIT_A8 },
};
static CARD32 I915GetBlendCntl(int op, PicturePtr pMask, CARD32 dst_format)
@@ -289,13 +289,6 @@ I915TextureSetup(PicturePtr pPict, Pixma
I830FALLBACK("Bad filter 0x%x\n", pPict->filter);
}
- if (pPix->drawable.bitsPerPixel == 8)
- format |= MAPSURF_8BIT;
- else if (pPix->drawable.bitsPerPixel == 16)
- format |= MAPSURF_16BIT;
- else
- format |= MAPSURF_32BIT;
-
mapstate[unit * 3 + 0] = offset;
mapstate[unit * 3 + 1] = format |
((pPix->drawable.height - 1) << MS3_HEIGHT_SHIFT) |
diff-tree 7ea74843bbdbf54b6804727be9b41d26832c8f76 (from 30952e58ed83e2e18d1007f662d2cc9a773c876c)
Author: Eric Anholt <anholt at FreeBSD.org>
Date: Mon Jul 31 10:06:34 2006 -0700
Whitespace cleanup.
diff --git a/src/i915_exa_render.c b/src/i915_exa_render.c
index 9769765..24b5752 100644
--- a/src/i915_exa_render.c
+++ b/src/i915_exa_render.c
@@ -49,7 +49,7 @@ do { \
#define I830FALLBACK(s, arg...) \
do { \
return FALSE; \
-} while(0)
+} while(0)
#endif
extern float scale_units[2][2];
@@ -79,7 +79,7 @@ I915EXAPrepareComposite(int op, PictureP
PicturePtr pMaskPicture, PicturePtr pDstPicture,
PixmapPtr pSrc, PixmapPtr pMask, PixmapPtr pDst);
-static struct blendinfo I915BlendOp[] = {
+static struct blendinfo I915BlendOp[] = {
/* Clear */
{0, 0, BLENDFACT_ZERO, BLENDFACT_ZERO},
/* Src */
@@ -148,8 +148,8 @@ static CARD32 I915GetBlendCntl(int op, P
}
}
- return (sblend <<S6_CBUF_SRC_BLEND_FACT_SHIFT) |
- (dblend <<S6_CBUF_DST_BLEND_FACT_SHIFT);
+ return (sblend << S6_CBUF_SRC_BLEND_FACT_SHIFT) |
+ (dblend << S6_CBUF_DST_BLEND_FACT_SHIFT);
}
static Bool I915GetDestFormat(PicturePtr pDstPicture, CARD32 *dst_format)
@@ -193,7 +193,7 @@ static Bool I915CheckCompositeTexture(Pi
int w = pPict->pDrawable->width;
int h = pPict->pDrawable->height;
int i;
-
+
if ((w > 0x7ff) || (h > 0x7ff))
I830FALLBACK("Picture w/h too large (%dx%d)\n", w, h);
@@ -222,11 +222,10 @@ I915EXACheckComposite(int op, PicturePtr
PicturePtr pDstPicture)
{
CARD32 tmp1;
-
+
/* Check for unsupported compositing operations. */
if (op >= sizeof(I915BlendOp) / sizeof(I915BlendOp[0]))
I830FALLBACK("Unsupported Composite op 0x%x\n", op);
-
if (pMaskPicture != NULL && pMaskPicture->componentAlpha) {
/* Check if it's component alpha that relies on a source alpha and on
* the source value. We can only get one of those into the single
@@ -243,7 +242,7 @@ I915EXACheckComposite(int op, PicturePtr
if (pMaskPicture != NULL && !I915CheckCompositeTexture(pMaskPicture, 1))
I830FALLBACK("Check Mask picture texture\n");
- if (!I915GetDestFormat(pDstPicture, &tmp1))
+ if (!I915GetDestFormat(pDstPicture, &tmp1))
I830FALLBACK("Get Color buffer format\n");
return TRUE;
@@ -269,20 +268,20 @@ I915TextureSetup(PicturePtr pPict, Pixma
if (I915TexFormats[i].fmt == pPict->format)
break;
}
- if ( i == sizeof(I915TexFormats)/ sizeof(I915TexFormats[0]) )
+ if (i == sizeof(I915TexFormats)/ sizeof(I915TexFormats[0]))
I830FALLBACK("unknown texture format\n");
format = I915TexFormats[i].card_fmt;
- if (pPict->repeat)
+ if (pPict->repeat)
wrap_mode = TEXCOORDMODE_WRAP;
switch (pPict->filter) {
case PictFilterNearest:
- filter = (FILTER_NEAREST << SS2_MAG_FILTER_SHIFT) |
+ filter = (FILTER_NEAREST << SS2_MAG_FILTER_SHIFT) |
(FILTER_NEAREST << SS2_MIN_FILTER_SHIFT);
break;
case PictFilterBilinear:
- filter = (FILTER_LINEAR << SS2_MAG_FILTER_SHIFT) |
+ filter = (FILTER_LINEAR << SS2_MAG_FILTER_SHIFT) |
(FILTER_LINEAR << SS2_MIN_FILTER_SHIFT);
break;
default:
@@ -305,7 +304,8 @@ I915TextureSetup(PicturePtr pPict, Pixma
samplerstate[unit * 3 + 1] |= MS3_USE_FENCE_REGS;
mapstate[unit * 3 + 2] = ((pitch / 4) - 1) << MS4_PITCH_SHIFT;
- samplerstate[unit * 3 + 0] = (MIPFILTER_NONE << SS2_MIP_FILTER_SHIFT) | filter;
+ samplerstate[unit * 3 + 0] = (MIPFILTER_NONE << SS2_MIP_FILTER_SHIFT);
+ samplerstate[unit * 3 + 0] |= filter;
samplerstate[unit * 3 + 1] = SS3_NORMALIZED_COORDS;
samplerstate[unit * 3 + 1] |= wrap_mode << SS3_TCX_ADDR_MODE_SHIFT;
samplerstate[unit * 3 + 1] |= wrap_mode << SS3_TCY_ADDR_MODE_SHIFT;
@@ -323,7 +323,7 @@ I915TextureSetup(PicturePtr pPict, Pixma
ErrorF("try to sync to show any errors...");
I830Sync(pScrn);
#endif
-
+
return TRUE;
}
@@ -337,7 +337,7 @@ I915EXAPrepareComposite(int op, PictureP
CARD32 dst_format, dst_offset, dst_pitch;
CARD32 blendctl;
-ErrorF("i915 prepareComposite\n");
+ ErrorF("i915 prepareComposite\n");
I915GetDestFormat(pDstPicture, &dst_format);
dst_offset = exaGetPixmapOffset(pDst);
@@ -345,7 +345,7 @@ ErrorF("i915 prepareComposite\n");
scale_units[2][0] = pDst->drawable.width;
scale_units[2][1] = pDst->drawable.height;
FS_LOCALS(20);
-
+
if (!I915TextureSetup(pSrcPicture, pSrc, 0))
I830FALLBACK("fail to setup src texture\n");
if (pMask != NULL) {
@@ -396,12 +396,15 @@ ErrorF("i915 prepareComposite\n");
CARD32 ss2;
BEGIN_LP_RING(26);
- /*color buffer*/
+ /* color buffer
+ * XXX: Need to add USE_FENCE if we ever tile the X Server's pixmaps or
+ * visible screen.
+ */
OUT_RING(_3DSTATE_BUF_INFO_CMD);
- OUT_RING(BUF_3D_ID_COLOR_BACK| BUF_3D_PITCH(dst_pitch)); /* fence, tile? */
+ OUT_RING(BUF_3D_ID_COLOR_BACK| BUF_3D_PITCH(dst_pitch));
OUT_RING(BUF_3D_ADDR(dst_offset));
OUT_RING(MI_NOOP);
-
+
OUT_RING(_3DSTATE_DST_BUF_VARS_CMD);
OUT_RING(dst_format);
@@ -414,9 +417,8 @@ ErrorF("i915 prepareComposite\n");
OUT_RING(_3DSTATE_DFLT_SPEC_CMD);
OUT_RING(0x00000000);
-
- /* XXX:S3? define vertex format with tex coord sets number*/
- OUT_RING(_3DSTATE_LOAD_STATE_IMMEDIATE_1 | I1_LOAD_S(2) |
+
+ OUT_RING(_3DSTATE_LOAD_STATE_IMMEDIATE_1 | I1_LOAD_S(2) |
I1_LOAD_S(3) | I1_LOAD_S(4) | I1_LOAD_S(5) | I1_LOAD_S(6) | 4);
ss2 = S2_TEXCOORD_FMT(0, TEXCOORDFMT_2D);
if (pMask)
@@ -431,8 +433,8 @@ ErrorF("i915 prepareComposite\n");
ss2 |= S2_TEXCOORD_FMT(7, TEXCOORDFMT_NOT_PRESENT);
OUT_RING(ss2);
OUT_RING(0x00000000); /* Disable texture coordinate wrap-shortest */
- OUT_RING((1<<S4_POINT_WIDTH_SHIFT)|S4_LINE_WIDTH_ONE|
- S4_CULLMODE_NONE| S4_VFMT_XY);
+ OUT_RING((1 << S4_POINT_WIDTH_SHIFT) | S4_LINE_WIDTH_ONE |
+ S4_CULLMODE_NONE| S4_VFMT_XY);
blendctl = I915GetBlendCntl(op, pMaskPicture, pDstPicture->format);
OUT_RING(0x00000000); /* Disable stencil buffer */
OUT_RING(S6_CBUF_BLEND_ENABLE | S6_COLOR_WRITE_ENABLE |
More information about the xorg-commit
mailing list