From patchwork Mon May 14 09:37:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 10397667 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 961C16038F for ; Mon, 14 May 2018 09:37:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 84AD3290C4 for ; Mon, 14 May 2018 09:37:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 79B22290F1; Mon, 14 May 2018 09:37:41 +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=-5.2 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED 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 3956D290C4 for ; Mon, 14 May 2018 09:37:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D74B36E04B; Mon, 14 May 2018 09:37:39 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from fireflyinternet.com (mail.fireflyinternet.com [109.228.58.192]) by gabe.freedesktop.org (Postfix) with ESMTPS id 28FF16E035 for ; Mon, 14 May 2018 09:37:34 +0000 (UTC) X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.65.138; Received: from haswell.alporthouse.com (unverified [78.156.65.138]) by fireflyinternet.com (Firefly Internet (M1)) with ESMTP id 11694391-1500050 for multiple; Mon, 14 May 2018 10:37:25 +0100 Received: by haswell.alporthouse.com (sSMTP sendmail emulation); Mon, 14 May 2018 10:37:26 +0100 From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Mon, 14 May 2018 10:37:07 +0100 Message-Id: <20180514093710.7730-8-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180514093710.7730-1-chris@chris-wilson.co.uk> References: <20180514093710.7730-1-chris@chris-wilson.co.uk> X-Originating-IP: 78.156.65.138 X-Country: code=GB country="United Kingdom" ip=78.156.65.138 Subject: [Intel-gfx] [PATCH 07/10] drm/i915: Rearrange gen8_cs_irq_handler X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 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 After using direct submission from the irq handler, it is very likely that the ENGINE_IRQ_EXECLISTS bit is unset and so we do not need to test it first. It also follows that we then want to do a direct submission evertime the irq_posted bit is set, and can use that as our boolean rather than a separate local. Signed-off-by: Chris Wilson --- drivers/gpu/drm/i915/i915_irq.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index e1b3a7575fe7..034c603867e6 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c @@ -1459,31 +1459,21 @@ static void snb_gt_irq_handler(struct drm_i915_private *dev_priv, ivybridge_parity_error_irq_handler(dev_priv, gt_iir); } -static void -gen8_cs_irq_handler(struct intel_engine_cs *engine, u32 iir) +static void gen8_cs_irq_handler(struct intel_engine_cs *engine, u32 iir) { struct intel_engine_execlists * const execlists = &engine->execlists; - bool tasklet = false; if (iir & GT_CONTEXT_SWITCH_INTERRUPT && READ_ONCE(execlists->active)) - tasklet = !test_and_set_bit(ENGINE_IRQ_EXECLIST, - &engine->irq_posted); + set_bit(ENGINE_IRQ_EXECLIST, &engine->irq_posted); if (iir & GT_RENDER_USER_INTERRUPT) { + if (USES_GUC_SUBMISSION(engine->i915)) + set_bit(ENGINE_IRQ_EXECLIST, &engine->irq_posted); + notify_ring(engine); - /* - * notify_ring() may trigger direct submission onto this - * engine, clearing the ENGINE_IRQ_EXECLIST bit. In that - * case, we don't want to resubmit and so clear the tasklet - * boolean. GuC never sets the ENGINE_IRQ_EXECLIST bit and - * so when using the GuC this equates to an unconditional - * setting of tasklet to true. - */ - if (!test_bit(ENGINE_IRQ_EXECLIST, &engine->irq_posted)) - tasklet = USES_GUC_SUBMISSION(engine->i915); } - if (tasklet) + if (engine && test_bit(ENGINE_IRQ_EXECLIST, &engine->irq_posted)) i915_tasklet(&execlists->tasklet); }