18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: MIT 28c2ecf20Sopenharmony_ci 38c2ecf20Sopenharmony_ci/* 48c2ecf20Sopenharmony_ci * Copyright © 2019 Intel Corporation 58c2ecf20Sopenharmony_ci */ 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_ci#include <drm/drm_print.h> 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ci#include "debugfs_engines.h" 108c2ecf20Sopenharmony_ci#include "debugfs_gt.h" 118c2ecf20Sopenharmony_ci#include "i915_drv.h" /* for_each_engine! */ 128c2ecf20Sopenharmony_ci#include "intel_engine.h" 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_cistatic int engines_show(struct seq_file *m, void *data) 158c2ecf20Sopenharmony_ci{ 168c2ecf20Sopenharmony_ci struct intel_gt *gt = m->private; 178c2ecf20Sopenharmony_ci struct intel_engine_cs *engine; 188c2ecf20Sopenharmony_ci enum intel_engine_id id; 198c2ecf20Sopenharmony_ci struct drm_printer p; 208c2ecf20Sopenharmony_ci 218c2ecf20Sopenharmony_ci p = drm_seq_file_printer(m); 228c2ecf20Sopenharmony_ci for_each_engine(engine, gt, id) 238c2ecf20Sopenharmony_ci intel_engine_dump(engine, &p, "%s\n", engine->name); 248c2ecf20Sopenharmony_ci 258c2ecf20Sopenharmony_ci return 0; 268c2ecf20Sopenharmony_ci} 278c2ecf20Sopenharmony_ciDEFINE_GT_DEBUGFS_ATTRIBUTE(engines); 288c2ecf20Sopenharmony_ci 298c2ecf20Sopenharmony_civoid debugfs_engines_register(struct intel_gt *gt, struct dentry *root) 308c2ecf20Sopenharmony_ci{ 318c2ecf20Sopenharmony_ci static const struct debugfs_gt_file files[] = { 328c2ecf20Sopenharmony_ci { "engines", &engines_fops }, 338c2ecf20Sopenharmony_ci }; 348c2ecf20Sopenharmony_ci 358c2ecf20Sopenharmony_ci intel_gt_debugfs_register_files(root, files, ARRAY_SIZE(files), gt); 368c2ecf20Sopenharmony_ci} 37