drivers/gpu/drm/xe/xe_guc_debugfs.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/xe/xe_guc_debugfs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/xe/xe_guc_debugfs.c- Extension
.c- Size
- 4440 bytes
- Lines
- 149
- 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_guc_debugfs.hdrm/drm_debugfs.hdrm/drm_managed.hxe_device_types.hxe_gt_types.hxe_guc.hxe_guc_ct.hxe_guc_log.hxe_guc_pc.hxe_pm.h
Detected Declarations
function guc_debugfs_showfunction guc_logfunction guc_log_lfdfunction guc_log_dmesgfunction guc_ctbfunction guc_pcfunction xe_guc_debugfs_register
Annotated Snippet
// SPDX-License-Identifier: MIT
/*
* Copyright © 2022 Intel Corporation
*/
#include "xe_guc_debugfs.h"
#include <drm/drm_debugfs.h>
#include <drm/drm_managed.h>
#include "xe_device_types.h"
#include "xe_gt_types.h"
#include "xe_guc.h"
#include "xe_guc_ct.h"
#include "xe_guc_log.h"
#include "xe_guc_pc.h"
#include "xe_pm.h"
/*
* guc_debugfs_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_guc specific in similar way how we handle &xe_gt
* specific files using &xe_gt_debugfs_simple_show.
*
* It is assumed that those debugfs files will be created on directory entry
* which grandparent struct dentry d_inode->i_private points to &xe_gt.
*
* /sys/kernel/debug/dri/0/
* ├── gt0 # dent->d_parent->d_parent (d_inode->i_private == gt)
* │ ├── uc # dent->d_parent
* │ │ ├── guc_info # dent
* │ │ ├── guc_...
*
* 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_guc *, struct drm_printer *)
*
* Example::
*
* int foo(struct xe_guc *guc, struct drm_printer *p)
* {
* drm_printf(p, "enabled %d\n", guc->submission_state.enabled);
* return 0;
* }
*
* static const struct drm_info_list bar[] = {
* { name = "foo", .show = guc_debugfs_show, .data = foo },
* };
*
* parent = debugfs_create_dir("uc", gtdir);
* drm_debugfs_create_files(bar, ARRAY_SIZE(bar), parent, minor);
*
* Return: 0 on success or a negative error code on failure.
*/
static int guc_debugfs_show(struct seq_file *m, void *data)
{
struct drm_printer p = drm_seq_file_printer(m);
struct drm_info_node *node = m->private;
struct dentry *parent = node->dent->d_parent;
struct dentry *grandparent = parent->d_parent;
struct xe_gt *gt = grandparent->d_inode->i_private;
struct xe_device *xe = gt_to_xe(gt);
int (*print)(struct xe_guc *, struct drm_printer *) = node->info_ent->data;
guard(xe_pm_runtime)(xe);
return print(>->uc.guc, &p);
}
static int guc_log(struct xe_guc *guc, struct drm_printer *p)
{
xe_guc_log_print(&guc->log, p);
return 0;
}
static int guc_log_lfd(struct xe_guc *guc, struct drm_printer *p)
{
xe_guc_log_print_lfd(&guc->log, p);
return 0;
}
static int guc_log_dmesg(struct xe_guc *guc, struct drm_printer *p)
{
Annotation
- Immediate include surface: `xe_guc_debugfs.h`, `drm/drm_debugfs.h`, `drm/drm_managed.h`, `xe_device_types.h`, `xe_gt_types.h`, `xe_guc.h`, `xe_guc_ct.h`, `xe_guc_log.h`.
- Detected declarations: `function guc_debugfs_show`, `function guc_log`, `function guc_log_lfd`, `function guc_log_dmesg`, `function guc_ctb`, `function guc_pc`, `function xe_guc_debugfs_register`.
- 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.