1 // SPDX-License-Identifier: MIT
3 * Copyright © 2020 Intel Corporation
6 #include <linux/debugfs.h>
7 #include <drm/drm_print.h>
9 #include "gt/debugfs_gt.h"
10 #include "intel_guc_debugfs.h"
11 #include "intel_huc_debugfs.h"
13 #include "intel_uc_debugfs.h"
15 static int uc_usage_show(struct seq_file *m, void *data)
17 struct intel_uc *uc = m->private;
18 struct drm_printer p = drm_seq_file_printer(m);
20 drm_printf(&p, "[guc] supported:%s wanted:%s used:%s\n",
21 yesno(intel_uc_supports_guc(uc)),
22 yesno(intel_uc_wants_guc(uc)),
23 yesno(intel_uc_uses_guc(uc)));
24 drm_printf(&p, "[huc] supported:%s wanted:%s used:%s\n",
25 yesno(intel_uc_supports_huc(uc)),
26 yesno(intel_uc_wants_huc(uc)),
27 yesno(intel_uc_uses_huc(uc)));
28 drm_printf(&p, "[submission] supported:%s wanted:%s used:%s\n",
29 yesno(intel_uc_supports_guc_submission(uc)),
30 yesno(intel_uc_wants_guc_submission(uc)),
31 yesno(intel_uc_uses_guc_submission(uc)));
35 DEFINE_GT_DEBUGFS_ATTRIBUTE(uc_usage);
37 void intel_uc_debugfs_register(struct intel_uc *uc, struct dentry *gt_root)
39 static const struct debugfs_gt_file files[] = {
40 { "usage", &uc_usage_fops, NULL },
47 /* GuC and HuC go always in pair, no need to check both */
48 if (!intel_uc_supports_guc(uc))
51 root = debugfs_create_dir("uc", gt_root);
55 intel_gt_debugfs_register_files(root, files, ARRAY_SIZE(files), uc);
57 intel_guc_debugfs_register(&uc->guc, root);
58 intel_huc_debugfs_register(&uc->huc, root);