From patchwork Fri Sep 9 11:00:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 9322931 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B5BB960231 for ; Fri, 9 Sep 2016 11:01:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A85DC29DE1 for ; Fri, 9 Sep 2016 11:01:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9C7A529DE5; Fri, 9 Sep 2016 11:01:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 53B3A29DE1 for ; Fri, 9 Sep 2016 11:01:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DF49B6E781; Fri, 9 Sep 2016 11:01:11 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id E2E336E781 for ; Fri, 9 Sep 2016 11:01:09 +0000 (UTC) Received: by mail-wm0-x241.google.com with SMTP id b187so2222019wme.0 for ; Fri, 09 Sep 2016 04:01:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=cXaIp+BTnDFdgjxwCy0pFSmt0UEdsAENVmpYOoNFses=; b=syw8YaPhoDObbKWhZWL693+AkVjd3+g/nQ1W501ijrukleonrvUftvruop3kRJCCdU BNdIO+1AMpas2N92+Yd4Y6iRszaQ+wrQc0fWT14Jxt73VF1TeynM3WsGqwhSNc5Xck1i kJ02vjhXVhWkL+ylAQEqhqE7n43RAzjm0puZaqUHpyMRAd/Df05B9vcwvY5o5mXRJMpW tEzU/T9/arfuAp9auMxXnyeUN9xHUKM6vcxwUAyX5ylqtRTmsGebPc7YUU/oLTu5f2ra 4ofOZ/hX5nqeeuJ/INt9HkERvlGzrIGGHwQdbC5ZVjGlEtRSiIO+c4hrCuEP+hS27EY9 S6Qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=cXaIp+BTnDFdgjxwCy0pFSmt0UEdsAENVmpYOoNFses=; b=TX4BgkrypBJjyARkHGPwuklzKCXZaQ/pLpmpdHLleKuPoeZ1OiJmgNfJH9W9lU82tS qutafQJU/F9TFZAeN0sw2VTw2nLuKcQuQpc4Gbya99jiQ0poDqH8QXqQp+fZShJguvWu JueE9KaQXkdP0F8E6cob26sX730lVVHZF5raxBFaiSqo3B0W5gDkqFSv/kZTA8BVliTG CW1f7DdPsTnl6eEn47zMBoU4GCyj/pFJl98UPmjRo97NIQ4gK22ZgO55kmuZtIl2igro NR4B+m6uEBWPzig7uDRB8R7rgMXnrnOJ+r2Wc1osOoh6GP9xUjznM7uypP0sAfzsEVHt fX9Q== X-Gm-Message-State: AE9vXwO9/ZJwT70qBWgrfyBmrWo70kbD646+R8GendlnsoQOh70GJEEZehHEX/uGaMrgXw== X-Received: by 10.28.142.83 with SMTP id q80mr2237875wmd.92.1473418868218; Fri, 09 Sep 2016 04:01:08 -0700 (PDT) Received: from haswell.alporthouse.com ([78.156.65.138]) by smtp.gmail.com with ESMTPSA id kq2sm2786494wjc.41.2016.09.09.04.01.06 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Sep 2016 04:01:07 -0700 (PDT) From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Fri, 9 Sep 2016 12:00:43 +0100 Message-Id: <20160909110101.31967-3-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20160909110101.31967-1-chris@chris-wilson.co.uk> References: <20160909110101.31967-1-chris@chris-wilson.co.uk> Subject: [Intel-gfx] [CI 03/21] drm/i915: Record the position of the workarounds in the tail of the request X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Rather than blindly assuming we need to advance the tail for resubmitting the request via the ELSP, record the position. Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala --- drivers/gpu/drm/i915/i915_gem_request.h | 15 +++++++++------ drivers/gpu/drm/i915/intel_lrc.c | 4 ++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem_request.h b/drivers/gpu/drm/i915/i915_gem_request.h index 91014de8bfbc..2faa3bb4c39b 100644 --- a/drivers/gpu/drm/i915/i915_gem_request.h +++ b/drivers/gpu/drm/i915/i915_gem_request.h @@ -88,20 +88,23 @@ struct drm_i915_gem_request { */ u32 previous_seqno; - /** Position in the ringbuffer of the start of the request */ + /** Position in the ring of the start of the request */ u32 head; /** - * Position in the ringbuffer of the start of the postfix. - * This is required to calculate the maximum available ringbuffer - * space without overwriting the postfix. + * Position in the ring of the start of the postfix. + * This is required to calculate the maximum available ring space + * without overwriting the postfix. */ u32 postfix; - /** Position in the ringbuffer of the end of the whole request */ + /** Position in the ring of the end of the whole request */ u32 tail; - /** Preallocate space in the ringbuffer for the emitting the request */ + /** Position in the ring of the end of any workarounds after the tail */ + u32 wa_tail; + + /** Preallocate space in the ring for the emitting the request */ u32 reserved_space; /** diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c index 9bfe304c5256..d7fa9b3a55c3 100644 --- a/drivers/gpu/drm/i915/intel_lrc.c +++ b/drivers/gpu/drm/i915/intel_lrc.c @@ -482,8 +482,7 @@ static void execlists_unqueue(struct intel_engine_cs *engine) * resubmit the request. See gen8_emit_request() for where we * prepare the padding after the end of the request. */ - req0->tail += 8; - req0->tail &= req0->ring->size - 1; + req0->tail = req0->wa_tail; } execlists_elsp_submit_contexts(req0, req1); @@ -711,6 +710,7 @@ intel_logical_ring_advance(struct drm_i915_gem_request *request) intel_ring_emit(ring, MI_NOOP); intel_ring_emit(ring, MI_NOOP); intel_ring_advance(ring); + request->wa_tail = ring->tail; /* We keep the previous context alive until we retire the following * request. This ensures that any the context object is still pinned