From patchwork Fri Sep 9 13:11:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 9323363 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 5C7A760231 for ; Fri, 9 Sep 2016 13:12:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4F7CC29DD3 for ; Fri, 9 Sep 2016 13:12:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 420F229E9E; Fri, 9 Sep 2016 13:12:10 +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 8190C29DD3 for ; Fri, 9 Sep 2016 13:12:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E70526E855; Fri, 9 Sep 2016 13:12:07 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3B8626E855 for ; Fri, 9 Sep 2016 13:12:07 +0000 (UTC) Received: by mail-wm0-x244.google.com with SMTP id w12so2719143wmf.1 for ; Fri, 09 Sep 2016 06:12:07 -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=NEcJ6MO5Dj5k5TFoXgIyhbfabM81LYz4oWDngbVZnE4=; b=HXYbjWXOD8DcRx4G8mkRZ20sP9diExJpNS2sE3y6l3fgHjBiXTCjhnQRuEsZrRfECn 6sNdQqOUJPi+ogfk8rHwwTFg8bIdoZA28xoccr9k7dcpp4wYTisdUcY1lSnTOmpeWJKi Y3mGJJx28PsqMqX2b4gcezk0gNdB5ruUI1RjcQK3oWCKsP2uSG7zrV0ZW5REhkeKUxyU 70d17fDGw6ZRBiem1+JGn53vUB9nFRnvxCuSe4UxS6Cu4cUaxHSfV87bzrCGoOIqT5Lu mcdghCzZAAbqolo9UqKgyDmGotH4uLvmifvfPcYR59uLn+Tkq047LEmo6eJcfSV7oY1h ANUQ== 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=NEcJ6MO5Dj5k5TFoXgIyhbfabM81LYz4oWDngbVZnE4=; b=HgGp2RPhOCnqJviZBRIqLVcdyp75JmXQyIEH1BM+ARmf08cxTRqaXIvxQQNRCRkPsI XYpPwzBtEtfdNXuP3cYN+YQRt/36EIahw9xKC200b0HTL8bq1cd8Q0/lvLUuzRUrt7QM aiK4XB0VGMgN0l3RQTld6S62V4aT9DNKawsJYXSTNEcgMB7+GmQD1Tx+H08hjP7Ic8Uc hPIvyQlYTFbtJqbiiFgIe0WYFFw75Vtp0p/U6x+/Jiyl61usHQD5ovk4WNexY5pEYy+H mYi+JxBGJzkw8cvkedb8HGb3v0aMTgtMR57CyMguidGqz92DnPZ3CAxBr8IJ1JOphLZk 9zzg== X-Gm-Message-State: AE9vXwMf1Hw1sj3qj5fRu6w2pHsSftmXbgO4JKQzQLVvFO1pc/ZVlTvFEzB7sm1fIL6yrA== X-Received: by 10.194.216.37 with SMTP id on5mr3100864wjc.158.1473426725748; Fri, 09 Sep 2016 06:12:05 -0700 (PDT) Received: from haswell.alporthouse.com ([78.156.65.138]) by smtp.gmail.com with ESMTPSA id u124sm3330468wmu.10.2016.09.09.06.12.04 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Sep 2016 06:12:05 -0700 (PDT) From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Fri, 9 Sep 2016 14:11:42 +0100 Message-Id: <20160909131201.16673-2-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20160909131201.16673-1-chris@chris-wilson.co.uk> References: <20160909131201.16673-1-chris@chris-wilson.co.uk> Subject: [Intel-gfx] [CI 02/21] drm/i915: Only queue requests during execlists submission 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 Leave the more complicated request dequeueing to the tasklet and instead just kick start the tasklet if we detect we are adding the first request. v2: Play around with list operators until we agree upon something Signed-off-by: Chris Wilson Cc: Mika Kuoppala Reviewed-by: Mika Kuoppala --- drivers/gpu/drm/i915/intel_lrc.c | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c index 92bfe47ad33c..9bfe304c5256 100644 --- a/drivers/gpu/drm/i915/intel_lrc.c +++ b/drivers/gpu/drm/i915/intel_lrc.c @@ -609,35 +609,15 @@ static void intel_lrc_irq_handler(unsigned long data) static void execlists_submit_request(struct drm_i915_gem_request *request) { struct intel_engine_cs *engine = request->engine; - struct drm_i915_gem_request *cursor; - int num_elements = 0; spin_lock_bh(&engine->execlist_lock); - list_for_each_entry(cursor, &engine->execlist_queue, execlist_link) - if (++num_elements > 2) - break; - - if (num_elements > 2) { - struct drm_i915_gem_request *tail_req; - - tail_req = list_last_entry(&engine->execlist_queue, - struct drm_i915_gem_request, - execlist_link); - - if (request->ctx == tail_req->ctx) { - WARN(tail_req->elsp_submitted != 0, - "More than 2 already-submitted reqs queued\n"); - list_del(&tail_req->execlist_link); - i915_gem_request_put(tail_req); - } - } - i915_gem_request_get(request); - list_add_tail(&request->execlist_link, &engine->execlist_queue); request->ctx_hw_id = request->ctx->hw_id; - if (num_elements == 0) - execlists_unqueue(engine); + + if (list_empty(&engine->execlist_queue)) + tasklet_hi_schedule(&engine->irq_tasklet); + list_add_tail(&request->execlist_link, &engine->execlist_queue); spin_unlock_bh(&engine->execlist_lock); }