drivers/gpu/drm/i915/display/intel_cdclk.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/display/intel_cdclk.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/display/intel_cdclk.c- Extension
.c- Size
- 126447 bytes
- Lines
- 4262
- 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.
- 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/iopoll.hlinux/time.hdrm/drm_fixed.hdrm/drm_print.hdrm/intel/intel_pcode_regs.hdrm/intel/pci_config.hdrm/intel/step.hhsw_ips.hintel_atomic.hintel_audio.hintel_cdclk.hintel_crtc.hintel_dbuf_bw.hintel_de.hintel_display_regs.hintel_display_types.hintel_display_utils.hintel_display_wa.hintel_dram.hintel_mchbar.hintel_parent.hintel_plane.hintel_psr.hintel_vdsc.hskl_watermark.hskl_watermark_regs.hvlv_clock.hvlv_dsi.hvlv_sideband.h
Detected Declarations
struct intel_cdclk_statestruct intel_cdclk_funcsstruct intel_cdclk_valsfunction intel_cdclk_get_cdclkfunction intel_cdclk_set_cdclkfunction intel_cdclk_modeset_calc_cdclkfunction intel_cdclk_calc_voltage_levelfunction fixed_133mhz_get_cdclkfunction fixed_200mhz_get_cdclkfunction fixed_266mhz_get_cdclkfunction fixed_333mhz_get_cdclkfunction fixed_400mhz_get_cdclkfunction fixed_450mhz_get_cdclkfunction i85x_get_cdclkfunction i915gm_get_cdclkfunction i945gm_get_cdclkfunction intel_hpll_vcofunction g33_get_cdclkfunction pnv_get_cdclkfunction i965gm_get_cdclkfunction gm45_get_cdclkfunction hsw_get_cdclkfunction vlv_calc_cdclkfunction vlv_calc_voltage_levelfunction vlv_get_cdclkfunction vlv_program_pfi_creditsfunction vlv_set_cdclkfunction chv_set_cdclkfunction bdw_calc_cdclkfunction bdw_calc_voltage_levelfunction bdw_get_cdclkfunction bdw_cdclk_freq_selfunction bdw_set_cdclkfunction skl_calc_cdclkfunction skl_calc_voltage_levelfunction skl_dpll0_updatefunction skl_get_cdclkfunction skl_cdclk_decimalfunction skl_set_preferred_cdclk_vcofunction skl_dpll0_link_ratefunction skl_dpll0_enablefunction skl_dpll0_disablefunction skl_cdclk_freq_selfunction skl_set_cdclkfunction skl_sanitize_cdclkfunction skl_cdclk_init_hwfunction skl_cdclk_uninit_hwfunction cdclk_squash_divider
Annotated Snippet
struct intel_cdclk_state {
struct intel_global_state base;
/*
* Logical configuration of cdclk (used for all scaling,
* watermark, etc. calculations and checks). This is
* computed as if all enabled crtcs were active.
*/
struct intel_cdclk_config logical;
/*
* Actual configuration of cdclk, can be different from the
* logical configuration only when all crtc's are DPMS off.
*/
struct intel_cdclk_config actual;
/* minimum acceptable cdclk to satisfy DBUF bandwidth requirements */
int dbuf_bw_min_cdclk;
/* minimum acceptable cdclk for each pipe */
int min_cdclk[I915_MAX_PIPES];
/* minimum acceptable voltage level for each pipe */
u8 min_voltage_level[I915_MAX_PIPES];
/* pipe to which cd2x update is synchronized */
enum pipe pipe;
/* forced minimum cdclk for glk+ audio w/a */
int force_min_cdclk;
/* bitmask of enabled pipes */
u8 enabled_pipes;
/* bitmask of active pipes */
u8 active_pipes;
/* update cdclk with pipes disabled */
bool disable_pipes;
};
struct intel_cdclk_funcs {
void (*get_cdclk)(struct intel_display *display,
struct intel_cdclk_config *cdclk_config);
void (*set_cdclk)(struct intel_display *display,
const struct intel_cdclk_config *cdclk_config,
enum pipe pipe);
int (*modeset_calc_cdclk)(struct intel_atomic_state *state);
u8 (*calc_voltage_level)(int cdclk);
};
void intel_cdclk_get_cdclk(struct intel_display *display,
struct intel_cdclk_config *cdclk_config)
{
display->cdclk.funcs->get_cdclk(display, cdclk_config);
}
static void intel_cdclk_set_cdclk(struct intel_display *display,
const struct intel_cdclk_config *cdclk_config,
enum pipe pipe)
{
display->cdclk.funcs->set_cdclk(display, cdclk_config, pipe);
}
static int intel_cdclk_modeset_calc_cdclk(struct intel_atomic_state *state)
{
struct intel_display *display = to_intel_display(state);
return display->cdclk.funcs->modeset_calc_cdclk(state);
}
static u8 intel_cdclk_calc_voltage_level(struct intel_display *display,
int cdclk)
{
return display->cdclk.funcs->calc_voltage_level(cdclk);
}
static void fixed_133mhz_get_cdclk(struct intel_display *display,
struct intel_cdclk_config *cdclk_config)
{
cdclk_config->cdclk = 133333;
}
static void fixed_200mhz_get_cdclk(struct intel_display *display,
struct intel_cdclk_config *cdclk_config)
{
cdclk_config->cdclk = 200000;
}
static void fixed_266mhz_get_cdclk(struct intel_display *display,
struct intel_cdclk_config *cdclk_config)
{
Annotation
- Immediate include surface: `linux/debugfs.h`, `linux/iopoll.h`, `linux/time.h`, `drm/drm_fixed.h`, `drm/drm_print.h`, `drm/intel/intel_pcode_regs.h`, `drm/intel/pci_config.h`, `drm/intel/step.h`.
- Detected declarations: `struct intel_cdclk_state`, `struct intel_cdclk_funcs`, `struct intel_cdclk_vals`, `function intel_cdclk_get_cdclk`, `function intel_cdclk_set_cdclk`, `function intel_cdclk_modeset_calc_cdclk`, `function intel_cdclk_calc_voltage_level`, `function fixed_133mhz_get_cdclk`, `function fixed_200mhz_get_cdclk`, `function fixed_266mhz_get_cdclk`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source 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.