drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c- Extension
.c- Size
- 150146 bytes
- Lines
- 4172
- 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
os_types.hdm_services.hbasics/dc_common.hdm_helpers.hcore_types.hresource.hdccg.hdce/dce_hwseq.hreg_helper.habm.hhubp.hdchubbub.htiming_generator.hopp.hipp.hmpc.hmcif_wb.hdc_dmub_srv.hlink_hwss.hdpcd_defs.hclk_mgr.hdsc.hlink_service.hcustom_float.hdce/dmub_hw_lock_mgr.hdcn10/dcn10_cm_common.hdcn10/dcn10_hubbub.hdcn20/dcn20_optc.hdcn30/dcn30_cm_common.hdcn32/dcn32_hwseq.hdcn401_hwseq.hdcn401/dcn401_resource.h
Detected Declarations
function dcn401_initialize_min_clocksfunction dcn401_program_gamut_remapfunction dcn401_init_hwfunction dcn401_get_mcm_lut_xable_from_pipe_ctxfunction dcn401_populate_mcm_lutsfunction dcn401_trigger_3dlut_dma_loadfunction dcn401_set_mcm_lutsfunction dcn401_set_output_transfer_funcfunction dcn401_calculate_dccg_tmds_div_valuefunction enable_stream_timing_calcfunction dcn401_enable_stream_timingfunction get_phyd32clk_srcfunction dcn401_enable_stream_calcfunction dcn401_enable_streamfunction dcn401_setup_hpo_hw_controlfunction adjust_hotspot_between_slices_for_2x_magnifyfunction disable_link_output_symclk_on_tx_offfunction dcn401_disable_link_outputfunction dcn401_set_cursor_positionfunction dcn401_check_no_memory_request_for_cabfunction dcn401_calculate_cab_allocationfunction dcn401_apply_idle_power_optimizationsfunction dcn401_wait_for_dcc_meta_propagationfunction dcn401_prepare_bandwidthfunction dcn401_optimize_bandwidthfunction dcn401_dmub_hw_control_lockfunction dcn401_dmub_hw_control_lock_fastfunction dcn401_fams2_update_configfunction update_dsc_for_odm_changefunction dcn401_update_odmfunction dcn401_add_dsc_sequence_for_odm_changefunction dcn401_update_odm_sequencefunction dcn401_unblank_streamfunction dcn401_hardware_releasefunction dcn401_wait_for_det_buffer_update_under_otg_masterfunction dcn401_interdependent_update_lockfunction dcn401_perform_3dlut_wa_unlockfunction dcn401_program_outstanding_updatesfunction dcn401_reset_back_end_for_pipefunction dc_hwss_disable_otg_pwafunction dcn401_reset_hw_ctx_wrapfunction dcn401_calculate_vready_offset_for_groupfunction dcn401_program_tgfunction dcn401_program_pipefunction dcn401_program_pipe_sequencefunction hwss_add_opp_set_disp_pattern_generatorfunction dcn401_program_front_end_for_ctxfunction here
Annotated Snippet
if (dc->clk_mgr->funcs->get_dispclk_from_dentist) {
clocks->dispclk_khz = dc->clk_mgr->funcs->get_dispclk_from_dentist(dc->clk_mgr);
} else {
clocks->dispclk_khz = dc->clk_mgr->boot_snapshot.dispclk * 1000;
}
}
clocks->ref_dtbclk_khz = dc->clk_mgr->bw_params->clk_table.entries[0].dtbclk_mhz * 1000;
clocks->fclk_p_state_change_support = true;
clocks->p_state_change_support = true;
dc->clk_mgr->funcs->update_clocks(
dc->clk_mgr,
dc->current_state,
true);
}
void dcn401_program_gamut_remap(struct pipe_ctx *pipe_ctx)
{
unsigned int i = 0;
struct mpc_grph_gamut_adjustment mpc_adjust;
unsigned int mpcc_id = pipe_ctx->plane_res.mpcc_inst;
struct mpc *mpc = pipe_ctx->stream_res.opp->ctx->dc->res_pool->mpc;
//For now assert if location is not pre-blend
if (pipe_ctx->plane_state)
ASSERT(pipe_ctx->plane_state->mcm_location == MPCC_MOVABLE_CM_LOCATION_BEFORE);
// program MPCC_MCM_FIRST_GAMUT_REMAP
memset(&mpc_adjust, 0, sizeof(mpc_adjust));
mpc_adjust.gamut_adjust_type = GRAPHICS_GAMUT_ADJUST_TYPE_BYPASS;
mpc_adjust.mpcc_gamut_remap_block_id = MPCC_MCM_FIRST_GAMUT_REMAP;
if (pipe_ctx->plane_state &&
pipe_ctx->plane_state->gamut_remap_matrix.enable_remap == true) {
mpc_adjust.gamut_adjust_type = GRAPHICS_GAMUT_ADJUST_TYPE_SW;
for (i = 0; i < CSC_TEMPERATURE_MATRIX_SIZE; i++)
mpc_adjust.temperature_matrix[i] =
pipe_ctx->plane_state->gamut_remap_matrix.matrix[i];
}
mpc->funcs->set_gamut_remap(mpc, mpcc_id, &mpc_adjust);
// program MPCC_MCM_SECOND_GAMUT_REMAP for Bypass / Disable for now
mpc_adjust.gamut_adjust_type = GRAPHICS_GAMUT_ADJUST_TYPE_BYPASS;
mpc_adjust.mpcc_gamut_remap_block_id = MPCC_MCM_SECOND_GAMUT_REMAP;
mpc->funcs->set_gamut_remap(mpc, mpcc_id, &mpc_adjust);
// program MPCC_OGAM_GAMUT_REMAP same as is currently used on DCN3x
memset(&mpc_adjust, 0, sizeof(mpc_adjust));
mpc_adjust.gamut_adjust_type = GRAPHICS_GAMUT_ADJUST_TYPE_BYPASS;
mpc_adjust.mpcc_gamut_remap_block_id = MPCC_OGAM_GAMUT_REMAP;
if (pipe_ctx->top_pipe == NULL) {
if (pipe_ctx->stream->gamut_remap_matrix.enable_remap == true) {
mpc_adjust.gamut_adjust_type = GRAPHICS_GAMUT_ADJUST_TYPE_SW;
for (i = 0; i < CSC_TEMPERATURE_MATRIX_SIZE; i++)
mpc_adjust.temperature_matrix[i] =
pipe_ctx->stream->gamut_remap_matrix.matrix[i];
}
}
mpc->funcs->set_gamut_remap(mpc, mpcc_id, &mpc_adjust);
}
void dcn401_init_hw(struct dc *dc)
{
struct abm **abms = dc->res_pool->multiple_abms;
struct dce_hwseq *hws = dc->hwseq;
struct dc_bios *dcb = dc->ctx->dc_bios;
struct resource_pool *res_pool = dc->res_pool;
unsigned int i;
unsigned int edp_num;
uint32_t backlight = MAX_BACKLIGHT_LEVEL;
uint32_t user_level = MAX_BACKLIGHT_LEVEL;
bool dchub_ref_freq_changed;
int current_dchub_ref_freq = 0;
if (dc->clk_mgr && dc->clk_mgr->funcs && dc->clk_mgr->funcs->init_clocks) {
dc->clk_mgr->funcs->init_clocks(dc->clk_mgr);
// mark dcmode limits present if any clock has distinct AC and DC values from SMU
dc->caps.dcmode_power_limits_present = dc->clk_mgr->funcs->is_dc_mode_present &&
dc->clk_mgr->funcs->is_dc_mode_present(dc->clk_mgr);
}
// Initialize the dccg
if (res_pool->dccg->funcs->dccg_init)
res_pool->dccg->funcs->dccg_init(res_pool->dccg);
Annotation
- Immediate include surface: `os_types.h`, `dm_services.h`, `basics/dc_common.h`, `dm_helpers.h`, `core_types.h`, `resource.h`, `dccg.h`, `dce/dce_hwseq.h`.
- Detected declarations: `function dcn401_initialize_min_clocks`, `function dcn401_program_gamut_remap`, `function dcn401_init_hw`, `function dcn401_get_mcm_lut_xable_from_pipe_ctx`, `function dcn401_populate_mcm_luts`, `function dcn401_trigger_3dlut_dma_load`, `function dcn401_set_mcm_luts`, `function dcn401_set_output_transfer_func`, `function dcn401_calculate_dccg_tmds_div_value`, `function enable_stream_timing_calc`.
- 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.