From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jesse Barnes Subject: Re: [PATCH 6/8] drm/i915: TLB invalidation with MI_FLUSH_SW requires a post-sync op Date: Tue, 23 Oct 2012 07:28:23 -0700 Message-ID: <20121023072823.213ce8e2@jbarnes-desktop> References: <1350583639-773-1-git-send-email-jbarnes@virtuousgeek.org> <1350583639-773-6-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 oproxy11-pub.bluehost.com (oproxy11-pub.bluehost.com [173.254.64.10]) by gabe.freedesktop.org (Postfix) with SMTP id 82BB39F5BA for ; Tue, 23 Oct 2012 07:27:22 -0700 (PDT) In-Reply-To: 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: Chris Wilson Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Tue, 23 Oct 2012 12:22:16 +0100 Chris Wilson wrote: > On Thu, 18 Oct 2012 13:07:17 -0500, Jesse Barnes wrote: > > So store into the scratch space of the HWS to make sure the invalidate > > occurs. > > Whoops, instant hang. Probably doesn't agree with being called FLUSH_SW > and not FLUSH_DW! ;-) > > > + /* > > + * Bspec vol 1c.5 - video engine command streamer: > > + * "If ENABLED, all TLBs will be invalidated once the flush > > + * operation is complete. This bit is only valid when the > > + * Post-Sync Operation field is a value of 1h or 3h." > > + */ > > if (invalidate & I915_GEM_GPU_DOMAINS) > > - cmd |= MI_INVALIDATE_TLB | MI_INVALIDATE_BSD; > > + cmd |= MI_INVALIDATE_TLB | MI_INVALIDATE_BSD | > > + MI_FLUSH_DW_STORE_INDEX | MI_FLUSH_DW_OP_STOREDW; > > intel_ring_emit(ring, cmd); > > - intel_ring_emit(ring, 0); > > + intel_ring_emit(ring, I915_GEM_HWS_SCRATCH_INDEX << 3); > And here is where the error lies. Perhaps this would be clearer if you > do: > > #define MI_FLUSH_DW_USE_PPGTT 0 > #define MI_FLUSH_DW_USE_GTT (1<<2) > > #define I915_GEM_HWS_SCRATCH_INDEX 0x30 > #define I915_GEM_HWS_SCRATCH_ADDR (I915_GEM_HWS_SCRATCH_INDEX << MI_STORE_DWORD_INDEX_SHIFT) > > Then: > intel_ring_emit(ring, I915_GEM_HWS_SCRATCH_ADDR | MI_FLUSH_DW_USE_GTT); > > Hangs begone! Ah cool, was hoping it was something simple. Damn PPGTT vs GTT always gets us. I'll respin with the change. -- Jesse Barnes, Intel Open Source Technology Center