xref: /openbsd/sys/dev/pci/drm/i915/gt/uc/intel_uc_debugfs.c (revision f005ef32)
1 // SPDX-License-Identifier: MIT
2 /*
3  * Copyright © 2020 Intel Corporation
4  */
5 
6 #include <linux/debugfs.h>
7 #include <linux/string_helpers.h>
8 
9 #include <drm/drm_print.h>
10 
11 #include "gt/intel_gt_debugfs.h"
12 #include "intel_guc_debugfs.h"
13 #include "intel_gsc_uc_debugfs.h"
14 #include "intel_huc_debugfs.h"
15 #include "intel_uc.h"
16 #include "intel_uc_debugfs.h"
17 
18 #ifdef notyet
19 
uc_usage_show(struct seq_file * m,void * data)20 static int uc_usage_show(struct seq_file *m, void *data)
21 {
22 	struct intel_uc *uc = m->private;
23 	struct drm_printer p = drm_seq_file_printer(m);
24 
25 	drm_printf(&p, "[guc] supported:%s wanted:%s used:%s\n",
26 		   str_yes_no(intel_uc_supports_guc(uc)),
27 		   str_yes_no(intel_uc_wants_guc(uc)),
28 		   str_yes_no(intel_uc_uses_guc(uc)));
29 	drm_printf(&p, "[huc] supported:%s wanted:%s used:%s\n",
30 		   str_yes_no(intel_uc_supports_huc(uc)),
31 		   str_yes_no(intel_uc_wants_huc(uc)),
32 		   str_yes_no(intel_uc_uses_huc(uc)));
33 	drm_printf(&p, "[submission] supported:%s wanted:%s used:%s\n",
34 		   str_yes_no(intel_uc_supports_guc_submission(uc)),
35 		   str_yes_no(intel_uc_wants_guc_submission(uc)),
36 		   str_yes_no(intel_uc_uses_guc_submission(uc)));
37 
38 	return 0;
39 }
40 DEFINE_INTEL_GT_DEBUGFS_ATTRIBUTE(uc_usage);
41 
42 #endif
43 
intel_uc_debugfs_register(struct intel_uc * uc,struct dentry * gt_root)44 void intel_uc_debugfs_register(struct intel_uc *uc, struct dentry *gt_root)
45 {
46 	STUB();
47 #ifdef notyet
48 	static const struct intel_gt_debugfs_file files[] = {
49 		{ "usage", &uc_usage_fops, NULL },
50 	};
51 	struct dentry *root;
52 
53 	if (!gt_root)
54 		return;
55 
56 	/* GuC and HuC go always in pair, no need to check both */
57 	if (!intel_uc_supports_guc(uc))
58 		return;
59 
60 	root = debugfs_create_dir("uc", gt_root);
61 	if (IS_ERR(root))
62 		return;
63 
64 	uc->guc.dbgfs_node = root;
65 
66 	intel_gt_debugfs_register_files(root, files, ARRAY_SIZE(files), uc);
67 
68 	intel_gsc_uc_debugfs_register(&uc->gsc, root);
69 	intel_guc_debugfs_register(&uc->guc, root);
70 	intel_huc_debugfs_register(&uc->huc, root);
71 #endif
72 }
73