From patchwork Wed Nov 16 06:11:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "He, Min" X-Patchwork-Id: 9430939 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 C314560469 for ; Wed, 16 Nov 2016 06:20:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B113828BE3 for ; Wed, 16 Nov 2016 06:20:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A237C28BFD; Wed, 16 Nov 2016 06:20:42 +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.2 required=2.0 tests=BAYES_00, 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 3E9B228BE3 for ; Wed, 16 Nov 2016 06:20:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F0B6A6E18E; Wed, 16 Nov 2016 06:20:38 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id B15846E18E for ; Wed, 16 Nov 2016 06:20:37 +0000 (UTC) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP; 15 Nov 2016 22:20:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,646,1473145200"; d="scan'208";a="31431302" Received: from hm-optiplex-9020.sh.intel.com ([10.239.160.130]) by orsmga004.jf.intel.com with ESMTP; 15 Nov 2016 22:20:36 -0800 From: Min He To: intel-gfx@lists.freedesktop.org Date: Wed, 16 Nov 2016 14:11:16 +0800 Message-Id: <1479276676-4060-1-git-send-email-min.he@intel.com> X-Mailer: git-send-email 1.9.1 Subject: [Intel-gfx] [PATCH] drm/i915: fix the dequeue logic for single_port_submission context 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 For a singl_port_submission context, it can only be submitted to port 0, and there shouldn't be any other context in port 1 at the same time. This patch is to implement the correct logic in execlists_dequeue. Signed-off-by: Min He Signed-off-by: Zhenyu Wang --- drivers/gpu/drm/i915/intel_lrc.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c index f50feaa..be83e8c 100644 --- a/drivers/gpu/drm/i915/intel_lrc.c +++ b/drivers/gpu/drm/i915/intel_lrc.c @@ -424,9 +424,6 @@ static bool can_merge_ctx(const struct i915_gem_context *prev, if (prev != next) return false; - if (ctx_single_port_submission(prev)) - return false; - return true; } @@ -477,6 +474,13 @@ static void execlists_dequeue(struct intel_engine_cs *engine) struct drm_i915_gem_request *cursor = rb_entry(rb, typeof(*cursor), priotree.node); + /* If last ctx is single_submission, it means we can only + * submit this context in port 0, and cannot submit another + * context in port 1 at the same time. So we will break here + * in this situation. + */ + if (last && ctx_single_port_submission(last->ctx)) + break; /* Can we combine this request with the current port? It has to * be the same context/ringbuffer and not have any exceptions * (e.g. GVT saying never to combine contexts).