drivers/gpu/drm/xe/xe_tile_debugfs.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/xe/xe_tile_debugfs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/xe/xe_tile_debugfs.c- Extension
.c- Size
- 4511 bytes
- Lines
- 148
- 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
linux/debugfs.hdrm/drm_debugfs.hxe_ggtt.hxe_pm.hxe_sa.hxe_tile_debugfs.h
Detected Declarations
function xe_tile_debugfs_simple_showfunction xe_tile_debugfs_show_with_rpmfunction ggttfunction sa_infofunction tile_debugfs_create_vram_mmfunction files
Annotated Snippet
// SPDX-License-Identifier: MIT
/*
* Copyright © 2025 Intel Corporation
*/
#include <linux/debugfs.h>
#include <drm/drm_debugfs.h>
#include "xe_ggtt.h"
#include "xe_pm.h"
#include "xe_sa.h"
#include "xe_tile_debugfs.h"
static struct xe_tile *node_to_tile(struct drm_info_node *node)
{
return node->dent->d_parent->d_inode->i_private;
}
/**
* xe_tile_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_tile specific.
*
* It is assumed that those debugfs files will be created on directory entry
* which struct dentry d_inode->i_private points to &xe_tile.
*
* /sys/kernel/debug/dri/0/
* ├── tile0/ # tile = dentry->d_inode->i_private
* │ │ ├── id # tile = dentry->d_parent->d_inode->i_private
*
* 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_tile *, struct drm_printer *)
*
* Example::
*
* int tile_id(struct xe_tile *tile, struct drm_printer *p)
* {
* drm_printf(p, "%u\n", tile->id);
* return 0;
* }
*
* static const struct drm_info_list info[] = {
* { name = "id", .show = tile_debugfs_simple_show, .data = tile_id },
* };
*
* dir = debugfs_create_dir("tile0", parent);
* dir->d_inode->i_private = tile;
* drm_debugfs_create_files(info, ARRAY_SIZE(info), dir, minor);
*
* Return: 0 on success or a negative error code on failure.
*/
int xe_tile_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_tile *tile = node_to_tile(node);
int (*print)(struct xe_tile *, struct drm_printer *) = node->info_ent->data;
return print(tile, &p);
}
/**
* xe_tile_debugfs_show_with_rpm() - A show callback for struct drm_info_list
* @m: the &seq_file
* @data: data used by the drm debugfs helpers
*
* Similar to tile_debugfs_simple_show() but implicitly takes a RPM ref.
*
* Return: 0 on success or a negative error code on failure.
*/
int xe_tile_debugfs_show_with_rpm(struct seq_file *m, void *data)
{
struct drm_info_node *node = m->private;
struct xe_tile *tile = node_to_tile(node);
struct xe_device *xe = tile_to_xe(tile);
guard(xe_pm_runtime)(xe);
return xe_tile_debugfs_simple_show(m, data);
}
static int ggtt(struct xe_tile *tile, struct drm_printer *p)
Annotation
- Immediate include surface: `linux/debugfs.h`, `drm/drm_debugfs.h`, `xe_ggtt.h`, `xe_pm.h`, `xe_sa.h`, `xe_tile_debugfs.h`.
- Detected declarations: `function xe_tile_debugfs_simple_show`, `function xe_tile_debugfs_show_with_rpm`, `function ggtt`, `function sa_info`, `function tile_debugfs_create_vram_mm`, `function files`.
- 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.