[03/21] drm/i915/slpc: Add slpc_version_check

Submitted by tom.orourke@intel.com on April 28, 2016, 1:10 a.m.

Details

Message ID 1461805865-212590-4-git-send-email-tom.orourke@intel.com
State New
Headers show
Series "Add support for GuC-based SLPC" ( rev: 4 ) in Intel GFX

Not browsing as part of any series.

Commit Message

tom.orourke@intel.com April 28, 2016, 1:10 a.m.
From: Tom O'Rourke <Tom.O'Rourke@intel.com>

The SLPC interface has changed and could continue to
change.  Only GuC versions known to be compatible are
supported here.

On Skylake, GuC firmware v6 is supported.  Other
platforms and versions can be added here later.

This patch also adds has_slpc to skylake info.

v2: Move slpc_version_check to intel_guc_ucode_init
v3: fix whitespace (Sagar)
---
 drivers/gpu/drm/i915/i915_drv.c         |  1 +
 drivers/gpu/drm/i915/intel_guc_loader.c | 14 ++++++++++++++
 2 files changed, 15 insertions(+)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index d37c0a6..cc22fa0 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -334,6 +334,7 @@  static const struct intel_device_info intel_skylake_info = {
 	BDW_FEATURES,
 	.is_skylake = 1,
 	.gen = 9,
+	.has_slpc = 1,
 };
 
 static const struct intel_device_info intel_skylake_gt3_info = {
diff --git a/drivers/gpu/drm/i915/intel_guc_loader.c b/drivers/gpu/drm/i915/intel_guc_loader.c
index 876e5da..87702cd 100644
--- a/drivers/gpu/drm/i915/intel_guc_loader.c
+++ b/drivers/gpu/drm/i915/intel_guc_loader.c
@@ -116,6 +116,18 @@  static void direct_interrupts_to_guc(struct drm_i915_private *dev_priv)
 	I915_WRITE(GUC_WD_VECS_IER, ~irqs);
 }
 
+static void slpc_version_check(struct drm_device *dev,
+			       struct intel_guc_fw *guc_fw)
+{
+	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_device_info *info;
+
+	if (IS_SKYLAKE(dev) && (guc_fw->guc_fw_major_found != 6)) {
+		info = (struct intel_device_info *) &dev_priv->info;
+		info->has_slpc = 0;
+	}
+}
+
 static u32 get_gttype(struct drm_i915_private *dev_priv)
 {
 	/* XXX: GT type based on PCI device ID? field seems unused by fw */
@@ -666,6 +678,8 @@  void intel_guc_ucode_init(struct drm_device *dev)
 	DRM_DEBUG_DRIVER("GuC firmware pending, path %s\n", fw_path);
 	guc_fw_fetch(dev, guc_fw);
 	/* status must now be FAIL or SUCCESS */
+
+	slpc_version_check(dev, guc_fw);
 }
 
 /**

Comments

On Wed, Apr 27, 2016 at 06:10:47PM -0700, tom.orourke@intel.com wrote:
> From: Tom O'Rourke <Tom.O'Rourke@intel.com>
> 
> The SLPC interface has changed and could continue to
> change.  Only GuC versions known to be compatible are
> supported here.
> 
> On Skylake, GuC firmware v6 is supported.  Other
> platforms and versions can be added here later.
> 
> This patch also adds has_slpc to skylake info.
> 
> v2: Move slpc_version_check to intel_guc_ucode_init
> v3: fix whitespace (Sagar)
> ---
>  drivers/gpu/drm/i915/i915_drv.c         |  1 +
>  drivers/gpu/drm/i915/intel_guc_loader.c | 14 ++++++++++++++
>  2 files changed, 15 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index d37c0a6..cc22fa0 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -334,6 +334,7 @@ static const struct intel_device_info intel_skylake_info = {
>  	BDW_FEATURES,
>  	.is_skylake = 1,
>  	.gen = 9,
> +	.has_slpc = 1,
>  };
>  
>  static const struct intel_device_info intel_skylake_gt3_info = {
> diff --git a/drivers/gpu/drm/i915/intel_guc_loader.c b/drivers/gpu/drm/i915/intel_guc_loader.c
> index 876e5da..87702cd 100644
> --- a/drivers/gpu/drm/i915/intel_guc_loader.c
> +++ b/drivers/gpu/drm/i915/intel_guc_loader.c
> @@ -116,6 +116,18 @@ static void direct_interrupts_to_guc(struct drm_i915_private *dev_priv)
>  	I915_WRITE(GUC_WD_VECS_IER, ~irqs);
>  }
>  
> +static void slpc_version_check(struct drm_device *dev,
> +			       struct intel_guc_fw *guc_fw)
> +{
> +	struct drm_i915_private *dev_priv = dev->dev_private;
> +	struct intel_device_info *info;
> +
> +	if (IS_SKYLAKE(dev) && (guc_fw->guc_fw_major_found != 6)) {
> +		info = (struct intel_device_info *) &dev_priv->info;
> +		info->has_slpc = 0;

dev_priv->info.has_slpc = 0;

And pass around dev_priv. Nothing here uses dev.
-Chris