drivers/gpu/drm/vc4/vc4_debugfs.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/vc4/vc4_debugfs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/vc4/vc4_debugfs.c- Extension
.c- Size
- 1330 bytes
- Lines
- 60
- 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
drm/drm_drv.hdrm/drm_print.hlinux/seq_file.hlinux/circ_buf.hlinux/ctype.hlinux/debugfs.hlinux/platform_device.hvc4_drv.hvc4_regs.h
Detected Declarations
function drm_dev_registerfunction vc4_debugfs_regset32function vc4_debugfs_add_regset32
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright © 2014 Broadcom
*/
#include <drm/drm_drv.h>
#include <drm/drm_print.h>
#include <linux/seq_file.h>
#include <linux/circ_buf.h>
#include <linux/ctype.h>
#include <linux/debugfs.h>
#include <linux/platform_device.h>
#include "vc4_drv.h"
#include "vc4_regs.h"
/*
* Called at drm_dev_register() time on each of the minors registered
* by the DRM device, to attach the debugfs files.
*/
void
vc4_debugfs_init(struct drm_minor *minor)
{
struct vc4_dev *vc4 = to_vc4_dev(minor->dev);
struct drm_device *drm = &vc4->base;
drm_WARN_ON(drm, vc4_hvs_debugfs_init(minor));
if (vc4->v3d) {
drm_WARN_ON(drm, vc4_bo_debugfs_init(minor));
drm_WARN_ON(drm, vc4_v3d_debugfs_init(minor));
}
}
static int vc4_debugfs_regset32(struct seq_file *m, void *unused)
{
struct drm_debugfs_entry *entry = m->private;
struct drm_device *drm = entry->dev;
struct debugfs_regset32 *regset = entry->file.data;
struct drm_printer p = drm_seq_file_printer(m);
int idx;
if (!drm_dev_enter(drm, &idx))
return -ENODEV;
drm_print_regset32(&p, regset);
drm_dev_exit(idx);
return 0;
}
void vc4_debugfs_add_regset32(struct drm_device *drm,
const char *name,
struct debugfs_regset32 *regset)
{
drm_debugfs_add_file(drm, name, vc4_debugfs_regset32, regset);
}
Annotation
- Immediate include surface: `drm/drm_drv.h`, `drm/drm_print.h`, `linux/seq_file.h`, `linux/circ_buf.h`, `linux/ctype.h`, `linux/debugfs.h`, `linux/platform_device.h`, `vc4_drv.h`.
- Detected declarations: `function drm_dev_register`, `function vc4_debugfs_regset32`, `function vc4_debugfs_add_regset32`.
- 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.