diff options
-rw-r--r-- | src/i915_exa_render.c | 4 | ||||
-rw-r--r-- | src/i915_reg.h | 9 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/i915_exa_render.c b/src/i915_exa_render.c index a5703829..4cc9e546 100644 --- a/src/i915_exa_render.c +++ b/src/i915_exa_render.c @@ -270,13 +270,13 @@ I915TextureSetup(PicturePtr pPict, PixmapPtr pPix, int unit) 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 b9f7ef8e..6751de60 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 |