xf86-video-intel: Branch 'exa' - 3 commits - src/i915_3d.h src/i915_exa_render.c src/i915_reg.h

Eric Anholt anholt at kemper.freedesktop.org
Wed Jul 19 16:43:56 PDT 2006


 src/i915_3d.h         |    6 +++---
 src/i915_exa_render.c |    8 ++++----
 src/i915_reg.h        |    9 +++++++--
 3 files changed, 14 insertions(+), 9 deletions(-)

New commits:
diff-tree d5243d1b35ab1db608c81889819e4d4d87048154 (from 13e372c2095fde94ae41bea959fba0ad95a59c08)
Author: Eric Anholt <anholt at FreeBSD.org>
Date:   Wed Jul 19 19:27:53 2006 -0400

    The height and width of texture maps are one more than the programmed values.

diff --git a/src/i915_exa_render.c b/src/i915_exa_render.c
index 4cc9e54..4912d97 100644
--- a/src/i915_exa_render.c
+++ b/src/i915_exa_render.c
@@ -271,8 +271,8 @@ I915TextureSetup(PicturePtr pPict, Pixma
 	OUT_RING(_3DSTATE_MAP_STATE | 3);
 	OUT_RING(1<<unit);
 	OUT_RING(offset); /* Must be 4-byte aligned */
-	ms3 = (pPix->drawable.height << MS3_HEIGHT_SHIFT) | 
-		(pPix->drawable.width << MS3_WIDTH_SHIFT) | format;
+	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); 
diff-tree 13e372c2095fde94ae41bea959fba0ad95a59c08 (from da5efb09d55291ce5bcabff7db8d1490bb5e838b)
Author: Eric Anholt <anholt at FreeBSD.org>
Date:   Wed Jul 19 16:42:57 2006 -0400

    Fix the texture map pitch setting as documented, and as used by the 3d driver.

diff --git a/src/i915_exa_render.c b/src/i915_exa_render.c
index a570382..4cc9e54 100644
--- a/src/i915_exa_render.c
+++ b/src/i915_exa_render.c
@@ -270,13 +270,13 @@ I915TextureSetup(PicturePtr pPict, Pixma
 	BEGIN_LP_RING(6);
 	OUT_RING(_3DSTATE_MAP_STATE | 3);
 	OUT_RING(1<<unit);
-	OUT_RING(offset&MS2_ADDRESS_MASK);
+	OUT_RING(offset); /* Must be 4-byte aligned */
 	ms3 = (pPix->drawable.height << MS3_HEIGHT_SHIFT) | 
 		(pPix->drawable.width << MS3_WIDTH_SHIFT) | format;
 	if (!pI830->disableTiling)
 		ms3 |= MS3_USE_FENCE_REGS;
 	OUT_RING(ms3); 
-	OUT_RING(pitch<<MS4_PITCH_SHIFT);
+	OUT_RING(((pitch / 4) - 1) << MS4_PITCH_SHIFT);
 	OUT_RING(0);
 	ADVANCE_LP_RING();
      }
diff --git a/src/i915_reg.h b/src/i915_reg.h
index b9f7ef8..6751de6 100644
--- a/src/i915_reg.h
+++ b/src/i915_reg.h
@@ -688,7 +688,9 @@
 
 
 
-/* p207 */
+/* p207.
+ * The DWORD count is 3 times the number of bits set in MS1_MAPMASK_MASK
+ */
 #define _3DSTATE_MAP_STATE               (CMD_3D|(0x1d<<24)|(0x0<<16))
 
 #define MS1_MAPMASK_SHIFT               0
@@ -755,6 +757,7 @@
 #define MS3_TILED_SURFACE             (1<<1)
 #define MS3_TILE_WALK                 (1<<0)
 
+/* The pitch is the pitch measured in DWORDS, minus 1 */
 #define MS4_PITCH_SHIFT                 21
 #define MS4_CUBE_FACE_ENA_NEGX          (1<<20)
 #define MS4_CUBE_FACE_ENA_POSX          (1<<19)
@@ -771,7 +774,9 @@
 #define MS4_VOLUME_DEPTH_SHIFT          0    
 #define MS4_VOLUME_DEPTH_MASK           (0xff<<0)
 
-/* p244 */
+/* p244.
+ * The DWORD count is 3 times the number of bits set in SS1_MAPMASK_MASK.
+ */
 #define _3DSTATE_SAMPLER_STATE         (CMD_3D|(0x1d<<24)|(0x1<<16))
 
 #define SS1_MAPMASK_SHIFT               0
diff-tree da5efb09d55291ce5bcabff7db8d1490bb5e838b (from 36aa43bf73ee1268f0a250788eb637a4123f08eb)
Author: Eric Anholt <anholt at FreeBSD.org>
Date:   Wed Jul 19 16:36:52 2006 -0400

    Fix the alignment padding fix (didn't bump BEGIN_LP_RING count).

diff --git a/src/i915_3d.h b/src/i915_3d.h
index 5a45882..c116200 100644
--- a/src/i915_3d.h
+++ b/src/i915_3d.h
@@ -436,13 +436,13 @@ do {									\
 
 #define FS_END()							\
 do {									\
-    int _i;								\
-    BEGIN_LP_RING(_cur_shader_commands * 3 + 1);			\
+    int _i, _pad = (_cur_shader_commands & 0x1) ? 0 : 1;		\
+    BEGIN_LP_RING(_cur_shader_commands * 3 + 1 + _pad);			\
     OUT_RING(_3DSTATE_PIXEL_SHADER_PROGRAM |				\
 	     (_cur_shader_commands * 3 - 1));				\
     for (_i = 0; _i < _cur_shader_commands * 3; _i++)			\
 	OUT_RING(_shader_buf[_i]);					\
-    if ((_cur_shader_commands & 0x1) == 0)				\
+    if (_pad != 0)							\
 	OUT_RING(MI_NOOP);						\
     ADVANCE_LP_RING();							\
 } while (0);



More information about the xorg-commit mailing list