drivers/gpu/drm/xe/xe_gt_debugfs.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/xe/xe_gt_debugfs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/xe/xe_gt_debugfs.c- Extension
.c- Size
- 11068 bytes
- Lines
- 393
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
xe_gt_debugfs.hlinux/debugfs.hdrm/drm_debugfs.hdrm/drm_managed.hxe_device.hxe_force_wake.hxe_gt.hxe_gt_mcr.hxe_gt_idle.hxe_gt_sriov_pf_debugfs.hxe_gt_sriov_vf_debugfs.hxe_gt_stats.hxe_gt_topology.hxe_guc_hwconfig.hxe_hw_engine.hxe_lrc.hxe_mocs.hxe_pat.hxe_pm.hxe_reg_sr.hxe_reg_whitelist.hxe_sa.hxe_sriov.hxe_sriov_vf_ccs.hxe_tuning.hxe_uc_debugfs.hxe_wa.h
Detected Declarations
function xe_gt_debugfs_simple_showfunction xe_gt_debugfs_simple_showfunction hw_enginesfunction steeringfunction register_save_restorefunction register_save_restore_checkfunction rcs_default_lrcfunction ccs_default_lrcfunction bcs_default_lrcfunction vcs_default_lrcfunction vecs_default_lrcfunction hwconfigfunction write_to_gt_callfunction stats_writefunction stats_showfunction force_resetfunction force_reset_writefunction force_reset_showfunction force_reset_syncfunction force_reset_sync_writefunction force_reset_sync_showfunction xe_gt_debugfs_register
Annotated Snippet
// SPDX-License-Identifier: MIT
/*
* Copyright © 2022 Intel Corporation
*/
#include "xe_gt_debugfs.h"
#include <linux/debugfs.h>
#include <drm/drm_debugfs.h>
#include <drm/drm_managed.h>
#include "xe_device.h"
#include "xe_force_wake.h"
#include "xe_gt.h"
#include "xe_gt_mcr.h"
#include "xe_gt_idle.h"
#include "xe_gt_sriov_pf_debugfs.h"
#include "xe_gt_sriov_vf_debugfs.h"
#include "xe_gt_stats.h"
#include "xe_gt_topology.h"
#include "xe_guc_hwconfig.h"
#include "xe_hw_engine.h"
#include "xe_lrc.h"
#include "xe_mocs.h"
#include "xe_pat.h"
#include "xe_pm.h"
#include "xe_reg_sr.h"
#include "xe_reg_whitelist.h"
#include "xe_sa.h"
#include "xe_sriov.h"
#include "xe_sriov_vf_ccs.h"
#include "xe_tuning.h"
#include "xe_uc_debugfs.h"
#include "xe_wa.h"
static struct xe_gt *node_to_gt(struct drm_info_node *node)
{
return node->dent->d_parent->d_inode->i_private;
}
/**
* xe_gt_debugfs_simple_show - A show callback for struct drm_info_list
* @m: the &seq_file
* @data: data used by the drm debugfs helpers
*
* This callback can be used in struct drm_info_list to describe debugfs
* files that are &xe_gt specific.
*
* It is assumed that those debugfs files will be created on directory entry
* which struct dentry d_inode->i_private points to &xe_gt.
*
* This function assumes that &m->private will be set to the &struct
* drm_info_node corresponding to the instance of the info on a given &struct
* drm_minor (see struct drm_info_list.show for details).
*
* This function also assumes that struct drm_info_list.data will point to the
* function code that will actually print a file content::
*
* int (*print)(struct xe_gt *, struct drm_printer *)
*
* Example::
*
* int foo(struct xe_gt *gt, struct drm_printer *p)
* {
* drm_printf(p, "GT%u\n", gt->info.id);
* return 0;
* }
*
* static const struct drm_info_list bar[] = {
* { name = "foo", .show = xe_gt_debugfs_simple_show, .data = foo },
* };
*
* dir = debugfs_create_dir("gt", parent);
* dir->d_inode->i_private = gt;
* drm_debugfs_create_files(bar, ARRAY_SIZE(bar), dir, minor);
*
* Return: 0 on success or a negative error code on failure.
*/
int xe_gt_debugfs_simple_show(struct seq_file *m, void *data)
{
struct drm_printer p = drm_seq_file_printer(m);
struct drm_info_node *node = m->private;
struct xe_gt *gt = node_to_gt(node);
int (*print)(struct xe_gt *, struct drm_printer *) = node->info_ent->data;
if (WARN_ON(!print))
return -EINVAL;
return print(gt, &p);
Annotation
- Immediate include surface: `xe_gt_debugfs.h`, `linux/debugfs.h`, `drm/drm_debugfs.h`, `drm/drm_managed.h`, `xe_device.h`, `xe_force_wake.h`, `xe_gt.h`, `xe_gt_mcr.h`.
- Detected declarations: `function xe_gt_debugfs_simple_show`, `function xe_gt_debugfs_simple_show`, `function hw_engines`, `function steering`, `function register_save_restore`, `function register_save_restore_check`, `function rcs_default_lrc`, `function ccs_default_lrc`, `function bcs_default_lrc`, `function vcs_default_lrc`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.