drivers/gpu/drm/i915/i915_debugfs_params.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/i915_debugfs_params.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/i915_debugfs_params.c- Extension
.c- Size
- 6342 bytes
- Lines
- 271
- 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/kernel.hlinux/debugfs.hi915_debugfs_params.hgt/intel_gt.hgt/uc/intel_guc.hi915_drv.hi915_params.h
Detected Declarations
function i915_param_int_showfunction i915_param_int_openfunction notify_gucfunction for_each_gtfunction i915_param_int_writefunction i915_param_uint_showfunction i915_param_uint_openfunction i915_param_uint_writefunction i915_param_charp_showfunction i915_param_charp_openfunction i915_param_charp_writefunction i915_debugfs_create_intfunction i915_debugfs_create_uintfunction i915_debugfs_create_charp
Annotated Snippet
static const struct file_operations i915_param_int_fops = {
.owner = THIS_MODULE,
.open = i915_param_int_open,
.read = seq_read,
.write = i915_param_int_write,
.llseek = default_llseek,
.release = single_release,
};
static const struct file_operations i915_param_int_fops_ro = {
.owner = THIS_MODULE,
.open = i915_param_int_open,
.read = seq_read,
.llseek = default_llseek,
.release = single_release,
};
/* unsigned int param */
static int i915_param_uint_show(struct seq_file *m, void *data)
{
unsigned int *value = m->private;
seq_printf(m, "%u\n", *value);
return 0;
}
static int i915_param_uint_open(struct inode *inode, struct file *file)
{
return single_open(file, i915_param_uint_show, inode->i_private);
}
static ssize_t i915_param_uint_write(struct file *file,
const char __user *ubuf, size_t len,
loff_t *offp)
{
struct drm_i915_private *i915;
struct seq_file *m = file->private_data;
unsigned int *value = m->private;
unsigned int old = *value;
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;
}
if (!ret && MATCH_DEBUGFS_NODE_NAME(file, "reset")) {
GET_I915(i915, reset, value);
ret = notify_guc(i915);
if (ret)
*value = old;
}
return ret ?: len;
}
static const struct file_operations i915_param_uint_fops = {
.owner = THIS_MODULE,
.open = i915_param_uint_open,
.read = seq_read,
.write = i915_param_uint_write,
.llseek = default_llseek,
.release = single_release,
};
static const struct file_operations i915_param_uint_fops_ro = {
.owner = THIS_MODULE,
.open = i915_param_uint_open,
.read = seq_read,
.llseek = default_llseek,
.release = single_release,
};
/* char * param */
static int i915_param_charp_show(struct seq_file *m, void *data)
{
const char **s = m->private;
seq_printf(m, "%s\n", *s);
return 0;
}
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/debugfs.h`, `i915_debugfs_params.h`, `gt/intel_gt.h`, `gt/uc/intel_guc.h`, `i915_drv.h`, `i915_params.h`.
- Detected declarations: `function i915_param_int_show`, `function i915_param_int_open`, `function notify_guc`, `function for_each_gt`, `function i915_param_int_write`, `function i915_param_uint_show`, `function i915_param_uint_open`, `function i915_param_uint_write`, `function i915_param_charp_show`, `function i915_param_charp_open`.
- 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.