From patchwork Thu Jan 28 10:21:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wang, Zhi A" X-Patchwork-Id: 8148481 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C9303BEEE5 for ; Thu, 28 Jan 2016 10:24:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 06A302034F for ; Thu, 28 Jan 2016 10:24:05 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 1518F2034C for ; Thu, 28 Jan 2016 10:24:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9D1986E7EF; Thu, 28 Jan 2016 02:24:03 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id EBDFC6E7EF for ; Thu, 28 Jan 2016 02:24:00 -0800 (PST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP; 28 Jan 2016 02:24:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,358,1449561600"; d="scan'208";a="870587868" Received: from dev-inno.bj.intel.com ([10.238.135.69]) by orsmga001.jf.intel.com with ESMTP; 28 Jan 2016 02:23:58 -0800 From: Zhi Wang To: intel-gfx@lists.freedesktop.org, igvt-g@lists.01.org Date: Thu, 28 Jan 2016 18:21:29 +0800 Message-Id: <1453976511-27322-8-git-send-email-zhi.a.wang@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1453976511-27322-1-git-send-email-zhi.a.wang@intel.com> References: <1453976511-27322-1-git-send-email-zhi.a.wang@intel.com> Cc: daniel.vetter@ffwll.ch, david.j.cowperthwaite@intel.com Subject: [Intel-gfx] [RFC 07/29] drm/i915: GVT context scheduling 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-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Due to render mmio switch, GVT context cannot be scheduled with the host i915 context together in a ELSP combo. Currently we will only allow the a single submission if host i915 will schedule a GVT context. At the time of schedule-in/out a GVT context, host i915 has to notify GVT-g the status of GVT context has been changed. so that GVT-g can copy the content of a GVT context back into the guest execlist context. Signed-off-by: Zhi Wang --- drivers/gpu/drm/i915/intel_lrc.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c index 830133d..42638e0 100644 --- a/drivers/gpu/drm/i915/intel_lrc.c +++ b/drivers/gpu/drm/i915/intel_lrc.c @@ -449,6 +449,9 @@ static void execlists_context_unqueue(struct intel_engine_cs *ring) execlist_link) { if (!req0) { req0 = cursor; + /* single submission for gvt context */ + if (req0->ctx->gvt_context) + break; } else if (req0->ctx == cursor->ctx) { /* Same ctx: ignore first request, as second request * will update tail past first request's workload */ @@ -457,7 +460,9 @@ static void execlists_context_unqueue(struct intel_engine_cs *ring) &ring->execlist_retired_req_list); req0 = cursor; } else { - req1 = cursor; + if (!cursor->ctx->gvt_context) + req1 = cursor; + break; } } @@ -484,6 +489,11 @@ static void execlists_context_unqueue(struct intel_engine_cs *ring) WARN_ON(req1 && req1->elsp_submitted); + if (req0->ctx->gvt_context) { + struct intel_context *ctx = req0->ctx; + ctx->gvt_context_schedule_in(ctx->gvt_context_private_data[ring->id]); + } + execlists_submit_requests(req0, req1); } @@ -504,6 +514,10 @@ static bool execlists_check_remove_request(struct intel_engine_cs *ring, "Never submitted head request\n"); if (--head_req->elsp_submitted <= 0) { + if (head_req->ctx->gvt_context) { + struct intel_context *ctx = head_req->ctx; + ctx->gvt_context_schedule_out(ctx->gvt_context_private_data[ring->id]); + } list_move_tail(&head_req->execlist_link, &ring->execlist_retired_req_list); return true;