summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_uc.h
diff options
context:
space:
mode:
authorMichal Wajdeczko <michal.wajdeczko@intel.com>2017-03-30 13:21:12 +0200
committerJoonas Lahtinen <joonas.lahtinen@linux.intel.com>2017-03-31 09:39:39 +0200
commit5e065f1f49a352376f1004cc107712ee9231fee7 (patch)
tree0f609fcb513f77464ef6c1ca6ea5776987c0691c /drivers/gpu/drm/i915/intel_uc.h
parentdrm/i915/uc: Move intel_uc_fw_status_repr() to intel_uc.h (diff)
downloadlinux-5e065f1f49a352376f1004cc107712ee9231fee7.tar.xz
linux-5e065f1f49a352376f1004cc107712ee9231fee7.zip
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>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_uc.h')
-rw-r--r--drivers/gpu/drm/i915/intel_uc.h14
1 files changed, 14 insertions, 0 deletions
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 {
INTEL_UC_FW_TYPE_HUC
};
+/* User-friendly representation of an enum */
+static inline const char *intel_uc_fw_type_repr(enum intel_uc_fw_type type)
+{
+ switch (type) {
+ case INTEL_UC_FW_TYPE_GUC:
+ return "GuC";
+ case INTEL_UC_FW_TYPE_HUC:
+ return "HuC";
+ default:
+ MISSING_CASE(type);
+ return "<invalid>";
+ }
+}
+
/*
* This structure encapsulates all the data needed during the process
* of fetching, caching, and loading the firmware image into the GuC.