drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c- Extension
.c- Size
- 13866 bytes
- Lines
- 516
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/debugfs.hlinux/errno.hlinux/mutex.hlinux/pm_opp.hlinux/sort.hlinux/clk.hlinux/bitmap.hdpu_kms.hdpu_trace.hdpu_crtc.hdpu_core_perf.h
Detected Declarations
enum dpu_perf_modefunction dpu_core_perf_adjusted_mode_clkfunction _dpu_core_perf_calc_bwfunction drm_atomic_crtc_for_each_planefunction _dpu_core_perf_calc_clkfunction drm_atomic_crtc_for_each_planefunction _dpu_core_perf_calc_crtcfunction dpu_core_perf_aggregatefunction drm_for_each_crtcfunction dpu_core_perf_crtc_checkfunction _dpu_core_perf_crtc_update_busfunction dpu_core_perf_crtc_release_bwfunction _dpu_core_perf_get_core_clk_ratefunction dpu_core_perf_crtc_updatefunction _dpu_core_perf_mode_writefunction _dpu_core_perf_mode_readfunction dpu_core_perf_debugfs_initfunction dpu_core_perf_init
Annotated Snippet
static const struct file_operations dpu_core_perf_mode_fops = {
.open = simple_open,
.read = _dpu_core_perf_mode_read,
.write = _dpu_core_perf_mode_write,
};
/**
* dpu_core_perf_debugfs_init - initialize debugfs for core performance context
* @dpu_kms: Pointer to the dpu_kms struct
* @parent: Pointer to parent debugfs
*/
int dpu_core_perf_debugfs_init(struct dpu_kms *dpu_kms, struct dentry *parent)
{
struct dpu_core_perf *perf = &dpu_kms->perf;
struct dentry *entry;
entry = debugfs_create_dir("core_perf", parent);
debugfs_create_u64("max_core_clk_rate", 0600, entry,
&perf->max_core_clk_rate);
debugfs_create_u64("core_clk_rate", 0600, entry,
&perf->core_clk_rate);
debugfs_create_u32("enable_bw_release", 0600, entry,
(u32 *)&perf->enable_bw_release);
debugfs_create_u32("low_core_ab", 0400, entry,
(u32 *)&perf->perf_cfg->max_bw_low);
debugfs_create_u32("max_core_ab", 0400, entry,
(u32 *)&perf->perf_cfg->max_bw_high);
debugfs_create_u32("min_core_ib", 0400, entry,
(u32 *)&perf->perf_cfg->min_core_ib);
debugfs_create_u32("min_llcc_ib", 0400, entry,
(u32 *)&perf->perf_cfg->min_llcc_ib);
debugfs_create_u32("min_dram_ib", 0400, entry,
(u32 *)&perf->perf_cfg->min_dram_ib);
debugfs_create_file("perf_mode", 0600, entry,
(u32 *)perf, &dpu_core_perf_mode_fops);
debugfs_create_u64("fix_core_clk_rate", 0600, entry,
&perf->fix_core_clk_rate);
debugfs_create_u32("fix_core_ib_vote", 0600, entry,
&perf->fix_core_ib_vote);
debugfs_create_u32("fix_core_ab_vote", 0600, entry,
&perf->fix_core_ab_vote);
return 0;
}
#endif
/**
* dpu_core_perf_init - initialize the given core performance context
* @perf: Pointer to core performance context
* @perf_cfg: Pointer to platform performance configuration
* @max_core_clk_rate: Maximum core clock rate
*/
int dpu_core_perf_init(struct dpu_core_perf *perf,
const struct dpu_perf_cfg *perf_cfg,
unsigned long max_core_clk_rate)
{
perf->perf_cfg = perf_cfg;
perf->max_core_clk_rate = max_core_clk_rate;
return 0;
}
Annotation
- Immediate include surface: `linux/debugfs.h`, `linux/errno.h`, `linux/mutex.h`, `linux/pm_opp.h`, `linux/sort.h`, `linux/clk.h`, `linux/bitmap.h`, `dpu_kms.h`.
- Detected declarations: `enum dpu_perf_mode`, `function dpu_core_perf_adjusted_mode_clk`, `function _dpu_core_perf_calc_bw`, `function drm_atomic_crtc_for_each_plane`, `function _dpu_core_perf_calc_clk`, `function drm_atomic_crtc_for_each_plane`, `function _dpu_core_perf_calc_crtc`, `function dpu_core_perf_aggregate`, `function drm_for_each_crtc`, `function dpu_core_perf_crtc_check`.
- 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.