[Intel-gfx] [PATCH v7 05/21] drm/i915/slpc: Sanitize GuC version

Sagar Arun Kamble sagar.a.kamble at intel.com
Wed Mar 22 10:03:38 UTC 2017


From: Tom O'Rourke <Tom.O'Rourke at intel.com>

The SLPC interface is dependent on GuC version.
Only GuC versions known to be compatible are supported here.

SLPC with GuC firmware v9 is supported with this series.

v1: Updated with modified sanitize_slpc_option in earlier patch.

v2-v3: Rebase.

v4: Updated support for GuC firmware v9.

v5: Commit subject updated.

v6: Commit subject and message update. Add support condition as >=v9.

v7: Sanitizing GuC version in intel_uc_init_fw for SLPC compatibility.
    Added info. print for needed version and pointer to 01.org.

Signed-off-by: Tom O'Rourke <Tom.O'Rourke at intel.com>
Signed-off-by: Sagar Arun Kamble <sagar.a.kamble at intel.com>
---
 drivers/gpu/drm/i915/intel_csr.c |  5 -----
 drivers/gpu/drm/i915/intel_uc.c  | 14 ++++++++++++--
 drivers/gpu/drm/i915/intel_uc.h  |  2 ++
 3 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_csr.c b/drivers/gpu/drm/i915/intel_csr.c
index 3683225..b784b7b 100644
--- a/drivers/gpu/drm/i915/intel_csr.c
+++ b/drivers/gpu/drm/i915/intel_csr.c
@@ -49,11 +49,6 @@
 MODULE_FIRMWARE(I915_CSR_BXT);
 #define BXT_CSR_VERSION_REQUIRED	CSR_VERSION(1, 7)
 
-#define FIRMWARE_URL  "https://01.org/linuxgraphics/intel-linux-graphics-firmwares"
-
-
-
-
 #define CSR_MAX_FW_SIZE			0x2FFF
 #define CSR_DEFAULT_FW_OFFSET		0xFFFFFFFF
 
diff --git a/drivers/gpu/drm/i915/intel_uc.c b/drivers/gpu/drm/i915/intel_uc.c
index c0a1d14..8502ead 100644
--- a/drivers/gpu/drm/i915/intel_uc.c
+++ b/drivers/gpu/drm/i915/intel_uc.c
@@ -101,11 +101,21 @@ void intel_uc_init_early(struct drm_i915_private *dev_priv)
 
 void intel_uc_init_fw(struct drm_i915_private *dev_priv)
 {
+	struct intel_uc_fw *guc_fw = &dev_priv->guc.fw;
+
 	if (dev_priv->huc.fw.path)
 		intel_uc_prepare_fw(dev_priv, &dev_priv->huc.fw);
 
-	if (dev_priv->guc.fw.path)
-		intel_uc_prepare_fw(dev_priv, &dev_priv->guc.fw);
+	if (guc_fw->path) {
+		intel_uc_prepare_fw(dev_priv, guc_fw);
+
+		if (guc_fw->major_ver_found < 9) {
+			DRM_INFO("SLPC not supported with GuC firmware v%u,"
+				 " please use v9+ [" FIRMWARE_URL "].\n",
+				 guc_fw->major_ver_found);
+			i915.enable_slpc = 0;
+		}
+	}
 }
 
 int intel_uc_init_hw(struct drm_i915_private *dev_priv)
diff --git a/drivers/gpu/drm/i915/intel_uc.h b/drivers/gpu/drm/i915/intel_uc.h
index a35eded..928c214 100644
--- a/drivers/gpu/drm/i915/intel_uc.h
+++ b/drivers/gpu/drm/i915/intel_uc.h
@@ -130,6 +130,8 @@ struct intel_uc_fw {
 	uint32_t ucode_offset;
 };
 
+#define FIRMWARE_URL  "https://01.org/linuxgraphics/intel-linux-graphics-firmwares"
+
 struct intel_guc_log {
 	uint32_t flags;
 	struct i915_vma *vma;
-- 
1.9.1



More information about the Intel-gfx mailing list