File: intel_uc_debugfs.c

package info (click to toggle)
linux 6.1.8-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,488,076 kB
  • sloc: ansic: 23,401,844; asm: 266,744; sh: 108,976; makefile: 49,705; python: 36,927; perl: 36,810; cpp: 6,044; yacc: 4,904; lex: 2,722; awk: 1,440; ruby: 25; sed: 5
file content (61 lines) | stat: -rw-r--r-- 1,676 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// SPDX-License-Identifier: MIT
/*
 * Copyright © 2020 Intel Corporation
 */

#include <linux/debugfs.h>
#include <linux/string_helpers.h>

#include <drm/drm_print.h>

#include "gt/intel_gt_debugfs.h"
#include "intel_guc_debugfs.h"
#include "intel_huc_debugfs.h"
#include "intel_uc.h"
#include "intel_uc_debugfs.h"

static int uc_usage_show(struct seq_file *m, void *data)
{
	struct intel_uc *uc = m->private;
	struct drm_printer p = drm_seq_file_printer(m);

	drm_printf(&p, "[guc] supported:%s wanted:%s used:%s\n",
		   str_yes_no(intel_uc_supports_guc(uc)),
		   str_yes_no(intel_uc_wants_guc(uc)),
		   str_yes_no(intel_uc_uses_guc(uc)));
	drm_printf(&p, "[huc] supported:%s wanted:%s used:%s\n",
		   str_yes_no(intel_uc_supports_huc(uc)),
		   str_yes_no(intel_uc_wants_huc(uc)),
		   str_yes_no(intel_uc_uses_huc(uc)));
	drm_printf(&p, "[submission] supported:%s wanted:%s used:%s\n",
		   str_yes_no(intel_uc_supports_guc_submission(uc)),
		   str_yes_no(intel_uc_wants_guc_submission(uc)),
		   str_yes_no(intel_uc_uses_guc_submission(uc)));

	return 0;
}
DEFINE_INTEL_GT_DEBUGFS_ATTRIBUTE(uc_usage);

void intel_uc_debugfs_register(struct intel_uc *uc, struct dentry *gt_root)
{
	static const struct intel_gt_debugfs_file files[] = {
		{ "usage", &uc_usage_fops, NULL },
	};
	struct dentry *root;

	if (!gt_root)
		return;

	/* GuC and HuC go always in pair, no need to check both */
	if (!intel_uc_supports_guc(uc))
		return;

	root = debugfs_create_dir("uc", gt_root);
	if (IS_ERR(root))
		return;

	intel_gt_debugfs_register_files(root, files, ARRAY_SIZE(files), uc);

	intel_guc_debugfs_register(&uc->guc, root);
	intel_huc_debugfs_register(&uc->huc, root);
}