xf86-video-intel: Branch 'exa' - 4 commits - src/i915_3d.h src/i915_exa_render.c
Eric Anholt
anholt at kemper.freedesktop.org
Wed Jul 26 13:46:24 PDT 2006
src/i915_3d.h | 4 -
src/i915_exa_render.c | 111 ++++++++++++++++++++++++++++----------------------
2 files changed, 65 insertions(+), 50 deletions(-)
New commits:
diff-tree 30952e58ed83e2e18d1007f662d2cc9a773c876c (from cffd2cd36d0437b38ac8164d66ea71be50b19330)
Author: Eric Anholt <anholt at FreeBSD.org>
Date: Wed Jul 26 13:42:12 2006 -0700
Limit drawing to the destination pixmap's boundaries, not the screen's.
This shouldn't matter, as miComputeCompositeRegion shouldn't giving us
anything that would draw outside the bounds, anyway.
diff --git a/src/i915_exa_render.c b/src/i915_exa_render.c
index 7b2eada..9769765 100644
--- a/src/i915_exa_render.c
+++ b/src/i915_exa_render.c
@@ -446,7 +446,8 @@ ErrorF("i915 prepareComposite\n");
OUT_RING(_3DSTATE_DRAW_RECT_CMD);
OUT_RING(0x00000000);
OUT_RING(0x00000000); /* ymin, xmin*/
- OUT_RING(DRAW_YMAX(pScrn->virtualY-1) | DRAW_XMAX(pScrn->virtualX-1));
+ OUT_RING(DRAW_YMAX(pDst->drawable.height - 1) |
+ DRAW_XMAX(pDst->drawable.width - 1));
OUT_RING(0x00000000); /* yorig, xorig (relate to color buffer?)*/
OUT_RING(MI_NOOP);
ADVANCE_LP_RING();
diff-tree cffd2cd36d0437b38ac8164d66ea71be50b19330 (from 96754b822df7ac110a70b2d08dda2ebb299772be)
Author: Eric Anholt <anholt at FreeBSD.org>
Date: Wed Jul 26 13:22:51 2006 -0700
Fix hangs when compositing with a mask.
The modify bits in the mask field for sampler/map state appear to actually
be enable bits. So, prepare the state values in I915TextureSetup,
then write the sampler/map state out all at once in PrepareComposite.
diff --git a/src/i915_exa_render.c b/src/i915_exa_render.c
index 74c85e0..7b2eada 100644
--- a/src/i915_exa_render.c
+++ b/src/i915_exa_render.c
@@ -55,6 +55,8 @@ do { \
extern float scale_units[2][2];
extern Bool is_transform[2];
extern PictTransform *transform[2];
+static CARD32 mapstate[6];
+static CARD32 samplerstate[6];
struct formatinfo {
int fmt;
@@ -288,50 +290,27 @@ I915TextureSetup(PicturePtr pPict, Pixma
I830FALLBACK("Bad filter 0x%x\n", pPict->filter);
}
- {
- CARD32 ms3;
- if (pPix->drawable.bitsPerPixel == 8)
- format |= MAPSURF_8BIT;
- else if (pPix->drawable.bitsPerPixel == 16)
- format |= MAPSURF_16BIT;
- else
- format |= MAPSURF_32BIT;
-
- BEGIN_LP_RING(6);
- OUT_RING(_3DSTATE_MAP_STATE | 3);
- OUT_RING(1<<unit);
- OUT_RING(offset); /* Must be 4-byte aligned */
- ms3 = ((pPix->drawable.height - 1) << MS3_HEIGHT_SHIFT) |
- ((pPix->drawable.width - 1) << MS3_WIDTH_SHIFT) | format;
- if (!pI830->disableTiling)
- ms3 |= MS3_USE_FENCE_REGS;
- OUT_RING(ms3);
- OUT_RING(((pitch / 4) - 1) << MS4_PITCH_SHIFT);
- OUT_RING(MI_NOOP);
- ADVANCE_LP_RING();
- }
-
- {
- CARD32 ss2, ss3;
- BEGIN_LP_RING(6);
- /* max & min mip level ? or base mip level? */
-
- OUT_RING(_3DSTATE_SAMPLER_STATE | 3);
- OUT_RING(1<<unit);
- ss2 = (MIPFILTER_NONE << SS2_MIP_FILTER_SHIFT);
- ss2 |= filter;
- OUT_RING(ss2);
- /* repeat? */
- ss3 = wrap_mode << SS3_TCX_ADDR_MODE_SHIFT;
- ss3 |= wrap_mode << SS3_TCY_ADDR_MODE_SHIFT;
- ss3 |= SS3_NORMALIZED_COORDS;
- ss3 |= (unit << SS3_TEXTUREMAP_INDEX_SHIFT);
- OUT_RING(ss3);
- OUT_RING(0x00000000); /* border color */
- OUT_RING(MI_NOOP);
-
- ADVANCE_LP_RING();
- }
+ 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) |
+ ((pPix->drawable.width - 1) << MS3_WIDTH_SHIFT);
+ if (!pI830->disableTiling)
+ 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 + 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;
+ samplerstate[unit * 3 + 1] |= unit << SS3_TEXTUREMAP_INDEX_SHIFT;
+ samplerstate[unit * 3 + 2] = 0x00000000; /* border color */
if (pPict->transform != 0) {
is_transform[unit] = TRUE;
@@ -378,6 +357,41 @@ ErrorF("i915 prepareComposite\n");
scale_units[1][1] = -1;
}
+ if (pMask == NULL) {
+ BEGIN_LP_RING(10);
+ OUT_RING(_3DSTATE_MAP_STATE | 3);
+ OUT_RING(0x00000001); /* map 0 */
+ OUT_RING(mapstate[0]);
+ OUT_RING(mapstate[1]);
+ OUT_RING(mapstate[2]);
+
+ OUT_RING(_3DSTATE_SAMPLER_STATE | 3);
+ OUT_RING(0x00000001); /* sampler 0 */
+ OUT_RING(samplerstate[0]);
+ OUT_RING(samplerstate[1]);
+ OUT_RING(samplerstate[2]);
+ ADVANCE_LP_RING();
+ } else {
+ BEGIN_LP_RING(16);
+ OUT_RING(_3DSTATE_MAP_STATE | 6);
+ OUT_RING(0x00000003); /* map 0,1 */
+ OUT_RING(mapstate[0]);
+ OUT_RING(mapstate[1]);
+ OUT_RING(mapstate[2]);
+ OUT_RING(mapstate[3]);
+ OUT_RING(mapstate[4]);
+ OUT_RING(mapstate[5]);
+
+ OUT_RING(_3DSTATE_SAMPLER_STATE | 6);
+ OUT_RING(0x00000003); /* sampler 0,1 */
+ OUT_RING(samplerstate[0]);
+ OUT_RING(samplerstate[1]);
+ OUT_RING(samplerstate[2]);
+ OUT_RING(samplerstate[3]);
+ OUT_RING(samplerstate[4]);
+ OUT_RING(samplerstate[5]);
+ ADVANCE_LP_RING();
+ }
{
CARD32 ss2;
diff-tree 96754b822df7ac110a70b2d08dda2ebb299772be (from 9c93d1498fa2363c52ef7fbe97d781560f67acf5)
Author: Eric Anholt <anholt at FreeBSD.org>
Date: Wed Jul 26 13:19:12 2006 -0700
Fix a couple of typos from code review.
diff --git a/src/i915_3d.h b/src/i915_3d.h
index c116200..1090218 100644
--- a/src/i915_3d.h
+++ b/src/i915_3d.h
@@ -33,7 +33,7 @@
#define MASK_Y 0x2
#define MASK_Z 0x4
#define MASK_W 0x8
-#define MASK_XYZ (MASK_X | MASK_Y | MASK_W)
+#define MASK_XYZ (MASK_X | MASK_Y | MASK_Z)
#define MASK_XYZW (MASK_XYZ | MASK_W)
#define MASK_SATURATE 0x10
@@ -398,7 +398,7 @@ do { \
do { \
struct i915_fs_op op; \
\
- op = i915_fs_arith(DP3, dest_reg, operand0, i915_fs_operand_none(), \
+ op = i915_fs_arith(DP3, dest_reg, operand0, operand1, \
i915_fs_operand_none()); \
op.ui[0] &= ~A0_DEST_CHANNEL_ALL; \
op.ui[0] |= ((dest_mask) & ~MASK_SATURATE) << A0_DEST_CHANNEL_SHIFT; \
diff-tree 9c93d1498fa2363c52ef7fbe97d781560f67acf5 (from 38d1a5e0dbe059f5c01bd5120a108a386ff10718)
Author: Eric Anholt <anholt at FreeBSD.org>
Date: Tue Jul 25 21:17:05 2006 -0700
Oops, partial revert of last commit. Some were obviously not NOOPS.
diff --git a/src/i915_exa_render.c b/src/i915_exa_render.c
index 7555b41..74c85e0 100644
--- a/src/i915_exa_render.c
+++ b/src/i915_exa_render.c
@@ -393,13 +393,13 @@ ErrorF("i915 prepareComposite\n");
/* XXX: defaults */
OUT_RING(_3DSTATE_DFLT_Z_CMD);
- OUT_RING(MI_NOOP);
+ OUT_RING(0x00000000);
OUT_RING(_3DSTATE_DFLT_DIFFUSE_CMD);
- OUT_RING(MI_NOOP);
+ OUT_RING(0x00000000);
OUT_RING(_3DSTATE_DFLT_SPEC_CMD);
- OUT_RING(MI_NOOP);
+ OUT_RING(0x00000000);
/* XXX:S3? define vertex format with tex coord sets number*/
OUT_RING(_3DSTATE_LOAD_STATE_IMMEDIATE_1 | I1_LOAD_S(2) |
More information about the xorg-commit
mailing list