intel: Avoid trying to do blits to Y tiled regions.

This is somewhat nasty, but we need to do Y-tiled depth for FBO support.
May help with corruption and hangs since enabling texture tiling, and
since switching depth textures to Y tiled.

Fixes piglit depthtex.c on 965.
This commit is contained in:
Eric Anholt
2009-06-22 11:00:11 -07:00
parent 246d59c29e
commit 8f81a6468f
10 changed files with 137 additions and 90 deletions

View File

@@ -108,6 +108,8 @@ intelCopyBuffer(const __DRIdrawablePrivate * dPriv,
CMD = XY_SRC_COPY_BLT_CMD | XY_BLT_WRITE_ALPHA | XY_BLT_WRITE_RGB;
}
assert(src->tiling != I915_TILING_Y);
assert(dst->tiling != I915_TILING_Y);
#ifndef I915
if (src->tiling != I915_TILING_NONE) {
CMD |= XY_SRC_TILED;
@@ -201,7 +203,7 @@ static GLuint translate_raster_op(GLenum logicop)
/* Copy BitBlt
*/
void
GLboolean
intelEmitCopyBlit(struct intel_context *intel,
GLuint cpp,
GLshort src_pitch,
@@ -223,6 +225,11 @@ intelEmitCopyBlit(struct intel_context *intel,
dri_bo *aper_array[3];
BATCH_LOCALS;
if (dst_tiling == I915_TILING_Y)
return GL_FALSE;
if (src_tiling == I915_TILING_Y)
return GL_FALSE;
/* do space/cliprects check before going any further */
do {
aper_array[0] = intel->batch->buf;
@@ -260,7 +267,7 @@ intelEmitCopyBlit(struct intel_context *intel,
if (locked)
UNLOCK_HARDWARE(intel);
return;
return GL_TRUE;
}
intel_batchbuffer_require_space(intel->batch, 8 * 4, NO_LOOP_CLIPRECTS);
@@ -287,7 +294,7 @@ intelEmitCopyBlit(struct intel_context *intel,
CMD = XY_SRC_COPY_BLT_CMD | XY_BLT_WRITE_ALPHA | XY_BLT_WRITE_RGB;
break;
default:
return;
return GL_FALSE;
}
#ifndef I915
@@ -302,7 +309,7 @@ intelEmitCopyBlit(struct intel_context *intel,
#endif
if (dst_y2 <= dst_y || dst_x2 <= dst_x) {
return;
return GL_TRUE;
}
assert(dst_x < dst_x2);
@@ -324,6 +331,8 @@ intelEmitCopyBlit(struct intel_context *intel,
ADVANCE_BATCH();
intel_batchbuffer_emit_mi_flush(intel->batch);
return GL_TRUE;
}
@@ -536,7 +545,7 @@ intelClearWithBlit(GLcontext *ctx, GLbitfield mask)
UNLOCK_HARDWARE(intel);
}
void
GLboolean
intelEmitImmediateColorExpandBlit(struct intel_context *intel,
GLuint cpp,
GLubyte *src_bits, GLuint src_size,
@@ -552,11 +561,14 @@ intelEmitImmediateColorExpandBlit(struct intel_context *intel,
int dwords = ALIGN(src_size, 8) / 4;
uint32_t opcode, br13, blit_cmd;
if (dst_tiling == I915_TILING_Y)
return GL_FALSE;
assert( logic_op - GL_CLEAR >= 0 );
assert( logic_op - GL_CLEAR < 0x10 );
if (w < 0 || h < 0)
return;
return GL_TRUE;
dst_pitch *= cpp;
@@ -613,4 +625,6 @@ intelEmitImmediateColorExpandBlit(struct intel_context *intel,
REFERENCES_CLIPRECTS );
intel_batchbuffer_emit_mi_flush(intel->batch);
return GL_TRUE;
}