From patchwork Sat Nov 11 00:06:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sundaresan, Sujaritha" X-Patchwork-Id: 10053973 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 82D096032D for ; Sat, 11 Nov 2017 00:10:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 767BB2B514 for ; Sat, 11 Nov 2017 00:10:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6B8ED2B523; Sat, 11 Nov 2017 00:10:58 +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 1FA392B514 for ; Sat, 11 Nov 2017 00:10:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BEF3A6EBD8; Sat, 11 Nov 2017 00:10:57 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 84AE16EBC6 for ; Sat, 11 Nov 2017 00:10:48 +0000 (UTC) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Nov 2017 16:10:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,377,1505804400"; d="scan'208";a="1057219" Received: from sujaritha-z170x-ud5.fm.intel.com ([10.1.27.118]) by orsmga003.jf.intel.com with ESMTP; 10 Nov 2017 16:10:48 -0800 From: Sujaritha Sundaresan To: intel-gfx@lists.freedesktop.org Date: Fri, 10 Nov 2017 16:06:38 -0800 Message-Id: <1510358798-21566-9-git-send-email-sujaritha.sundaresan@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1510358798-21566-1-git-send-email-sujaritha.sundaresan@intel.com> References: <1510358798-21566-1-git-send-email-sujaritha.sundaresan@intel.com> Cc: Sujaritha Sundaresan Subject: [Intel-gfx] [PATCH v9 8/8] drm/i915/guc : Calling intel_guc_init in i915_gem_init 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 Placing the call to intel_guc_init after i915_gem_contexts_init, based on the dependency within i915_gem_init. Will move the function if required, depending on the review comments. Suggested by: Sagar Arun Kamble Signed-off-by: Sujaritha Sundaresan Cc: Chris Wilson Cc: Daniele Ceraolo Spurio Cc: Joonas Lahtinen Cc: Michal Wajdeczko Cc: Oscar Mateo Cc: Sagar Arun Kamble --- drivers/gpu/drm/i915/i915_gem.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 889ae88..c877a5d 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -36,6 +36,7 @@ #include "intel_frontbuffer.h" #include "intel_mocs.h" #include "i915_gemfs.h" +#include "intel_guc.h" #include #include #include @@ -4972,6 +4973,7 @@ bool intel_sanitize_semaphores(struct drm_i915_private *dev_priv, int value) int i915_gem_init(struct drm_i915_private *dev_priv) { + struct intel_guc *guc = &dev_priv->guc; int ret; mutex_lock(&dev_priv->drm.struct_mutex); @@ -5015,6 +5017,18 @@ int i915_gem_init(struct drm_i915_private *dev_priv) if (ret) goto out_unlock; + ret = intel_guc_init(guc); + + if (i915_modparams.enable_guc) { + /* + * This is stuff we need to have available at fw load time + * if we are planning to enable submission later + */ + ret = intel_guc_init(guc); + if (ret) + goto err_shared; + } + ret = intel_engines_init(dev_priv); if (ret) goto out_unlock; @@ -5035,7 +5049,8 @@ int i915_gem_init(struct drm_i915_private *dev_priv) out_unlock: intel_uncore_forcewake_put(dev_priv, FORCEWAKE_ALL); mutex_unlock(&dev_priv->drm.struct_mutex); - +err_shared: + intel_guc_fini(guc); return ret; } @@ -5192,6 +5207,7 @@ void i915_gem_load_cleanup(struct drm_i915_private *dev_priv) rcu_barrier(); i915_gemfs_fini(dev_priv); + intel_guc_fini(&dev_priv->guc); } int i915_gem_freeze(struct drm_i915_private *dev_priv)