From patchwork Sun May 15 17:32:46 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: 9096721 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 DF1EDBF29F for ; Sun, 15 May 2016 17:39:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 135D82026C for ; Sun, 15 May 2016 17:39:50 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 3320C2013A for ; Sun, 15 May 2016 17:39:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D057F6E3A8; Sun, 15 May 2016 17:39:47 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id 706786E39F for ; Sun, 15 May 2016 17:38:21 +0000 (UTC) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP; 15 May 2016 10:38:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,623,1455004800"; d="scan'208";a="977259737" Received: from dev-inno.bj.intel.com ([10.238.135.69]) by orsmga002.jf.intel.com with ESMTP; 15 May 2016 10:38:19 -0700 From: Zhi Wang To: intel-gfx@lists.freedesktop.org, david.s.gordon@intel.com, joonas.lahtinen@linux.intel.com, kevin.tian@intel.com, zhiyuan.lv@intel.com Date: Mon, 16 May 2016 01:32:46 +0800 Message-Id: <1463333573-25112-9-git-send-email-zhi.a.wang@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1463333573-25112-1-git-send-email-zhi.a.wang@intel.com> References: <1463333573-25112-1-git-send-email-zhi.a.wang@intel.com> Subject: [Intel-gfx] [PATCH 08/15] drm/i915: Introduce an option for skipping engine context initialization 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=-5.6 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 GVT-g will copy guest context into GVT LRC context before using it, so engine context initialization is not necessary. This patch introduces an option, and caller could configure it to choose if the engine context initialization should be skipped. Signed-off-by: Zhi Wang --- drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/intel_lrc.c | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index c4c72ee..48f4d6e 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -882,6 +882,7 @@ struct intel_context { u64 lrc_desc; uint32_t *lrc_reg_state; bool initialised; + bool skip_init_context; } engine[I915_NUM_ENGINES]; struct list_head link; diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c index c8fbdfb..08eeaf3 100644 --- a/drivers/gpu/drm/i915/intel_lrc.c +++ b/drivers/gpu/drm/i915/intel_lrc.c @@ -2478,6 +2478,13 @@ uint32_t intel_lr_context_size(struct intel_engine_cs *engine) return ret; } +static bool engine_initialised(struct intel_context *ctx, + struct intel_engine_cs *engine) +{ + return engine->init_context == NULL + || ctx->engine[engine->id].skip_init_context; +} + /** * execlists_context_deferred_alloc() - create the LRC specific bits of a context * @ctx: LR context to create. @@ -2527,7 +2534,7 @@ static int execlists_context_deferred_alloc(struct intel_context *ctx, ctx->engine[engine->id].ringbuf = ringbuf; ctx->engine[engine->id].state = ctx_obj; - ctx->engine[engine->id].initialised = engine->init_context == NULL; + ctx->engine[engine->id].initialised = engine_initialised(ctx, engine); return 0;