From patchwork Mon Jan 27 22:20:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kenneth Graunke X-Patchwork-Id: 3544161 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 847D8C02DC for ; Mon, 27 Jan 2014 22:17:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B2F1520103 for ; Mon, 27 Jan 2014 22:17:00 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id DAC5020109 for ; Mon, 27 Jan 2014 22:16:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 231E8106281; Mon, 27 Jan 2014 14:16:58 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from homiemail-a9.g.dreamhost.com (caiajhbdcagg.dreamhost.com [208.97.132.66]) by gabe.freedesktop.org (Postfix) with ESMTP id 4046C106281 for ; Mon, 27 Jan 2014 14:16:56 -0800 (PST) Received: from homiemail-a9.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a9.g.dreamhost.com (Postfix) with ESMTP id 2084562606A; Mon, 27 Jan 2014 14:16:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=whitecape.org; h=from:to :cc:subject:date:message-id:in-reply-to:references; s= whitecape.org; bh=hjkFQByYaYPehitpqURIzXTjZi4=; b=EASUKRgPcKHI/i PFayG1ic+9cfX0uFzDSuhiUgil2EimKGDtJYP0GvMn5DJ4lhiBdabvXkxKVMOR6A kWAVSBscy+iaWDjpM7v7XsQ2ceUGgMt2ZWrqS62W1jD8ws3lRDJf/HMaw0J84c1Q CjphYlupnz5g4+DgOtoZTtw7iIs/c= Received: from vakarian.ak.intel.com (fruit.freedesktop.org [131.252.210.190]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: kenneth@whitecape.org) by homiemail-a9.g.dreamhost.com (Postfix) with ESMTPSA id A80CB62606F; Mon, 27 Jan 2014 14:16:54 -0800 (PST) From: Kenneth Graunke To: intel-gfx@lists.freedesktop.org Date: Mon, 27 Jan 2014 14:20:15 -0800 Message-Id: <1390861218-11616-2-git-send-email-kenneth@whitecape.org> X-Mailer: git-send-email 1.8.5.2 In-Reply-To: <1390861218-11616-1-git-send-email-kenneth@whitecape.org> References: <1390861218-11616-1-git-send-email-kenneth@whitecape.org> Subject: [Intel-gfx] [PATCH 2/5] drm/i915: Refactor Broadwell PIPE_CONTROL emission into a helper. 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@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We'll want to reuse this for a workaround. Signed-off-by: Kenneth Graunke --- drivers/gpu/drm/i915/intel_ringbuffer.c | 37 ++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c index 313b1bd..4774bfa 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.c +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c @@ -363,12 +363,32 @@ gen7_render_ring_flush(struct intel_ring_buffer *ring, } static int +gen8_emit_pipe_control(struct intel_ring_buffer *ring, + u32 flags, u32 scratch_addr) +{ + int ret; + + ret = intel_ring_begin(ring, 6); + if (ret) + return ret; + + intel_ring_emit(ring, GFX_OP_PIPE_CONTROL(6)); + intel_ring_emit(ring, flags); + intel_ring_emit(ring, scratch_addr); + intel_ring_emit(ring, 0); + intel_ring_emit(ring, 0); + intel_ring_emit(ring, 0); + intel_ring_advance(ring); + + return 0; +} + +static int gen8_render_ring_flush(struct intel_ring_buffer *ring, u32 invalidate_domains, u32 flush_domains) { u32 flags = 0; u32 scratch_addr = ring->scratch.gtt_offset + 128; - int ret; /* For CS stalls, one of the following must also be set: * - Render Target Cache Flush @@ -394,20 +414,7 @@ gen8_render_ring_flush(struct intel_ring_buffer *ring, flags |= PIPE_CONTROL_GLOBAL_GTT_IVB; } - ret = intel_ring_begin(ring, 6); - if (ret) - return ret; - - intel_ring_emit(ring, GFX_OP_PIPE_CONTROL(6)); - intel_ring_emit(ring, flags); - intel_ring_emit(ring, scratch_addr); - intel_ring_emit(ring, 0); - intel_ring_emit(ring, 0); - intel_ring_emit(ring, 0); - intel_ring_advance(ring); - - return 0; - + return gen8_emit_pipe_control(ring, flags, scratch_addr); } static void ring_write_tail(struct intel_ring_buffer *ring,