diff mbox series

[2/4] drm/i915/uc: Include HuC firmware version in summary

Message ID 20190811195132.9660-3-michal.wajdeczko@intel.com (mailing list archive)
State New, archived
Headers show
Series Use -EIO code for GuC initialization failures | expand

Commit Message

Michal Wajdeczko Aug. 11, 2019, 7:51 p.m. UTC
After successful uC initialization we are reporting GuC
firmware version and status of GuC submission and HuC.
Add HuC fw version to this report to make it complete,
but also skip all HuC info if HuC is not supported.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/gt/uc/intel_uc.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

Comments

Chris Wilson Aug. 11, 2019, 8:24 p.m. UTC | #1
Quoting Michal Wajdeczko (2019-08-11 20:51:30)
> After successful uC initialization we are reporting GuC
> firmware version and status of GuC submission and HuC.
> Add HuC fw version to this report to make it complete,
> but also skip all HuC info if HuC is not supported.
> 
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  drivers/gpu/drm/i915/gt/uc/intel_uc.c | 16 ++++++++++++----
>  1 file changed, 12 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_uc.c b/drivers/gpu/drm/i915/gt/uc/intel_uc.c
> index aa9701cfc754..2acf7907287c 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_uc.c
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_uc.c
> @@ -503,12 +503,20 @@ int intel_uc_init_hw(struct intel_uc *uc)
>                         goto err_communication;
>         }
>  
> -       dev_info(i915->drm.dev, "GuC firmware version %u.%u\n",
> +       dev_info(i915->drm.dev, "%s firmware version %u.%u\n",
> +                intel_uc_fw_type_repr(INTEL_UC_FW_TYPE_GUC),
>                  guc->fw.major_ver_found, guc->fw.minor_ver_found);
> -       dev_info(i915->drm.dev, "GuC submission %s\n",
> +       dev_info(i915->drm.dev, "%s %s\n", "GuC submission",
>                  enableddisabled(intel_uc_supports_guc_submission(uc)));
> -       dev_info(i915->drm.dev, "HuC %s\n",
> -                enableddisabled(intel_huc_is_authenticated(huc)));
> +
> +       if (intel_uc_supports_huc(uc)) {
> +               dev_info(i915->drm.dev, "%s firmware version %u.%u\n",
> +                        intel_uc_fw_type_repr(INTEL_UC_FW_TYPE_HUC),
> +                        huc->fw.major_ver_found, huc->fw.minor_ver_found);
> +               dev_info(i915->drm.dev, "%s %s\n",
> +                        intel_uc_fw_type_repr(INTEL_UC_FW_TYPE_HUC),
> +                        enableddisabled(intel_huc_is_authenticated(huc)));
> +       }

Could I ask you to squeeze each down to one line?
-Chris
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/gt/uc/intel_uc.c b/drivers/gpu/drm/i915/gt/uc/intel_uc.c
index aa9701cfc754..2acf7907287c 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_uc.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_uc.c
@@ -503,12 +503,20 @@  int intel_uc_init_hw(struct intel_uc *uc)
 			goto err_communication;
 	}
 
-	dev_info(i915->drm.dev, "GuC firmware version %u.%u\n",
+	dev_info(i915->drm.dev, "%s firmware version %u.%u\n",
+		 intel_uc_fw_type_repr(INTEL_UC_FW_TYPE_GUC),
 		 guc->fw.major_ver_found, guc->fw.minor_ver_found);
-	dev_info(i915->drm.dev, "GuC submission %s\n",
+	dev_info(i915->drm.dev, "%s %s\n", "GuC submission",
 		 enableddisabled(intel_uc_supports_guc_submission(uc)));
-	dev_info(i915->drm.dev, "HuC %s\n",
-		 enableddisabled(intel_huc_is_authenticated(huc)));
+
+	if (intel_uc_supports_huc(uc)) {
+		dev_info(i915->drm.dev, "%s firmware version %u.%u\n",
+			 intel_uc_fw_type_repr(INTEL_UC_FW_TYPE_HUC),
+			 huc->fw.major_ver_found, huc->fw.minor_ver_found);
+		dev_info(i915->drm.dev, "%s %s\n",
+			 intel_uc_fw_type_repr(INTEL_UC_FW_TYPE_HUC),
+			 enableddisabled(intel_huc_is_authenticated(huc)));
+	}
 
 	return 0;