drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c- Extension
.c- Size
- 33896 bytes
- Lines
- 1194
- 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.
- 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
core_types.hlink_encoder.hdce_dmcu.hdm_services.hreg_helper.hfixed31_32.hdc.h
Detected Declarations
function dce_dmcu_initfunction dce_dmcu_load_iramfunction dce_get_dmcu_psr_statefunction dce_dmcu_set_psr_enablefunction dce_dmcu_setup_psrfunction dce_is_dmcu_initializedfunction dce_psr_wait_loopfunction dce_get_psr_wait_loopfunction dcn10_get_dmcu_versionfunction dcn10_dmcu_enable_fractional_pwmfunction dcn10_dmcu_initfunction dcn21_dmcu_initfunction dcn10_dmcu_load_iramfunction dcn10_get_dmcu_psr_statefunction dcn10_dmcu_set_psr_enablefunction dcn10_dmcu_setup_psrfunction dcn10_psr_wait_loopfunction dcn10_get_psr_wait_loopfunction dcn10_is_dmcu_initializedfunction dcn20_lock_phyfunction dcn20_unlock_phyfunction dcn10_send_edid_ceafunction dcn10_get_scp_resultsfunction dcn10_recv_amd_vsdbfunction dcn10_recv_edid_cea_ackfunction dcn10_forward_crc_windowfunction dcn10_stop_crc_win_updatefunction dce_dmcu_constructfunction dcn21_dmcu_constructfunction dce_dmcu_destroy
Annotated Snippet
if (enable) {
if (state != PSR_STATE0)
break;
} else {
if (state == PSR_STATE0)
break;
}
udelay(10);
}
}
}
static bool dce_dmcu_setup_psr(struct dmcu *dmcu,
struct dc_link *link,
struct psr_context *psr_context)
{
struct dce_dmcu *dmcu_dce = TO_DCE_DMCU(dmcu);
unsigned int dmcu_max_retry_on_wait_reg_ready = 801;
unsigned int dmcu_wait_reg_ready_interval = 100;
union dce_dmcu_psr_config_data_reg1 masterCmdData1;
union dce_dmcu_psr_config_data_reg2 masterCmdData2;
union dce_dmcu_psr_config_data_reg3 masterCmdData3;
link->link_enc->funcs->psr_program_dp_dphy_fast_training(link->link_enc,
psr_context->psrExitLinkTrainingRequired);
/* Enable static screen interrupts for PSR supported display */
/* Disable the interrupt coming from other displays. */
REG_UPDATE_4(DMCU_INTERRUPT_TO_UC_EN_MASK,
STATIC_SCREEN1_INT_TO_UC_EN, 0,
STATIC_SCREEN2_INT_TO_UC_EN, 0,
STATIC_SCREEN3_INT_TO_UC_EN, 0,
STATIC_SCREEN4_INT_TO_UC_EN, 0);
switch (psr_context->controllerId) {
/* Driver uses case 1 for unconfigured */
case 1:
REG_UPDATE(DMCU_INTERRUPT_TO_UC_EN_MASK,
STATIC_SCREEN1_INT_TO_UC_EN, 1);
break;
case 2:
REG_UPDATE(DMCU_INTERRUPT_TO_UC_EN_MASK,
STATIC_SCREEN2_INT_TO_UC_EN, 1);
break;
case 3:
REG_UPDATE(DMCU_INTERRUPT_TO_UC_EN_MASK,
STATIC_SCREEN3_INT_TO_UC_EN, 1);
break;
case 4:
REG_UPDATE(DMCU_INTERRUPT_TO_UC_EN_MASK,
STATIC_SCREEN4_INT_TO_UC_EN, 1);
break;
case 5:
/* CZ/NL only has 4 CRTC!!
* really valid.
* There is no interrupt enable mask for these instances.
*/
break;
case 6:
/* CZ/NL only has 4 CRTC!!
* These are here because they are defined in HW regspec,
* but not really valid. There is no interrupt enable mask
* for these instances.
*/
break;
default:
REG_UPDATE(DMCU_INTERRUPT_TO_UC_EN_MASK,
STATIC_SCREEN1_INT_TO_UC_EN, 1);
break;
}
link->link_enc->funcs->psr_program_secondary_packet(link->link_enc,
psr_context->sdpTransmitLineNumDeadline);
/* waitDMCUReadyForCmd */
REG_WAIT(MASTER_COMM_CNTL_REG, MASTER_COMM_INTERRUPT, 0,
dmcu_wait_reg_ready_interval,
dmcu_max_retry_on_wait_reg_ready);
/* setDMCUParam_PSRHostConfigData */
masterCmdData1.u32All = 0;
masterCmdData1.bits.timehyst_frames = psr_context->timehyst_frames;
masterCmdData1.bits.hyst_lines = psr_context->hyst_lines;
masterCmdData1.bits.rfb_update_auto_en =
psr_context->rfb_update_auto_en;
masterCmdData1.bits.dp_port_num = psr_context->transmitterId;
masterCmdData1.bits.dcp_sel = psr_context->controllerId;
masterCmdData1.bits.phy_type = psr_context->phyType;
Annotation
- Immediate include surface: `core_types.h`, `link_encoder.h`, `dce_dmcu.h`, `dm_services.h`, `reg_helper.h`, `fixed31_32.h`, `dc.h`.
- Detected declarations: `function dce_dmcu_init`, `function dce_dmcu_load_iram`, `function dce_get_dmcu_psr_state`, `function dce_dmcu_set_psr_enable`, `function dce_dmcu_setup_psr`, `function dce_is_dmcu_initialized`, `function dce_psr_wait_loop`, `function dce_get_psr_wait_loop`, `function dcn10_get_dmcu_version`, `function dcn10_dmcu_enable_fractional_pwm`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source 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.