drivers/gpu/drm/i915/display/intel_display_debugfs_params.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/display/intel_display_debugfs_params.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/display/intel_display_debugfs_params.c- Extension
.c- Size
- 4619 bytes
- Lines
- 178
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/debugfs.hlinux/kernel.hdrm/drm_drv.hintel_display_core.hintel_display_debugfs_params.hintel_display_params.h
Detected Declarations
function intel_display_param_int_showfunction intel_display_param_int_openfunction intel_display_param_int_writefunction intel_display_param_uint_showfunction intel_display_param_uint_openfunction intel_display_param_uint_writefunction intel_display_debugfs_create_intfunction intel_display_debugfs_create_uintfunction intel_display_debugfs_params
Annotated Snippet
static const struct file_operations intel_display_param_int_fops = {
.owner = THIS_MODULE,
.open = intel_display_param_int_open,
.read = seq_read,
.write = intel_display_param_int_write,
.llseek = default_llseek,
.release = single_release,
};
static const struct file_operations intel_display_param_int_fops_ro = {
.owner = THIS_MODULE,
.open = intel_display_param_int_open,
.read = seq_read,
.llseek = default_llseek,
.release = single_release,
};
/* unsigned int param */
static int intel_display_param_uint_show(struct seq_file *m, void *data)
{
unsigned int *value = m->private;
seq_printf(m, "%u\n", *value);
return 0;
}
static int intel_display_param_uint_open(struct inode *inode, struct file *file)
{
return single_open(file, intel_display_param_uint_show, inode->i_private);
}
static ssize_t intel_display_param_uint_write(struct file *file,
const char __user *ubuf, size_t len,
loff_t *offp)
{
struct seq_file *m = file->private_data;
unsigned int *value = m->private;
int ret;
ret = kstrtouint_from_user(ubuf, len, 0, value);
if (ret) {
/* support boolean values too */
bool b;
ret = kstrtobool_from_user(ubuf, len, &b);
if (!ret)
*value = b;
}
return ret ?: len;
}
static const struct file_operations intel_display_param_uint_fops = {
.owner = THIS_MODULE,
.open = intel_display_param_uint_open,
.read = seq_read,
.write = intel_display_param_uint_write,
.llseek = default_llseek,
.release = single_release,
};
static const struct file_operations intel_display_param_uint_fops_ro = {
.owner = THIS_MODULE,
.open = intel_display_param_uint_open,
.read = seq_read,
.llseek = default_llseek,
.release = single_release,
};
#define RO(mode) (((mode) & 0222) == 0)
__maybe_unused static struct dentry *
intel_display_debugfs_create_int(const char *name, umode_t mode,
struct dentry *parent, int *value)
{
return debugfs_create_file_unsafe(name, mode, parent, value,
RO(mode) ? &intel_display_param_int_fops_ro :
&intel_display_param_int_fops);
}
__maybe_unused static struct dentry *
intel_display_debugfs_create_uint(const char *name, umode_t mode,
struct dentry *parent, unsigned int *value)
{
return debugfs_create_file_unsafe(name, mode, parent, value,
RO(mode) ? &intel_display_param_uint_fops_ro :
&intel_display_param_uint_fops);
}
Annotation
- Immediate include surface: `linux/debugfs.h`, `linux/kernel.h`, `drm/drm_drv.h`, `intel_display_core.h`, `intel_display_debugfs_params.h`, `intel_display_params.h`.
- Detected declarations: `function intel_display_param_int_show`, `function intel_display_param_int_open`, `function intel_display_param_int_write`, `function intel_display_param_uint_show`, `function intel_display_param_uint_open`, `function intel_display_param_uint_write`, `function intel_display_debugfs_create_int`, `function intel_display_debugfs_create_uint`, `function intel_display_debugfs_params`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: pattern 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.