WIP FPC-III support
[linux/fpc-iii.git] / drivers / gpu / drm / i915 / gt / debugfs_gt.c
blob3a21cf63b3f02a5419250b0681163be714adeffa
1 // SPDX-License-Identifier: MIT
3 /*
4 * Copyright © 2019 Intel Corporation
5 */
7 #include <linux/debugfs.h>
9 #include "debugfs_engines.h"
10 #include "debugfs_gt.h"
11 #include "debugfs_gt_pm.h"
12 #include "intel_sseu_debugfs.h"
13 #include "uc/intel_uc_debugfs.h"
14 #include "i915_drv.h"
16 void debugfs_gt_register(struct intel_gt *gt)
18 struct dentry *root;
20 if (!gt->i915->drm.primary->debugfs_root)
21 return;
23 root = debugfs_create_dir("gt", gt->i915->drm.primary->debugfs_root);
24 if (IS_ERR(root))
25 return;
27 debugfs_engines_register(gt, root);
28 debugfs_gt_pm_register(gt, root);
29 intel_sseu_debugfs_register(gt, root);
31 intel_uc_debugfs_register(&gt->uc, root);
34 void intel_gt_debugfs_register_files(struct dentry *root,
35 const struct debugfs_gt_file *files,
36 unsigned long count, void *data)
38 while (count--) {
39 umode_t mode = files->fops->write ? 0644 : 0444;
40 if (!files->eval || files->eval(data))
41 debugfs_create_file(files->name,
42 mode, root, data,
43 files->fops);
45 files++;