drivers/gpu/drm/i915/display/intel_pmdemand.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/display/intel_pmdemand.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/display/intel_pmdemand.c- Extension
.c- Size
- 19711 bytes
- Lines
- 676
- 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/bitops.hdrm/drm_print.hdrm/intel/step.hintel_atomic.hintel_bw.hintel_cdclk.hintel_de.hintel_display_jiffies.hintel_display_regs.hintel_display_trace.hintel_display_utils.hintel_display_wa.hintel_pmdemand.hskl_watermark.h
Detected Declarations
struct pmdemand_paramsstruct intel_pmdemand_statefunction intel_pmdemand_duplicate_statefunction intel_pmdemand_destroy_statefunction intel_atomic_get_pmdemand_statefunction intel_atomic_get_old_pmdemand_statefunction intel_atomic_get_new_pmdemand_statefunction intel_pmdemand_initfunction intel_pmdemand_init_earlyfunction intel_pmdemand_update_phys_maskfunction intel_pmdemand_update_port_clockfunction intel_pmdemand_update_max_ddiclkfunction intel_pmdemand_update_connector_physfunction intel_pmdemand_update_active_non_tc_physfunction for_each_oldnew_connector_in_statefunction intel_pmdemand_encoder_has_tc_phyfunction intel_pmdemand_connector_needs_updatefunction for_each_oldnew_connector_in_statefunction intel_pmdemand_needs_updatefunction intel_pmdemand_atomic_checkfunction intel_pmdemand_check_prev_transactionfunction intel_pmdemand_init_pmdemand_paramsfunction intel_pmdemand_req_completefunction intel_pmdemand_pollfunction intel_pmdemand_waitfunction intel_pmdemand_program_dbuffunction intel_pmdemand_update_paramsfunction intel_pmdemand_program_paramsfunction intel_pmdemand_state_changedfunction intel_pmdemand_pre_plane_updatefunction intel_pmdemand_post_plane_update
Annotated Snippet
struct pmdemand_params {
u16 qclk_gv_bw;
u8 voltage_index;
u8 qclk_gv_index;
u8 active_pipes;
u8 active_dbufs; /* pre-Xe3 only */
/* Total number of non type C active phys from active_phys_mask */
u8 active_phys;
u8 plls;
u16 cdclk_freq_mhz;
/* max from ddi_clocks[] */
u16 ddiclk_max;
u8 scalers; /* pre-Xe3 only */
};
struct intel_pmdemand_state {
struct intel_global_state base;
/* Maintain a persistent list of port clocks across all crtcs */
int ddi_clocks[I915_MAX_PIPES];
/* Maintain a persistent list of non type C phys mask */
u16 active_combo_phys_mask;
/* Parameters to be configured in the pmdemand registers */
struct pmdemand_params params;
};
struct intel_pmdemand_state *to_intel_pmdemand_state(struct intel_global_state *obj_state)
{
return container_of(obj_state, struct intel_pmdemand_state, base);
}
static struct intel_global_state *
intel_pmdemand_duplicate_state(struct intel_global_obj *obj)
{
struct intel_pmdemand_state *pmdemand_state;
pmdemand_state = kmemdup(obj->state, sizeof(*pmdemand_state), GFP_KERNEL);
if (!pmdemand_state)
return NULL;
return &pmdemand_state->base;
}
static void intel_pmdemand_destroy_state(struct intel_global_obj *obj,
struct intel_global_state *state)
{
kfree(state);
}
static const struct intel_global_state_funcs intel_pmdemand_funcs = {
.atomic_duplicate_state = intel_pmdemand_duplicate_state,
.atomic_destroy_state = intel_pmdemand_destroy_state,
};
static struct intel_pmdemand_state *
intel_atomic_get_pmdemand_state(struct intel_atomic_state *state)
{
struct intel_display *display = to_intel_display(state);
struct intel_global_state *pmdemand_state =
intel_atomic_get_global_obj_state(state,
&display->pmdemand.obj);
if (IS_ERR(pmdemand_state))
return ERR_CAST(pmdemand_state);
return to_intel_pmdemand_state(pmdemand_state);
}
static struct intel_pmdemand_state *
intel_atomic_get_old_pmdemand_state(struct intel_atomic_state *state)
{
struct intel_display *display = to_intel_display(state);
struct intel_global_state *pmdemand_state =
intel_atomic_get_old_global_obj_state(state,
&display->pmdemand.obj);
if (!pmdemand_state)
return NULL;
return to_intel_pmdemand_state(pmdemand_state);
}
static struct intel_pmdemand_state *
intel_atomic_get_new_pmdemand_state(struct intel_atomic_state *state)
{
struct intel_display *display = to_intel_display(state);
struct intel_global_state *pmdemand_state =
intel_atomic_get_new_global_obj_state(state,
Annotation
- Immediate include surface: `linux/bitops.h`, `drm/drm_print.h`, `drm/intel/step.h`, `intel_atomic.h`, `intel_bw.h`, `intel_cdclk.h`, `intel_de.h`, `intel_display_jiffies.h`.
- Detected declarations: `struct pmdemand_params`, `struct intel_pmdemand_state`, `function intel_pmdemand_duplicate_state`, `function intel_pmdemand_destroy_state`, `function intel_atomic_get_pmdemand_state`, `function intel_atomic_get_old_pmdemand_state`, `function intel_atomic_get_new_pmdemand_state`, `function intel_pmdemand_init`, `function intel_pmdemand_init_early`, `function intel_pmdemand_update_phys_mask`.
- 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.