drivers/gpu/drm/amd/display/dc/clk_mgr/dcn401/dcn401_clk_mgr_smu_msg.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn401/dcn401_clk_mgr_smu_msg.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn401/dcn401_clk_mgr_smu_msg.c- Extension
.c- Size
- 13441 bytes
- Lines
- 473
- 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
dcn401_clk_mgr_smu_msg.hclk_mgr_internal.hreg_helper.hdalsmc.hdcn401_smu14_driver_if.hlogger_types.h
Detected Declarations
function dcn401_smu_wait_for_responsefunction dcn401_smu_send_msg_with_paramfunction dcn401_smu_wait_for_response_delayfunction dcn401_smu_send_msg_with_param_delayfunction dcn401_smu_get_smu_versionfunction dcn401_smu_check_driver_if_versionfunction dcn401_smu_check_msg_header_versionfunction dcn401_smu_send_fclk_pstate_messagefunction dcn401_smu_send_uclk_pstate_messagefunction dcn401_smu_send_cab_for_uclk_messagefunction dcn401_smu_set_dram_addr_highfunction dcn401_smu_set_dram_addr_lowfunction dcn401_smu_transfer_wm_table_dram_2_smufunction dcn401_smu_set_pme_workaroundfunction dcn401_smu_get_hard_min_statusfunction dcn401_smu_wait_hard_min_statusfunction dcn401_smu_set_hard_min_by_freqfunction dcn401_smu_wait_for_dmub_ack_mclkfunction dcn401_smu_indicate_drr_statusfunction dcn401_smu_set_idle_uclk_fclk_hardminfunction dcn401_smu_set_active_uclk_fclk_hardminfunction dcn401_smu_set_subvp_uclk_fclk_hardminfunction dcn401_smu_set_min_deep_sleep_dcef_clkfunction dcn401_smu_set_num_of_displaysfunction dcn401_smu_get_num_of_umc_channelsfunction dcn401_smu_get_dpm_freq_by_indexfunction dcn401_smu_get_dc_mode_max_dpm_freq
Annotated Snippet
if (!hardmin_done && total_delay_us > 0) {
/* hardmin not yet fulfilled, wait 500us and retry*/
udelay(500);
total_delay_us += 500;
smu_print("SMU Wait hard min status for %d us\n", total_delay_us);
}
hardmin_status = dcn401_smu_get_hard_min_status(clk_mgr, &no_timeout, &read_total_delay_us);
total_delay_us += read_total_delay_us;
hardmin_done = hardmin_status & hardmin_status_mask;
}
return hardmin_done;
}
/* Returns the actual frequency that was set in MHz, 0 on failure */
unsigned int dcn401_smu_set_hard_min_by_freq(struct clk_mgr_internal *clk_mgr, uint32_t clk, uint16_t freq_mhz)
{
uint32_t response = 0;
bool hard_min_done = false;
/* bits 23:16 for clock type, lower 16 bits for frequency in MHz */
uint32_t param = (clk << 16) | freq_mhz;
smu_print("SMU Set hard min by freq: clk = %d, freq_mhz = %d MHz\n", clk, freq_mhz);
dcn401_smu_send_msg_with_param(clk_mgr,
DALSMC_MSG_SetHardMinByFreq, param, &response);
/* wait until hardmin acknowledged */
hard_min_done = dcn401_smu_wait_hard_min_status(clk_mgr, clk);
smu_print("SMU Frequency set = %d KHz hard_min_done %d\n", response, hard_min_done);
return response;
}
void dcn401_smu_wait_for_dmub_ack_mclk(struct clk_mgr_internal *clk_mgr, bool enable)
{
smu_print("SMU to wait for DMCUB ack for MCLK : %d\n", enable);
dcn401_smu_send_msg_with_param(clk_mgr, DALSMC_MSG_SetAlwaysWaitDmcubResp, enable ? 1 : 0, NULL);
}
void dcn401_smu_indicate_drr_status(struct clk_mgr_internal *clk_mgr, bool mod_drr_for_pstate)
{
smu_print("SMU Set indicate drr status = %d\n", mod_drr_for_pstate);
dcn401_smu_send_msg_with_param(clk_mgr,
DALSMC_MSG_IndicateDrrStatus, mod_drr_for_pstate ? 1 : 0, NULL);
}
bool dcn401_smu_set_idle_uclk_fclk_hardmin(struct clk_mgr_internal *clk_mgr,
uint16_t uclk_freq_mhz,
uint16_t fclk_freq_mhz)
{
uint32_t response = 0;
bool success;
/* 15:0 for uclk, 32:16 for fclk */
uint32_t param = (fclk_freq_mhz << 16) | uclk_freq_mhz;
smu_print("SMU Set idle hardmin by freq: uclk_freq_mhz = %d MHz, fclk_freq_mhz = %d MHz\n", uclk_freq_mhz, fclk_freq_mhz);
success = dcn401_smu_send_msg_with_param(clk_mgr,
DALSMC_MSG_IdleUclkFclk, param, &response);
/* wait until hardmin acknowledged */
success &= dcn401_smu_wait_hard_min_status(clk_mgr, PPCLK_UCLK);
smu_print("SMU hard_min_done %d\n", success);
return success;
}
bool dcn401_smu_set_active_uclk_fclk_hardmin(struct clk_mgr_internal *clk_mgr,
uint16_t uclk_freq_mhz,
uint16_t fclk_freq_mhz)
{
uint32_t response = 0;
bool success;
/* 15:0 for uclk, 32:16 for fclk */
uint32_t param = (fclk_freq_mhz << 16) | uclk_freq_mhz;
smu_print("SMU Set active hardmin by freq: uclk_freq_mhz = %d MHz, fclk_freq_mhz = %d MHz\n", uclk_freq_mhz, fclk_freq_mhz);
success = dcn401_smu_send_msg_with_param(clk_mgr,
DALSMC_MSG_ActiveUclkFclk, param, &response);
/* wait until hardmin acknowledged */
Annotation
- Immediate include surface: `dcn401_clk_mgr_smu_msg.h`, `clk_mgr_internal.h`, `reg_helper.h`, `dalsmc.h`, `dcn401_smu14_driver_if.h`, `logger_types.h`.
- Detected declarations: `function dcn401_smu_wait_for_response`, `function dcn401_smu_send_msg_with_param`, `function dcn401_smu_wait_for_response_delay`, `function dcn401_smu_send_msg_with_param_delay`, `function dcn401_smu_get_smu_version`, `function dcn401_smu_check_driver_if_version`, `function dcn401_smu_check_msg_header_version`, `function dcn401_smu_send_fclk_pstate_message`, `function dcn401_smu_send_uclk_pstate_message`, `function dcn401_smu_send_cab_for_uclk_message`.
- 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.