drivers/gpu/drm/msm/msm_debugfs.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/msm/msm_debugfs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/msm/msm_debugfs.c- Extension
.c- Size
- 9040 bytes
- Lines
- 415
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern 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 an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/debugfs.hlinux/fault-inject.hdrm/drm_debugfs.hdrm/drm_fb_helper.hdrm/drm_file.hdrm/drm_framebuffer.hmsm_drv.hmsm_gpu.hmsm_kms.hmsm_debugfs.hdisp/msm_disp_snapshot.h
Detected Declarations
struct msm_gpu_show_privfunction msm_gpu_showfunction msm_gpu_releasefunction msm_gpu_openfunction msm_fb_showfunction msm_kms_showfunction msm_kms_releasefunction msm_kms_openfunction msm_debugfs_kms_initfunction msm_debugfs_kms_initfunction shrink_getfunction shrink_setfunction submitfunction msm_gem_showfunction msm_mm_showfunction late_init_minorfunction msm_debugfs_late_initfunction msm_debugfs_gpu_initfunction msm_debugfs_init
Annotated Snippet
static const struct file_operations msm_gpu_fops = {
.owner = THIS_MODULE,
.open = msm_gpu_open,
.read = seq_read,
.llseek = seq_lseek,
.release = msm_gpu_release,
};
#ifdef CONFIG_DRM_MSM_KMS
static int msm_fb_show(struct seq_file *m, void *arg)
{
struct drm_info_node *node = m->private;
struct drm_device *dev = node->minor->dev;
struct drm_framebuffer *fb, *fbdev_fb = NULL;
if (dev->fb_helper && dev->fb_helper->fb) {
seq_puts(m, "fbcon ");
fbdev_fb = dev->fb_helper->fb;
msm_framebuffer_describe(fbdev_fb, m);
}
mutex_lock(&dev->mode_config.fb_lock);
list_for_each_entry(fb, &dev->mode_config.fb_list, head) {
if (fb == fbdev_fb)
continue;
seq_puts(m, "user ");
msm_framebuffer_describe(fb, m);
}
mutex_unlock(&dev->mode_config.fb_lock);
return 0;
}
static struct drm_info_list msm_kms_debugfs_list[] = {
{ "fb", msm_fb_show },
};
/*
* Display Snapshot:
*/
static int msm_kms_show(struct seq_file *m, void *arg)
{
struct drm_printer p = drm_seq_file_printer(m);
struct msm_disp_state *state = m->private;
msm_disp_state_print(state, &p);
return 0;
}
static int msm_kms_release(struct inode *inode, struct file *file)
{
struct seq_file *m = file->private_data;
struct msm_disp_state *state = m->private;
msm_disp_state_free(state);
return single_release(inode, file);
}
static int msm_kms_open(struct inode *inode, struct file *file)
{
struct drm_device *dev = inode->i_private;
struct msm_drm_private *priv = dev->dev_private;
struct msm_disp_state *state;
int ret;
if (!priv->kms)
return -ENODEV;
ret = mutex_lock_interruptible(&priv->kms->dump_mutex);
if (ret)
return ret;
state = msm_disp_snapshot_state_sync(priv->kms);
mutex_unlock(&priv->kms->dump_mutex);
if (IS_ERR(state)) {
return PTR_ERR(state);
}
ret = single_open(file, msm_kms_show, state);
if (ret) {
msm_disp_state_free(state);
return ret;
}
Annotation
- Immediate include surface: `linux/debugfs.h`, `linux/fault-inject.h`, `drm/drm_debugfs.h`, `drm/drm_fb_helper.h`, `drm/drm_file.h`, `drm/drm_framebuffer.h`, `msm_drv.h`, `msm_gpu.h`.
- Detected declarations: `struct msm_gpu_show_priv`, `function msm_gpu_show`, `function msm_gpu_release`, `function msm_gpu_open`, `function msm_fb_show`, `function msm_kms_show`, `function msm_kms_release`, `function msm_kms_open`, `function msm_debugfs_kms_init`, `function msm_debugfs_kms_init`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: pattern implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.