drivers/gpu/drm/i915/display/intel_display_power.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/display/intel_display_power.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/display/intel_display_power.c- Extension
.c- Size
- 78848 bytes
- Lines
- 2582
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/iopoll.hlinux/string_helpers.hdrm/drm_print.hdrm/intel/intel_pcode_regs.hdrm/intel/step.hintel_backlight_regs.hintel_cdclk.hintel_clock_gating.hintel_combo_phy.hintel_de.hintel_display_power.hintel_display_power_map.hintel_display_power_well.hintel_display_regs.hintel_display_rpm.hintel_display_types.hintel_display_utils.hintel_display_wa.hintel_dmc.hintel_dram.hintel_mchbar.hintel_parent.hintel_pch_refclk.hintel_pmdemand.hintel_pps_regs.hintel_snps_phy.hskl_watermark.hskl_watermark_regs.hvlv_sideband.h
Detected Declarations
struct buddy_page_maskstruct intel_ddi_port_domainsfunction for_each_iffunction __intel_display_power_is_enabledfunction for_each_power_domain_well_reversefunction intel_display_power_is_enabledfunction sanitize_target_dc_statefunction intel_display_power_set_target_dc_statefunction intel_display_power_get_current_dc_statefunction __async_put_domains_maskfunction assert_async_put_domain_masks_disjointfunction __async_put_domains_state_okfunction print_power_domainsfunction print_async_put_domains_statefunction verify_async_put_domains_statefunction assert_async_put_domain_masks_disjointfunction async_put_domains_clear_domainfunction cancel_async_put_workfunction intel_display_power_grab_async_put_reffunction __intel_display_power_get_domainfunction intel_display_power_putfunction intel_display_power_putfunction __intel_display_power_put_domainfunction __intel_display_power_putfunction queue_async_put_domains_workfunction release_async_put_domainsfunction for_each_power_domainfunction intel_display_power_put_async_workfunction __intel_display_power_put_asyncfunction intel_display_power_flush_work_syncfunction intel_display_power_flush_workfunction intel_display_power_getfunction intel_display_power_getfunction intel_display_power_get_in_setfunction intel_display_power_get_in_set_if_enabledfunction intel_display_power_put_mask_in_setfunction for_each_power_domainfunction sanitize_disable_power_well_optionfunction get_allowed_dc_maskfunction intel_display_power_initfunction intel_display_power_initfunction intel_power_domains_sync_hwfunction gen9_dbuf_slice_setfunction gen9_dbuf_slices_updatefunction gen9_dbuf_enablefunction gen9_dbuf_disablefunction gen12_dbuf_slices_configfunction icl_mbus_init
Annotated Snippet
struct buddy_page_mask {
u32 page_mask;
u8 type;
u8 num_channels;
};
static const struct buddy_page_mask tgl_buddy_page_masks[] = {
{ .num_channels = 1, .type = INTEL_DRAM_DDR4, .page_mask = 0xF },
{ .num_channels = 1, .type = INTEL_DRAM_DDR5, .page_mask = 0xF },
{ .num_channels = 2, .type = INTEL_DRAM_LPDDR4, .page_mask = 0x1C },
{ .num_channels = 2, .type = INTEL_DRAM_LPDDR5, .page_mask = 0x1C },
{ .num_channels = 2, .type = INTEL_DRAM_DDR4, .page_mask = 0x1F },
{ .num_channels = 2, .type = INTEL_DRAM_DDR5, .page_mask = 0x1E },
{ .num_channels = 4, .type = INTEL_DRAM_LPDDR4, .page_mask = 0x38 },
{ .num_channels = 4, .type = INTEL_DRAM_LPDDR5, .page_mask = 0x38 },
{}
};
static const struct buddy_page_mask wa_1409767108_buddy_page_masks[] = {
{ .num_channels = 1, .type = INTEL_DRAM_LPDDR4, .page_mask = 0x1 },
{ .num_channels = 1, .type = INTEL_DRAM_DDR4, .page_mask = 0x1 },
{ .num_channels = 1, .type = INTEL_DRAM_DDR5, .page_mask = 0x1 },
{ .num_channels = 1, .type = INTEL_DRAM_LPDDR5, .page_mask = 0x1 },
{ .num_channels = 2, .type = INTEL_DRAM_LPDDR4, .page_mask = 0x3 },
{ .num_channels = 2, .type = INTEL_DRAM_DDR4, .page_mask = 0x3 },
{ .num_channels = 2, .type = INTEL_DRAM_DDR5, .page_mask = 0x3 },
{ .num_channels = 2, .type = INTEL_DRAM_LPDDR5, .page_mask = 0x3 },
{}
};
static void tgl_bw_buddy_init(struct intel_display *display)
{
const struct dram_info *dram_info = intel_dram_info(display);
const struct buddy_page_mask *table;
unsigned long abox_mask = DISPLAY_INFO(display)->abox_mask;
int config, i;
/* BW_BUDDY registers are not used on dgpu's beyond DG1 */
if (display->platform.dgfx && !display->platform.dg1)
return;
if (intel_display_wa(display, INTEL_DISPLAY_WA_1409767108))
/* Wa_1409767108 */
table = wa_1409767108_buddy_page_masks;
else
table = tgl_buddy_page_masks;
for (config = 0; table[config].page_mask != 0; config++)
if (table[config].num_channels == dram_info->num_channels &&
table[config].type == dram_info->type)
break;
if (table[config].page_mask == 0) {
drm_dbg_kms(display->drm,
"Unknown memory configuration; disabling address buddy logic.\n");
for_each_set_bit(i, &abox_mask, BITS_PER_TYPE(abox_mask))
intel_de_write(display, BW_BUDDY_CTL(i),
BW_BUDDY_DISABLE);
} else {
for_each_set_bit(i, &abox_mask, BITS_PER_TYPE(abox_mask)) {
intel_de_write(display, BW_BUDDY_PAGE_MASK(i),
table[config].page_mask);
/* Wa_22010178259:tgl,dg1,rkl,adl-s */
if (intel_display_wa(display, INTEL_DISPLAY_WA_22010178259))
intel_de_rmw(display, BW_BUDDY_CTL(i),
BW_BUDDY_TLB_REQ_TIMER_MASK,
BW_BUDDY_TLB_REQ_TIMER(0x8));
}
}
}
static void icl_display_core_init(struct intel_display *display,
bool resume)
{
struct i915_power_domains *power_domains = &display->power.domains;
struct i915_power_well *well;
gen9_set_dc_state(display, DC_STATE_DISABLE);
/* Wa_14011294188:ehl,jsl,tgl,rkl,adl-s */
if (intel_display_wa(display, INTEL_DISPLAY_WA_14011294188))
intel_de_rmw(display, SOUTH_DSPCLK_GATE_D, 0,
PCH_DPMGUNIT_CLOCK_GATE_DISABLE);
/* 1. Enable PCH reset handshake. */
intel_pch_reset_handshake(display, !HAS_PCH_NOP(display));
if (!HAS_DISPLAY(display))
return;
Annotation
- Immediate include surface: `linux/iopoll.h`, `linux/string_helpers.h`, `drm/drm_print.h`, `drm/intel/intel_pcode_regs.h`, `drm/intel/step.h`, `intel_backlight_regs.h`, `intel_cdclk.h`, `intel_clock_gating.h`.
- Detected declarations: `struct buddy_page_mask`, `struct intel_ddi_port_domains`, `function for_each_if`, `function __intel_display_power_is_enabled`, `function for_each_power_domain_well_reverse`, `function intel_display_power_is_enabled`, `function sanitize_target_dc_state`, `function intel_display_power_set_target_dc_state`, `function intel_display_power_get_current_dc_state`, `function __async_put_domains_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.