aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Wajdeczko <michal.wajdeczko@intel.com>2017-03-30 07:21:12 -0400
committerJoonas Lahtinen <joonas.lahtinen@linux.intel.com>2017-03-31 03:39:39 -0400
commit5e065f1f49a352376f1004cc107712ee9231fee7 (patch)
tree0f609fcb513f77464ef6c1ca6ea5776987c0691c
parent4f1cd3eb16aa83c8a3981dba6815f45dab7e2d84 (diff)
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. v2: moved to the header (Joonas) Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
-rw-r--r--drivers/gpu/drm/i915/intel_uc.c6
-rw-r--r--drivers/gpu/drm/i915/intel_uc.h14
2 files changed, 18 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/intel_uc.c b/drivers/gpu/drm/i915/intel_uc.c
index 19653224b683..aaef4f51a66e 100644
--- a/drivers/gpu/drm/i915/intel_uc.c
+++ b/drivers/gpu/drm/i915/intel_uc.c
@@ -182,10 +182,12 @@ static void fetch_uc_fw(struct drm_i915_private *dev_priv,
182 } 182 }
183 183
184 if (uc_fw->major_ver_wanted == 0 && uc_fw->minor_ver_wanted == 0) { 184 if (uc_fw->major_ver_wanted == 0 && uc_fw->minor_ver_wanted == 0) {
185 DRM_NOTE("Skipping uC firmware version check\n"); 185 DRM_NOTE("Skipping %s firmware version check\n",
186 intel_uc_fw_type_repr(uc_fw->type));
186 } else if (uc_fw->major_ver_found != uc_fw->major_ver_wanted || 187 } else if (uc_fw->major_ver_found != uc_fw->major_ver_wanted ||
187 uc_fw->minor_ver_found < uc_fw->minor_ver_wanted) { 188 uc_fw->minor_ver_found < uc_fw->minor_ver_wanted) {
188 DRM_NOTE("uC firmware version %d.%d, required %d.%d\n", 189 DRM_NOTE("%s firmware version %d.%d, required %d.%d\n",
190 intel_uc_fw_type_repr(uc_fw->type),
189 uc_fw->major_ver_found, uc_fw->minor_ver_found, 191 uc_fw->major_ver_found, uc_fw->minor_ver_found,
190 uc_fw->major_ver_wanted, uc_fw->minor_ver_wanted); 192 uc_fw->major_ver_wanted, uc_fw->minor_ver_wanted);
191 err = -ENOEXEC; 193 err = -ENOEXEC;
diff --git a/drivers/gpu/drm/i915/intel_uc.h b/drivers/gpu/drm/i915/intel_uc.h
index f524387a3e14..7139e31153ad 100644
--- a/drivers/gpu/drm/i915/intel_uc.h
+++ b/drivers/gpu/drm/i915/intel_uc.h
@@ -125,6 +125,20 @@ enum intel_uc_fw_type {
125 INTEL_UC_FW_TYPE_HUC 125 INTEL_UC_FW_TYPE_HUC
126}; 126};
127 127
128/* User-friendly representation of an enum */
129static inline const char *intel_uc_fw_type_repr(enum intel_uc_fw_type type)
130{
131 switch (type) {
132 case INTEL_UC_FW_TYPE_GUC:
133 return "GuC";
134 case INTEL_UC_FW_TYPE_HUC:
135 return "HuC";
136 default:
137 MISSING_CASE(type);
138 return "<invalid>";
139 }
140}
141
128/* 142/*
129 * This structure encapsulates all the data needed during the process 143 * This structure encapsulates all the data needed during the process
130 * of fetching, caching, and loading the firmware image into the GuC. 144 * of fetching, caching, and loading the firmware image into the GuC.