drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c- Extension
.c- Size
- 64047 bytes
- Lines
- 1880
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
dm_services.hdm_helpers.hcore_types.hresource.hdccg.hdce/dce_hwseq.hdcn30/dcn30_cm_common.hreg_helper.habm.hhubp.hdchubbub.htiming_generator.hopp.hipp.hmpc.hmcif_wb.hdc_dmub_srv.hlink_hwss.hdpcd_defs.hdcn32_hwseq.hclk_mgr.hdsc.hdcn20/dcn20_optc.hdce/dmub_hw_lock_mgr.hdcn32/dcn32_resource.hlink_service.h../dcn20/dcn20_hwseq.hdc_state_priv.hdio/dcn10/dcn10_dio.h
Detected Declarations
function filesfunction dcn32_enable_power_gating_planefunction dcn32_hubp_pg_controlfunction dcn32_check_no_memory_request_for_cabfunction surfacesfunction dcn32_apply_idle_power_optimizationsfunction dcn32_commit_subvp_configfunction dcn32_subvp_pipe_control_lockfunction dcn32_subvp_pipe_control_lock_fastfunction dcn32_set_mpc_shaper_3dlutfunction dcn32_set_mcm_lutsfunction dcn32_set_input_transfer_funcfunction dcn32_set_output_transfer_funcfunction dcn32_update_force_pstatefunction dcn32_update_mall_selfunction dcn32_program_mall_pipe_configfunction dcn32_initialize_min_clocksfunction dcn32_init_hwfunction DMUB_FW_VERSIONfunction dcn32_update_dsc_on_streamfunction get_odm_configfunction dcn32_update_odmfunction dcn32_calculate_dccg_k1_k2_valuesfunction dcn32_calculate_pix_rate_dividerfunction dcn32_resync_fifo_dccg_diofunction dcn32_unblank_streamfunction dcn32_is_dp_dig_pixel_rate_div_policyfunction apply_symclk_on_tx_off_wafunction dcn32_disable_link_outputfunction dcn32_update_phantom_vp_positionfunction dcn32_apply_update_flags_for_phantomfunction dcn32_dsc_pg_statusfunction dcn32_update_dsc_pgfunction dcn32_disable_phantom_streamsfunction dcn32_enable_phantom_streamsfunction dcn32_init_blankfunction is_subvp_phantom_topology_transition_seamlessfunction dcn32_is_pipe_topology_transition_seamlessfunction dcn32_prepare_bandwidthfunction dcn32_interdependent_update_lockfunction dcn32_program_outstanding_updates
Annotated Snippet
if (dcn32_check_no_memory_request_for_cab(dc)) {
/* Enable no-memory-requests case */
memset(&cmd, 0, sizeof(cmd));
cmd.cab.header.type = DMUB_CMD__CAB_FOR_SS;
cmd.cab.header.sub_type = DMUB_CMD__CAB_NO_DCN_REQ;
cmd.cab.header.payload_bytes = sizeof(cmd.cab) - sizeof(cmd.cab.header);
dc_wake_and_execute_dmub_cmd(dc->ctx, &cmd, DM_DMUB_WAIT_TYPE_NO_WAIT);
return true;
}
/* 2. Check if all surfaces can fit in CAB.
* If surfaces can fit into CAB, send CAB_ACTION_ALLOW DMUB message
* and configure HUBP's to fetch from MALL
*/
ways = dcn32_calculate_cab_allocation(dc, dc->current_state);
/* MALL not supported with Stereo3D or TMZ surface. If any plane is using stereo,
* or TMZ surface, don't try to enter MALL.
*/
for (i = 0; i < dc->current_state->stream_count; i++) {
for (j = 0; j < dc->current_state->stream_status[i].plane_count; j++) {
plane = dc->current_state->stream_status[i].plane_states[j];
if (plane->address.type == PLN_ADDR_TYPE_GRPH_STEREO ||
plane->address.tmz_surface) {
mall_ss_unsupported = true;
break;
}
}
if (mall_ss_unsupported)
break;
}
if (ways <= dc->caps.cache_num_ways && !mall_ss_unsupported) {
memset(&cmd, 0, sizeof(cmd));
cmd.cab.header.type = DMUB_CMD__CAB_FOR_SS;
cmd.cab.header.sub_type = DMUB_CMD__CAB_DCN_SS_FIT_IN_CAB;
cmd.cab.header.payload_bytes = sizeof(cmd.cab) - sizeof(cmd.cab.header);
cmd.cab.cab_alloc_ways = (uint8_t)ways;
dc_wake_and_execute_dmub_cmd(dc->ctx, &cmd, DM_DMUB_WAIT_TYPE_NO_WAIT);
DC_LOG_MALL("enable scanout from MALL");
return true;
}
DC_LOG_MALL("surface cannot fit in CAB, disabling scanout from MALL\n");
return false;
}
/* Disable CAB */
memset(&cmd, 0, sizeof(cmd));
cmd.cab.header.type = DMUB_CMD__CAB_FOR_SS;
cmd.cab.header.sub_type = DMUB_CMD__CAB_NO_IDLE_OPTIMIZATION;
cmd.cab.header.payload_bytes =
sizeof(cmd.cab) - sizeof(cmd.cab.header);
dc_wake_and_execute_dmub_cmd(dc->ctx, &cmd, DM_DMUB_WAIT_TYPE_WAIT);
return true;
}
/* Send DMCUB message with SubVP pipe info
* - For each pipe in context, populate payload with required SubVP information
* if the pipe is using SubVP for MCLK switch
* - This function must be called while the DMUB HW lock is acquired by driver
*/
void dcn32_commit_subvp_config(struct dc *dc, struct dc_state *context)
{
unsigned int i;
bool enable_subvp = false;
if (!dc->ctx || !dc->ctx->dmub_srv)
return;
for (i = 0; i < dc->res_pool->pipe_count; i++) {
struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i];
if (pipe_ctx->stream && dc_state_get_pipe_subvp_type(context, pipe_ctx) == SUBVP_MAIN) {
// There is at least 1 SubVP pipe, so enable SubVP
enable_subvp = true;
break;
}
}
dc_dmub_setup_subvp_dmub_command(dc, context, enable_subvp);
}
/* Sub-Viewport DMUB lock needs to be acquired by driver whenever SubVP is active and:
* 1. Any full update for any SubVP main pipe
Annotation
- Immediate include surface: `dm_services.h`, `dm_helpers.h`, `core_types.h`, `resource.h`, `dccg.h`, `dce/dce_hwseq.h`, `dcn30/dcn30_cm_common.h`, `reg_helper.h`.
- Detected declarations: `function files`, `function dcn32_enable_power_gating_plane`, `function dcn32_hubp_pg_control`, `function dcn32_check_no_memory_request_for_cab`, `function surfaces`, `function dcn32_apply_idle_power_optimizations`, `function dcn32_commit_subvp_config`, `function dcn32_subvp_pipe_control_lock`, `function dcn32_subvp_pipe_control_lock_fast`, `function dcn32_set_mpc_shaper_3dlut`.
- 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.