From patchwork Thu Jul 26 23:48:43 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Widawsky X-Patchwork-Id: 1246541 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id B0614DFFCE for ; Thu, 26 Jul 2012 23:49:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 75E039EEC2 for ; Thu, 26 Jul 2012 16:49:25 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from cloud01.chad-versace.us (184-106-247-128.static.cloud-ips.com [184.106.247.128]) by gabe.freedesktop.org (Postfix) with ESMTP id 9236E9E754 for ; Thu, 26 Jul 2012 16:48:52 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by cloud01.chad-versace.us (Postfix) with ESMTP id CB75A18106C; Thu, 26 Jul 2012 23:51:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at static.cloud-ips.com X-Spam-Flag: NO X-Spam-Score: -2.9 X-Spam-Level: X-Spam-Status: No, score=-2.9 tagged_above=-100 required=3.5 tests=[ALL_TRUSTED=-1, BAYES_00=-1.9] autolearn=ham Received: from cloud01.chad-versace.us ([127.0.0.1]) by localhost (cloud01.static.cloud-ips.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EEbtnPP2ilF7; Thu, 26 Jul 2012 23:51:45 +0000 (UTC) Received: from bolo_yeung.jf.intel.com (jfdmzpr03-ext.jf.intel.com [134.134.139.72]) by cloud01.chad-versace.us (Postfix) with ESMTPSA id 7F64E1808E2; Thu, 26 Jul 2012 23:51:45 +0000 (UTC) From: Ben Widawsky To: intel-gfx@lists.freedesktop.org Date: Thu, 26 Jul 2012 16:48:43 -0700 Message-Id: <1343346523-25255-1-git-send-email-ben@bwidawsk.net> X-Mailer: git-send-email 1.7.11.3 Cc: Ben Widawsky Subject: [Intel-gfx] [PATCH] drm/i915: PIPE_CONTROL TLB invalidation fix X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org The IVB simulator really doesn't like a TLB invalidate with no post-sync operation, in fact it blows up in an assertion failure. The documentation states that we must issue the TLB invalidate with a CS stall: "Also Requires stall bit ([20] of DW1) set." This patch doesn't comply with the docs, but we're able to satisfy the simulator with this very small change, and I think simulator has historically trumped docs. Note, I don't think this belongs in stable as our TLB invalidation should be correct since we use the global invalidation per batch. Using TLB invalidation is itself only a requirement of HW contexts. Signed-off-by: Ben Widawsky --- drivers/gpu/drm/i915/intel_ringbuffer.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c index c58f1b9..339712a 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.c +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c @@ -198,8 +198,12 @@ intel_emit_post_sync_nonzero_flush(struct intel_ring_buffer *ring) if (ret) return ret; + /* NOTE: we want the TLB invalidate for render ring flush, but it must + * be sent with a non-zero post sync op. So it can be stuffed in here + * for convenience. + */ intel_ring_emit(ring, GFX_OP_PIPE_CONTROL(5)); - intel_ring_emit(ring, PIPE_CONTROL_QW_WRITE); + intel_ring_emit(ring, PIPE_CONTROL_QW_WRITE | PIPE_CONTROL_TLB_INVALIDATE); intel_ring_emit(ring, scratch_addr | PIPE_CONTROL_GLOBAL_GTT); /* address */ intel_ring_emit(ring, 0); intel_ring_emit(ring, 0); @@ -225,10 +229,10 @@ gen6_render_ring_flush(struct intel_ring_buffer *ring, /* Just flush everything. Experiments have shown that reducing the * number of bits based on the write domains has little performance - * impact. + * impact. Note to copy/pasters: the TLB invlidate we want is tucked + * into intel_emit_post_sync_nonzero_flush(). */ flags |= PIPE_CONTROL_RENDER_TARGET_CACHE_FLUSH; - flags |= PIPE_CONTROL_TLB_INVALIDATE; flags |= PIPE_CONTROL_INSTRUCTION_CACHE_INVALIDATE; flags |= PIPE_CONTROL_TEXTURE_CACHE_INVALIDATE; flags |= PIPE_CONTROL_DEPTH_CACHE_FLUSH;