xref: /openbsd-src/sys/dev/pci/drm/i915/gt/uc/intel_gsc_uc_debugfs.c (revision f005ef32267c16bdb134f0e9fa4477dbe07c263a)
1 // SPDX-License-Identifier: MIT
2 /*
3  * Copyright © 2023 Intel Corporation
4  */
5 
6 #include <drm/drm_print.h>
7 
8 #include "gt/intel_gt.h"
9 #include "gt/intel_gt_debugfs.h"
10 #include "gt/intel_gt_print.h"
11 #include "intel_gsc_uc.h"
12 #include "intel_gsc_uc_debugfs.h"
13 #include "i915_drv.h"
14 
gsc_info_show(struct seq_file * m,void * data)15 static int gsc_info_show(struct seq_file *m, void *data)
16 {
17 	struct drm_printer p = drm_seq_file_printer(m);
18 	struct intel_gsc_uc *gsc = m->private;
19 
20 	if (!intel_gsc_uc_is_supported(gsc))
21 		return -ENODEV;
22 
23 	intel_gsc_uc_load_status(gsc, &p);
24 
25 	return 0;
26 }
27 #ifdef notyet
28 DEFINE_INTEL_GT_DEBUGFS_ATTRIBUTE(gsc_info);
29 #endif
30 
intel_gsc_uc_debugfs_register(struct intel_gsc_uc * gsc_uc,struct dentry * root)31 void intel_gsc_uc_debugfs_register(struct intel_gsc_uc *gsc_uc, struct dentry *root)
32 {
33 #ifdef notyet
34 	static const struct intel_gt_debugfs_file files[] = {
35 		{ "gsc_info", &gsc_info_fops, NULL },
36 	};
37 
38 	if (!intel_gsc_uc_is_supported(gsc_uc))
39 		return;
40 
41 	intel_gt_debugfs_register_files(root, files, ARRAY_SIZE(files), gsc_uc);
42 #endif
43 }
44