Re: [PATCH] drm/i915: Push mm switch immediately to ring

Chris Wilson
2015-03-16T21:35:47Z

On Mon, Mar 16, 2015 at 05:58:12PM +0200, Mika Kuoppala wrote:
> Sometimes when first batch is run with blitter ring,
> @@ -931,7 +931,6 @@ static int gen7_mm_switch(struct i915_hw_ppgtt *ppgtt,
> intel_ring_emit(ring, RING_PP_DIR_BASE(ring));
> intel_ring_emit(ring, get_pd_offset(ppgtt));
> intel_ring_emit(ring, MI_NOOP);
> - intel_ring_advance(ring);
>
> /* XXX: RCS is the only one to auto invalidate the TLBs? */
> if (ring->id != RCS) {
> @@ -940,6 +939,8 @@ static int gen7_mm_switch(struct i915_hw_ppgtt *ppgtt,
> return ret;
> }
>
> + __intel_ring_advance(ring);
> +

I really would like a comment before each of these, something like
/* XXX This papers over a bug loading PD prior to batch execution */

This last chunk is buggy. The earlier unadvanced return will break the
ringbuffer state tracking. Do you have equal success just with the plain
s/intel_ring_advance/__intel_ring_advance/ ?
-Chris

--
Chris Wilson, Intel Open Source Technology Centre