From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH 4/9] drm/i915: add post-flush store dw workaround Date: Tue, 25 Sep 2012 10:49:28 +0200 Message-ID: <20120925084928.GE3824@bremse> References: <1348086543-24427-1-git-send-email-jbarnes@virtuousgeek.org> <1348086543-24427-4-git-send-email-jbarnes@virtuousgeek.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com [209.85.217.177]) by gabe.freedesktop.org (Postfix) with ESMTP id 0E06B9E8F5 for ; Tue, 25 Sep 2012 01:49:34 -0700 (PDT) Received: by lbbgf7 with SMTP id gf7so1235432lbb.36 for ; Tue, 25 Sep 2012 01:49:33 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1348086543-24427-4-git-send-email-jbarnes@virtuousgeek.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Jesse Barnes Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Wed, Sep 19, 2012 at 01:28:58PM -0700, Jesse Barnes wrote: > Several platforms need this to flush the CS write buffers. Chris spent quite some effort to dump less crap into the rings on gen6, and your description here sounds like we only need this when flushing write caches. Or it might only apply to CS writes (in which case this is at the wrong spot). In any case, can you please double check where exactly we need this and only add it there, with a neat comment explaining things added? I'm bitching because afair the CS stuff the windows driver emits (of which I've seen some traces) only emits one such 8x MI_WRITE block per batch, whereas your code here would emit 2 such 2x MI_WRITE blocks. Thanks, Daniel > > References: https://bugs.freedesktop.org/show_bug.cgi?id=50241 > Signed-off-by: Jesse Barnes > --- > drivers/gpu/drm/i915/intel_ringbuffer.c | 15 ++++++++++++++- > 1 file changed, 14 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c > index 55cdb4d..ef5101f 100644 > --- a/drivers/gpu/drm/i915/intel_ringbuffer.c > +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c > @@ -216,7 +216,7 @@ gen6_render_ring_flush(struct intel_ring_buffer *ring, > u32 flags = 0; > struct pipe_control *pc = ring->private; > u32 scratch_addr = pc->gtt_offset + 128; > - int ret; > + int ret, i; > > /* Force SNB workarounds for PIPE_CONTROL flushes */ > ret = intel_emit_post_sync_nonzero_flush(ring); > @@ -259,6 +259,19 @@ gen6_render_ring_flush(struct intel_ring_buffer *ring, > intel_ring_emit(ring, 0); > intel_ring_advance(ring); > > + ret = intel_ring_begin(ring, 4 * 8); > + if (ret) > + return ret; > + > + for (i = 0; i < 8; i++) { > + intel_ring_emit(ring, MI_STORE_DWORD_INDEX); > + intel_ring_emit(ring, I915_GEM_SCRATCH_INDEX << MI_STORE_DWORD_INDEX_SHIFT); > + intel_ring_emit(ring, 0); > + intel_ring_emit(ring, MI_NOOP); > + } > + intel_ring_advance(ring); > + > + > return 0; > } > > -- > 1.7.9.5 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch