Home | History | Annotate | Line # | Download | only in gt
      1  1.1  riastrad /*	$NetBSD: debugfs_engines.c,v 1.2 2021/12/18 23:45:30 riastradh Exp $	*/
      2  1.1  riastrad 
      3  1.1  riastrad // SPDX-License-Identifier: MIT
      4  1.1  riastrad 
      5  1.1  riastrad /*
      6  1.1  riastrad  * Copyright  2019 Intel Corporation
      7  1.1  riastrad  */
      8  1.1  riastrad 
      9  1.1  riastrad #include <sys/cdefs.h>
     10  1.1  riastrad __KERNEL_RCSID(0, "$NetBSD: debugfs_engines.c,v 1.2 2021/12/18 23:45:30 riastradh Exp $");
     11  1.1  riastrad 
     12  1.1  riastrad #include <drm/drm_print.h>
     13  1.1  riastrad 
     14  1.1  riastrad #include "debugfs_engines.h"
     15  1.1  riastrad #include "debugfs_gt.h"
     16  1.1  riastrad #include "i915_drv.h" /* for_each_engine! */
     17  1.1  riastrad #include "intel_engine.h"
     18  1.1  riastrad 
     19  1.1  riastrad static int engines_show(struct seq_file *m, void *data)
     20  1.1  riastrad {
     21  1.1  riastrad 	struct intel_gt *gt = m->private;
     22  1.1  riastrad 	struct intel_engine_cs *engine;
     23  1.1  riastrad 	enum intel_engine_id id;
     24  1.1  riastrad 	struct drm_printer p;
     25  1.1  riastrad 
     26  1.1  riastrad 	p = drm_seq_file_printer(m);
     27  1.1  riastrad 	for_each_engine(engine, gt, id)
     28  1.1  riastrad 		intel_engine_dump(engine, &p, "%s\n", engine->name);
     29  1.1  riastrad 
     30  1.1  riastrad 	return 0;
     31  1.1  riastrad }
     32  1.1  riastrad DEFINE_GT_DEBUGFS_ATTRIBUTE(engines);
     33  1.1  riastrad 
     34  1.1  riastrad void debugfs_engines_register(struct intel_gt *gt, struct dentry *root)
     35  1.1  riastrad {
     36  1.1  riastrad 	static const struct debugfs_gt_file files[] = {
     37  1.1  riastrad 		{ "engines", &engines_fops },
     38  1.1  riastrad 	};
     39  1.1  riastrad 
     40  1.1  riastrad 	debugfs_gt_register_files(gt, root, files, ARRAY_SIZE(files));
     41  1.1  riastrad }
     42