summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/xe/xe_debugfs.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/drivers/gpu/drm/xe/xe_debugfs.c b/drivers/gpu/drm/xe/xe_debugfs.c
index 3c018dbccc07..8c391c7b017a 100644
--- a/drivers/gpu/drm/xe/xe_debugfs.c
+++ b/drivers/gpu/drm/xe/xe_debugfs.c
@@ -21,6 +21,7 @@
#include "xe_guc_ads.h"
#include "xe_hw_engine.h"
#include "xe_mmio.h"
+#include "xe_pcode.h"
#include "xe_pm.h"
#include "xe_psmi.h"
#include "xe_pxp_debugfs.h"
@@ -160,6 +161,22 @@ static int workaround_info(struct seq_file *m, void *data)
return 0;
}
+static int pcode_info(struct seq_file *m, void *data)
+{
+ struct xe_device *xe = node_to_xe(m->private);
+ struct drm_printer p = drm_seq_file_printer(m);
+ struct xe_pcode_version version;
+ int ret = 0;
+
+ ret = xe_get_pcode_version(xe, &version);
+ if (ret)
+ return ret;
+
+ drm_printf(&p, "pcode version: %u.%u.%u\n", version.major,
+ version.minor, version.engg);
+ return 0;
+}
+
static int dgfx_pkg_residencies_show(struct seq_file *m, void *data)
{
struct xe_device *xe;
@@ -220,6 +237,10 @@ static const struct drm_info_list debugfs_list[] = {
{ .name = "workarounds", .show = workaround_info, },
};
+static const struct drm_info_list pcode_info_debugfs[] = {
+ { .name = "pcode_info", .show = pcode_info, },
+};
+
static const struct drm_info_list debugfs_residencies[] = {
{ .name = "dgfx_pkg_residencies", .show = dgfx_pkg_residencies_show, },
{ .name = "dgfx_pcie_link_residencies", .show = dgfx_pcie_link_residencies_show, },
@@ -566,6 +587,18 @@ void xe_debugfs_register(struct xe_device *xe)
&inject_csc_hw_error);
}
+ /*
+ * Pcode version read from PMT is currently only supported on CRI and BMG platforms in PF
+ * mode, as both platforms support the necessary telemetry read mechanism and have a fixed
+ * PUNIT_VERSION_OFFSET.
+ * Attempting this access on other platforms must be verified before enabling support.
+ */
+ if (!IS_SRIOV_VF(xe) &&
+ (xe->info.platform == XE_CRESCENTISLAND || xe->info.platform == XE_BATTLEMAGE))
+ drm_debugfs_create_files(pcode_info_debugfs,
+ ARRAY_SIZE(pcode_info_debugfs),
+ root, minor);
+
debugfs_create_file("forcewake_all", 0400, root, xe,
&forcewake_all_fops);