1 // SPDX-License-Identifier: MIT 2 /* 3 * Copyright © 2020 Intel Corporation 4 */ 5 6 #include <linux/debugfs.h> 7 #include <linux/string_helpers.h> 8 9 #include <drm/drm_print.h> 10 11 #include "gt/intel_gt_debugfs.h" 12 #include "intel_guc_debugfs.h" 13 #include "intel_huc_debugfs.h" 14 #include "intel_uc.h" 15 #include "intel_uc_debugfs.h" 16 17 #ifdef notyet 18 19 static int uc_usage_show(struct seq_file *m, void *data) 20 { 21 struct intel_uc *uc = m->private; 22 struct drm_printer p = drm_seq_file_printer(m); 23 24 drm_printf(&p, "[guc] supported:%s wanted:%s used:%s\n", 25 str_yes_no(intel_uc_supports_guc(uc)), 26 str_yes_no(intel_uc_wants_guc(uc)), 27 str_yes_no(intel_uc_uses_guc(uc))); 28 drm_printf(&p, "[huc] supported:%s wanted:%s used:%s\n", 29 str_yes_no(intel_uc_supports_huc(uc)), 30 str_yes_no(intel_uc_wants_huc(uc)), 31 str_yes_no(intel_uc_uses_huc(uc))); 32 drm_printf(&p, "[submission] supported:%s wanted:%s used:%s\n", 33 str_yes_no(intel_uc_supports_guc_submission(uc)), 34 str_yes_no(intel_uc_wants_guc_submission(uc)), 35 str_yes_no(intel_uc_uses_guc_submission(uc))); 36 37 return 0; 38 } 39 DEFINE_INTEL_GT_DEBUGFS_ATTRIBUTE(uc_usage); 40 41 #endif 42 43 void intel_uc_debugfs_register(struct intel_uc *uc, struct dentry *gt_root) 44 { 45 STUB(); 46 #ifdef notyet 47 static const struct intel_gt_debugfs_file files[] = { 48 { "usage", &uc_usage_fops, NULL }, 49 }; 50 struct dentry *root; 51 52 if (!gt_root) 53 return; 54 55 /* GuC and HuC go always in pair, no need to check both */ 56 if (!intel_uc_supports_guc(uc)) 57 return; 58 59 root = debugfs_create_dir("uc", gt_root); 60 if (IS_ERR(root)) 61 return; 62 63 intel_gt_debugfs_register_files(root, files, ARRAY_SIZE(files), uc); 64 65 intel_guc_debugfs_register(&uc->guc, root); 66 intel_huc_debugfs_register(&uc->huc, root); 67 #endif 68 } 69