diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c index 449d46de..14446df6 100644 --- a/lib/intel_batchbuffer.c +++ b/lib/intel_batchbuffer.c @@ -72,6 +72,8 @@ intel_batchbuffer_free(struct intel_batchbuffer *batch) free(batch); } +#define CMD_POLY_STIPPLE_OFFSET 0x7906 + void intel_batchbuffer_flush(struct intel_batchbuffer *batch) { @@ -82,6 +84,13 @@ intel_batchbuffer_flush(struct intel_batchbuffer *batch) if (used == 0) return; + if (IS_GEN5(batch->devid)) { + BEGIN_BATCH(2); + OUT_BATCH(CMD_POLY_STIPPLE_OFFSET << 16); + OUT_BATCH(0); + ADVANCE_BATCH(); + } + /* Round batchbuffer usage to 2 DWORDs. */ if ((used & 4) == 0) { *(uint32_t *) (batch->ptr) = 0; /* noop */ diff --git a/tests/gem_stress.c b/tests/gem_stress.c index 5aa6def8..e8d91880 100644 --- a/tests/gem_stress.c +++ b/tests/gem_stress.c @@ -166,13 +166,6 @@ static void keep_gpu_busy(void) OUT_BATCH(src_pitch); OUT_RELOC(busy_bo, I915_GEM_DOMAIN_RENDER, 0, 0); ADVANCE_BATCH(); - - if (IS_GEN5(devid)) { - BEGIN_BATCH(2); - OUT_BATCH(CMD_POLY_STIPPLE_OFFSET << 16); - OUT_BATCH(0); - ADVANCE_BATCH(); - } } static unsigned int copyfunc_seq = 0; @@ -288,13 +281,6 @@ static void blitter_copyfunc(struct scratch_buf *src, unsigned src_x, unsigned s OUT_RELOC(src->bo, I915_GEM_DOMAIN_RENDER, 0, 0); ADVANCE_BATCH(); - if (IS_GEN5(devid)) { - BEGIN_BATCH(2); - OUT_BATCH(CMD_POLY_STIPPLE_OFFSET << 16); - OUT_BATCH(0); - ADVANCE_BATCH(); - } - if (!(keep_gpu_busy_counter & 1) && !fence_storm) keep_gpu_busy();