diff mbox

[3/3] drm/i915: Include HuC fw version in error state

Message ID 20170224190530.31482-3-michel.thierry@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Michel Thierry Feb. 24, 2017, 7:05 p.m. UTC
HuC depends on GuC, so be it.

Suggested-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Signed-off-by: Michel Thierry <michel.thierry@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h       |  2 ++
 drivers/gpu/drm/i915/i915_gpu_error.c | 11 +++++++++++
 2 files changed, 13 insertions(+)

Comments

Chris Wilson Feb. 24, 2017, 7:24 p.m. UTC | #1
On Fri, Feb 24, 2017 at 11:05:30AM -0800, Michel Thierry wrote:
> HuC depends on GuC, so be it.
> 
> Suggested-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Signed-off-by: Michel Thierry <michel.thierry@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.h       |  2 ++
>  drivers/gpu/drm/i915/i915_gpu_error.c | 11 +++++++++++
>  2 files changed, 13 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index a331c00523bc..1f949cc4a072 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -958,6 +958,8 @@ struct i915_gpu_state {
>  	u32 dmc_version;
>  	u32 guc_loaded;
>  	u32 guc_version;
> +	u32 huc_loaded;
> +	u32 huc_version;

I'll just ask once if you might consider merging major_ver_found,
minor_ver_found in fw so we don't dance around u16 -> u32 -> u16 so
blatantly.

Patches do what they say, so
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

Just beware the style police.
-Chris
Michal Wajdeczko Feb. 24, 2017, 7:26 p.m. UTC | #2
On Fri, Feb 24, 2017 at 11:05:30AM -0800, Michel Thierry wrote:
> HuC depends on GuC, so be it.
> 
> Suggested-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Signed-off-by: Michel Thierry <michel.thierry@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.h       |  2 ++
>  drivers/gpu/drm/i915/i915_gpu_error.c | 11 +++++++++++
>  2 files changed, 13 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index a331c00523bc..1f949cc4a072 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -958,6 +958,8 @@ struct i915_gpu_state {
>  	u32 dmc_version;
>  	u32 guc_loaded;
>  	u32 guc_version;
> +	u32 huc_loaded;
> +	u32 huc_version;

Same comments as with patch 2/3 (only 2x u16), anyway

Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com>

-Michal

>  
>  	u32 nfence;
>  	u64 fence[I915_MAX_NUM_FENCES];
> diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
> index 63f1b9606b57..d4a78b8317d6 100644
> --- a/drivers/gpu/drm/i915/i915_gpu_error.c
> +++ b/drivers/gpu/drm/i915/i915_gpu_error.c
> @@ -634,6 +634,10 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m,
>  		err_printf(m, "GuC fw version: %d.%d\n",
>  			   error->guc_version >> 16,
>  			   error->guc_version & 0xffff);
> +		err_printf(m, "HuC loaded: %s\n", yesno(error->huc_loaded));
> +		err_printf(m, "HuC fw version: %d.%d\n",
> +			   error->huc_version >> 16,
> +			   error->huc_version & 0xffff);
>  	}
>  
>  	err_printf(m, "EIR: 0x%08x\n", error->eir);
> @@ -1602,12 +1606,19 @@ static void i915_capture_fw_state(struct drm_i915_private *dev_priv,
>  
>  	if (HAS_GUC(dev_priv)) {
>  		struct intel_guc *guc = &dev_priv->guc;
> +		struct intel_huc *huc = &dev_priv->huc;
>  
>  		error->guc_loaded =
>  			(guc->fw.load_status == INTEL_UC_FIRMWARE_SUCCESS);
>  		error->guc_version =
>  			(guc->fw.major_ver_found << 16 |
>  			 guc->fw.minor_ver_found);
> +
> +		error->huc_loaded =
> +			(huc->fw.load_status == INTEL_UC_FIRMWARE_SUCCESS);
> +		error->huc_version =
> +			(huc->fw.major_ver_found << 16 |
> +			 huc->fw.minor_ver_found);
>  	}
>  }
>  
> -- 
> 2.11.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index a331c00523bc..1f949cc4a072 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -958,6 +958,8 @@  struct i915_gpu_state {
 	u32 dmc_version;
 	u32 guc_loaded;
 	u32 guc_version;
+	u32 huc_loaded;
+	u32 huc_version;
 
 	u32 nfence;
 	u64 fence[I915_MAX_NUM_FENCES];
diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
index 63f1b9606b57..d4a78b8317d6 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.c
+++ b/drivers/gpu/drm/i915/i915_gpu_error.c
@@ -634,6 +634,10 @@  int i915_error_state_to_str(struct drm_i915_error_state_buf *m,
 		err_printf(m, "GuC fw version: %d.%d\n",
 			   error->guc_version >> 16,
 			   error->guc_version & 0xffff);
+		err_printf(m, "HuC loaded: %s\n", yesno(error->huc_loaded));
+		err_printf(m, "HuC fw version: %d.%d\n",
+			   error->huc_version >> 16,
+			   error->huc_version & 0xffff);
 	}
 
 	err_printf(m, "EIR: 0x%08x\n", error->eir);
@@ -1602,12 +1606,19 @@  static void i915_capture_fw_state(struct drm_i915_private *dev_priv,
 
 	if (HAS_GUC(dev_priv)) {
 		struct intel_guc *guc = &dev_priv->guc;
+		struct intel_huc *huc = &dev_priv->huc;
 
 		error->guc_loaded =
 			(guc->fw.load_status == INTEL_UC_FIRMWARE_SUCCESS);
 		error->guc_version =
 			(guc->fw.major_ver_found << 16 |
 			 guc->fw.minor_ver_found);
+
+		error->huc_loaded =
+			(huc->fw.load_status == INTEL_UC_FIRMWARE_SUCCESS);
+		error->huc_version =
+			(huc->fw.major_ver_found << 16 |
+			 huc->fw.minor_ver_found);
 	}
 }