1 // SPDX-License-Identifier: MIT
2 
3 /*
4  * Copyright © 2019 Intel Corporation
5  */
6 
7 #include <drm/drm_print.h>
8 
9 #include "i915_drv.h" /* for_each_engine! */
10 #include "intel_engine.h"
11 #include "intel_gt_debugfs.h"
12 #include "intel_gt_engines_debugfs.h"
13 
14 static int engines_show(struct seq_file *m, void *data)
15 {
16 	struct intel_gt *gt = m->private;
17 	struct intel_engine_cs *engine;
18 	enum intel_engine_id id;
19 	struct drm_printer p;
20 
21 	p = drm_seq_file_printer(m);
22 	for_each_engine(engine, gt, id)
23 		intel_engine_dump(engine, &p, "%s\n", engine->name);
24 
25 	return 0;
26 }
27 DEFINE_INTEL_GT_DEBUGFS_ATTRIBUTE(engines);
28 
29 void intel_gt_engines_debugfs_register(struct intel_gt *gt, struct dentry *root)
30 {
31 	static const struct intel_gt_debugfs_file files[] = {
32 		{ "engines", &engines_fops },
33 	};
34 
35 	intel_gt_debugfs_register_files(root, files, ARRAY_SIZE(files), gt);
36 }
37