drm/i915/uc: Add intel_uc_fw_type_repr()
Subsystems (2)
PATCH 2/5 drm/i915/uc: Add intel_uc_fw_type_repr()
Some of the DRM_NOTE messages are just using "uC" without specifying which uc they are related to. We can be more user friendly.
Signed-off-by Michal Wajdeczko <[email protected]>
Cc Arkadiusz Hiler <[email protected]>
Cc Joonas Lahtinen <[email protected]>
--- drivers/gpu/drm/i915/intel_uc.c | 19 +++++++++++++++++-- drivers/gpu/drm/i915/intel_uc.h | 1 + 2 files changed, 18 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_uc.c +17 -2
@@ -44,6 +44,19 @@ const char *intel_uc_fw_status_repr(enum intel_uc_fw_status status) } } +/* User-friendly representation of an enum */ +const char *intel_uc_fw_type_repr (enum intel_uc_fw_type status) +{ +switch (status) { +case INTEL_UC_FW_TYPE_GUC : +return "GuC" ; +case INTEL_UC_FW_TYPE_HUC : +return "HuC" ; +default : +return "<invalid>" ; + } +} +/* Reset GuC providing us with fresh state for both GuC and HuC. */ static int __intel_uc_reset_hw (struct drm_i915_private *dev_priv)
@@ -200,10 +213,12 @@ static void fetch_uc_fw(struct drm_i915_private *dev_priv, }if (uc_fw->major_ver_wanted ==0 && uc_fw->minor_ver_wanted ==0 ) { -DRM_NOTE ("Skipping uC firmware version check\n" ); +DRM_NOTE ("Skipping %s firmware version check\n" , +intel_uc_fw_type_repr (uc_fw->type)); }else if (uc_fw->major_ver_found != uc_fw->major_ver_wanted || uc_fw->minor_ver_found < uc_fw->minor_ver_wanted) { -DRM_NOTE ("uC firmware version %d.%d, required %d.%d\n" , +DRM_NOTE ("%s firmware version %d.%d, required %d.%d\n" , +intel_uc_fw_type_repr (uc_fw->type), uc_fw->major_ver_found, uc_fw->minor_ver_found, uc_fw->major_ver_wanted, uc_fw->minor_ver_wanted); err = -ENOEXEC ;
drivers/gpu/drm/i915/intel_uc.h +1 -0
@@ -192,6 +192,7 @@ struct intel_huc {/* intel_uc.c */ const char *intel_uc_fw_status_repr (enum intel_uc_fw_status status); +const char *intel_uc_fw_type_repr (enum intel_uc_fw_type status);void intel_uc_sanitize_options (struct drm_i915_private *dev_priv);void intel_uc_init_early (struct drm_i915_private *dev_priv);void intel_uc_init_fw (struct drm_i915_private *dev_priv);
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 6 lines · Michal Wajdeczko
Some of the
DRM_NOTEmessages are just using "uC" without specifying which uc they are related to. We can be more user friendly.Signed-off-by Michal Wajdeczko <[email protected]>Cc Arkadiusz Hiler <[email protected]>Cc Joonas Lahtinen <[email protected]>
<SNIP>
drivers/gpu/drm/i915/intel_uc.c const char *intel_uc_fw_status_repr(enum intel_uc_fw_status status) · line 48
Quoted 6 lines
(quoted diff) +0
-0@@ -44,6 +44,19 @@ const char *intel_uc_fw_status_repr(enum intel_uc_fw_status status) } }drivers/gpu/drm/i915/intel_uc.c +2
-0+/* User-friendly representation of an enum */ +const char *intel_uc_fw_type_repr (enum intel_uc_fw_type status)
This could too, be in the header.
drivers/gpu/drm/i915/intel_uc.c const char *intel_uc_fw_status_repr(enum intel_uc_fw_status status) · line 55
Quoted 7 lines
drivers/gpu/drm/i915/intel_uc.c +7
-0+{ +switch (status) { +case INTEL_UC_FW_TYPE_GUC : +return "GuC" ; +case INTEL_UC_FW_TYPE_HUC : +return "HuC" ; +default :
Add MISSING_CASE(status) and this is;
Reviewed-by Joonas Lahtinen <[email protected]>
Quoted 3 lines
drivers/gpu/drm/i915/intel_uc.c +3
-0+return "<invalid>" ; + } +}
<SNIP>
Signature · 7 lines
Joonas Lahtinen Open Source Technology Center Intel Corporation _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx