intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: yu.dai@intel.com
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH v2 2/6] drm/i915/guc: Bypass fw loading gracefully if GuC is not supported
Date: Mon,  8 Feb 2016 15:02:49 -0800	[thread overview]
Message-ID: <1454972573-16290-3-git-send-email-yu.dai@intel.com> (raw)
In-Reply-To: <1454972573-16290-1-git-send-email-yu.dai@intel.com>

From: Alex Dai <yu.dai@intel.com>

This is to rework previous patch:

commit 9f9e539f90bcecfdc7b3679d337b7a62d4313205
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Fri Oct 23 11:10:59 2015 +0200

    drm/i915: Shut up GuC errors when it's disabled

There is the case where GuC loading is needed even GuC submission
is disabled. For example, HuC loading and authentication require
GuC to be loaded regardless. In this patch, driver will try to load
the firmware only when it explicitly asks for that by specifying fw
name and version. All other cases are considered as UC_FIRMWARE_NONE
and the loading is bypassed silently.

Signed-off-by: Alex Dai <yu.dai@intel.com>
---
 drivers/gpu/drm/i915/intel_guc_loader.c | 32 +++++++++++---------------------
 1 file changed, 11 insertions(+), 21 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_guc_loader.c b/drivers/gpu/drm/i915/intel_guc_loader.c
index 318b5fd..482a5e4 100644
--- a/drivers/gpu/drm/i915/intel_guc_loader.c
+++ b/drivers/gpu/drm/i915/intel_guc_loader.c
@@ -597,39 +597,29 @@ void intel_guc_ucode_init(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct intel_uc_fw *guc_fw = &dev_priv->guc.guc_fw;
-	const char *fw_path;
+	const char *fw_path = NULL;
+
+	guc_fw->uc_dev = dev;
+	guc_fw->uc_fw_path = NULL;
+	guc_fw->fetch_status = UC_FIRMWARE_NONE;
+	guc_fw->load_status = UC_FIRMWARE_NONE;
 
 	if (!HAS_GUC_SCHED(dev))
 		i915.enable_guc_submission = false;
 
-	if (!HAS_GUC_UCODE(dev)) {
-		fw_path = NULL;
-	} else if (IS_SKYLAKE(dev)) {
+	if (!HAS_GUC_UCODE(dev))
+		return;
+
+	if (IS_SKYLAKE(dev)) {
 		fw_path = I915_SKL_GUC_UCODE;
 		guc_fw->major_ver_wanted = 4;
 		guc_fw->minor_ver_wanted = 3;
-	} else {
-		i915.enable_guc_submission = false;
-		fw_path = "";	/* unknown device */
 	}
 
-	if (!i915.enable_guc_submission)
-		return;
-
-	guc_fw->uc_dev = dev;
-	guc_fw->uc_fw_path = fw_path;
-	guc_fw->fetch_status = UC_FIRMWARE_NONE;
-	guc_fw->load_status = UC_FIRMWARE_NONE;
-
 	if (fw_path == NULL)
 		return;
 
-	if (*fw_path == '\0') {
-		DRM_ERROR("No GuC firmware known for this platform\n");
-		guc_fw->fetch_status = UC_FIRMWARE_FAIL;
-		return;
-	}
-
+	guc_fw->uc_fw_path = fw_path;
 	guc_fw->fetch_status = UC_FIRMWARE_PENDING;
 	DRM_DEBUG_DRIVER("GuC firmware pending, path %s\n", fw_path);
 	intel_uc_fw_fetch(dev, guc_fw);
-- 
2.5.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2016-02-08 23:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-08 23:02 [PATCH v2 0/6] Add HuC loading and authentication support yu.dai
2016-02-08 23:02 ` [PATCH v2 1/6] drm/i915/guc: Make the GuC fw loading helper functions general yu.dai
2016-02-16 15:37   ` Daniel Vetter
2016-02-08 23:02 ` yu.dai [this message]
2016-02-08 23:02 ` [PATCH v2 3/6] drm/i915/huc: Unified css_header struct for GuC and HuC yu.dai
2016-02-08 23:02 ` [PATCH v2 4/6] drm/i915/huc: Add HuC fw loading support yu.dai
2016-02-08 23:02 ` [PATCH v2 5/6] drm/i915/huc: Add debugfs for HuC loading status check yu.dai
2016-02-08 23:02 ` [PATCH v2 6/6] drm/i915/huc: Support HuC authentication yu.dai
2016-02-09  7:15 ` ✓ Fi.CI.BAT: success for Add HuC loading and authentication support Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1454972573-16290-3-git-send-email-yu.dai@intel.com \
    --to=yu.dai@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).