From patchwork Wed Apr 25 11:45:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lionel Landwerlin X-Patchwork-Id: 10362853 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 0B15460225 for ; Wed, 25 Apr 2018 11:46:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F0D2E2847E for ; Wed, 25 Apr 2018 11:46:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E5ABA28A42; Wed, 25 Apr 2018 11:46:51 +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 A2DAC2847E for ; Wed, 25 Apr 2018 11:46:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9067A6E5A5; Wed, 25 Apr 2018 11:46:50 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id AD6E96E247 for ; Wed, 25 Apr 2018 11:46:40 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Apr 2018 04:46:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,326,1520924400"; d="scan'208";a="49810011" Received: from delly.ld.intel.com ([10.103.238.202]) by fmsmga001.fm.intel.com with ESMTP; 25 Apr 2018 04:46:39 -0700 From: Lionel Landwerlin To: intel-gfx@lists.freedesktop.org Date: Wed, 25 Apr 2018 12:45:18 +0100 Message-Id: <20180425114521.7524-6-lionel.g.landwerlin@intel.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180425114521.7524-1-lionel.g.landwerlin@intel.com> References: <20180425114521.7524-1-lionel.g.landwerlin@intel.com> Subject: [Intel-gfx] [PATCH 5/8] drm/i915: pass wa_ctx as argument 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 Rather than accessing it from the engine structure. This will be used for reprogramming later. Signed-off-by: Lionel Landwerlin --- drivers/gpu/drm/i915/intel_lrc.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c index 56515091beb4..7a5efab3e4fb 100644 --- a/drivers/gpu/drm/i915/intel_lrc.c +++ b/drivers/gpu/drm/i915/intel_lrc.c @@ -1586,7 +1586,8 @@ gen10_init_indirectctx_bb(struct intel_engine_cs *engine, u32 *batch) #define CTX_WA_BB_OBJ_SIZE (PAGE_SIZE) -static int lrc_setup_wa_ctx(struct intel_engine_cs *engine) +static int lrc_setup_wa_ctx(struct intel_engine_cs *engine, + struct i915_ctx_workarounds *wa_ctx) { struct drm_i915_gem_object *obj; struct i915_vma *vma; @@ -1606,7 +1607,7 @@ static int lrc_setup_wa_ctx(struct intel_engine_cs *engine) if (err) goto err; - engine->wa_ctx.vma = vma; + wa_ctx->vma = vma; return 0; err: @@ -1621,9 +1622,9 @@ static void lrc_destroy_wa_ctx(struct intel_engine_cs *engine) typedef u32 *(*wa_bb_func_t)(struct intel_engine_cs *engine, u32 *batch); -static int intel_init_workaround_bb(struct intel_engine_cs *engine) +static int intel_init_workaround_bb(struct intel_engine_cs *engine, + struct i915_ctx_workarounds *wa_ctx) { - struct i915_ctx_workarounds *wa_ctx = &engine->wa_ctx; struct i915_wa_ctx_bb *wa_bb[2] = { &wa_ctx->indirect_ctx, &wa_ctx->per_ctx }; wa_bb_func_t wa_bb_fn[2]; @@ -1653,7 +1654,7 @@ static int intel_init_workaround_bb(struct intel_engine_cs *engine) return 0; } - ret = lrc_setup_wa_ctx(engine); + ret = lrc_setup_wa_ctx(engine, wa_ctx); if (ret) { DRM_DEBUG_DRIVER("Failed to setup context WA page: %d\n", ret); return ret; @@ -2306,7 +2307,7 @@ int logical_render_ring_init(struct intel_engine_cs *engine) if (ret) return ret; - ret = intel_init_workaround_bb(engine); + ret = intel_init_workaround_bb(engine, &engine->wa_ctx); if (ret) { /* * We continue even if we fail to initialize WA batch