summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_uc_fw.c
diff options
context:
space:
mode:
authorMichal Wajdeczko2017-10-17 11:44:49 +0200
committerChris Wilson2017-10-17 17:42:56 +0200
commit56ffc7427c2b0b27d732a15e062f0c7cdf62c173 (patch)
tree303df2d9a9a587c5556640999a5e0395165f0475 /drivers/gpu/drm/i915/intel_uc_fw.c
parentdrm/i915: Handle drm-layer errors in intel_dp_add_mst_connector (diff)
downloadkernel-qcow2-linux-56ffc7427c2b0b27d732a15e062f0c7cdf62c173.tar.gz
kernel-qcow2-linux-56ffc7427c2b0b27d732a15e062f0c7cdf62c173.tar.xz
kernel-qcow2-linux-56ffc7427c2b0b27d732a15e062f0c7cdf62c173.zip
drm/i915/uc: Add pretty printer for uc firmware
Debugfs for GuC and HuC load info have similar common part. Move and update dump of uc_fw to separate helper for reuse. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Link: https://patchwork.freedesktop.org/patch/msgid/20171017094449.22584-1-michal.wajdeczko@intel.com Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_uc_fw.c')
-rw-r--r--drivers/gpu/drm/i915/intel_uc_fw.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_uc_fw.c b/drivers/gpu/drm/i915/intel_uc_fw.c
index 7bb0109bfbbd..973888e94cba 100644
--- a/drivers/gpu/drm/i915/intel_uc_fw.c
+++ b/drivers/gpu/drm/i915/intel_uc_fw.c
@@ -23,6 +23,7 @@
*/
#include <linux/firmware.h>
+#include <drm/drm_print.h>
#include "intel_uc_fw.h"
#include "i915_drv.h"
@@ -290,3 +291,28 @@ void intel_uc_fw_fini(struct intel_uc_fw *uc_fw)
uc_fw->fetch_status = INTEL_UC_FIRMWARE_NONE;
}
+
+/**
+ * intel_uc_fw_dump - dump information about uC firmware
+ * @uc_fw: uC firmware
+ * @p: the &drm_printer
+ *
+ * Pretty printer for uC firmware.
+ */
+void intel_uc_fw_dump(struct intel_uc_fw *uc_fw, struct drm_printer *p)
+{
+ drm_printf(p, "%s firmware: %s\n",
+ intel_uc_fw_type_repr(uc_fw->type), uc_fw->path);
+ drm_printf(p, "\tstatus: fetch %s, load %s\n",
+ intel_uc_fw_status_repr(uc_fw->fetch_status),
+ intel_uc_fw_status_repr(uc_fw->load_status));
+ drm_printf(p, "\tversion: wanted %u.%u, found %u.%u\n",
+ uc_fw->major_ver_wanted, uc_fw->minor_ver_wanted,
+ uc_fw->major_ver_found, uc_fw->minor_ver_found);
+ drm_printf(p, "\theader: offset %u, size %u\n",
+ uc_fw->header_offset, uc_fw->header_size);
+ drm_printf(p, "\tuCode: offset %u, size %u\n",
+ uc_fw->ucode_offset, uc_fw->ucode_size);
+ drm_printf(p, "\tRSA: offset %u, size %u\n",
+ uc_fw->rsa_offset, uc_fw->rsa_size);
+}