drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr_smu_msg.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr_smu_msg.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr_smu_msg.c- Extension
.c- Size
- 9566 bytes
- Lines
- 309
- 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
dcn32_clk_mgr_smu_msg.hclk_mgr_internal.hreg_helper.hdalsmc.hdcn32_smu13_driver_if.hlogger_types.h
Detected Declarations
function filesfunction dcn32_smu_wait_for_responsefunction dcn32_smu_send_msg_with_paramfunction dcn32_smu_wait_for_response_delayfunction dcn32_smu_send_msg_with_param_delayfunction dcn32_smu_send_fclk_pstate_messagefunction dcn32_smu_send_cab_for_uclk_messagefunction dcn32_smu_transfer_wm_table_dram_2_smufunction dcn32_smu_set_pme_workaroundfunction dcn32_get_hard_min_status_supportedfunction dcn32_smu_get_hard_min_statusfunction dcn32_smu_wait_get_hard_min_statusfunction dcn32_smu_set_hard_min_by_freqfunction dcn32_smu_wait_for_dmub_ack_mclk
Annotated Snippet
if (checkDalHardMinClkBits == (readDalHardMinClkBits & checkDalHardMinClkBits)) {
hard_min_done = true;
break;
}
if (total_delay_us >= 2000000) {
cur_wait_get_hard_min_max_timeouts++;
smu_print("SMU Wait get hard min status: %d timeouts\n", cur_wait_get_hard_min_max_timeouts);
break;
}
msleep(1);
total_delay_us += 1000;
}
if (total_delay_us > cur_wait_get_hard_min_max_us)
cur_wait_get_hard_min_max_us = total_delay_us;
smu_print("SMU Wait get hard min status: no_timeout %d, delay %d us, max %d us, read %x, check %x\n",
no_timeout, total_delay_us, cur_wait_get_hard_min_max_us, readDalHardMinClkBits, checkDalHardMinClkBits);
return hard_min_done;
}
/* Returns the actual frequency that was set in MHz, 0 on failure */
unsigned int dcn32_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);
dcn32_smu_send_msg_with_param(clk_mgr,
DALSMC_MSG_SetHardMinByFreq, param, &response);
if (dcn32_get_hard_min_status_supported(clk_mgr)) {
hard_min_done = dcn32_smu_wait_get_hard_min_status(clk_mgr, clk);
smu_print("SMU Frequency set = %d KHz hard_min_done %d\n", response, hard_min_done);
} else
smu_print("SMU Frequency set = %d KHz\n", response);
return response;
}
void dcn32_smu_wait_for_dmub_ack_mclk(struct clk_mgr_internal *clk_mgr, bool enable)
{
smu_print("PMFW to wait for DMCUB ack for MCLK : %d\n", enable);
dcn32_smu_send_msg_with_param(clk_mgr, 0x14, enable ? 1 : 0, NULL);
}
Annotation
- Immediate include surface: `dcn32_clk_mgr_smu_msg.h`, `clk_mgr_internal.h`, `reg_helper.h`, `dalsmc.h`, `dcn32_smu13_driver_if.h`, `logger_types.h`.
- Detected declarations: `function files`, `function dcn32_smu_wait_for_response`, `function dcn32_smu_send_msg_with_param`, `function dcn32_smu_wait_for_response_delay`, `function dcn32_smu_send_msg_with_param_delay`, `function dcn32_smu_send_fclk_pstate_message`, `function dcn32_smu_send_cab_for_uclk_message`, `function dcn32_smu_transfer_wm_table_dram_2_smu`, `function dcn32_smu_set_pme_workaround`, `function dcn32_get_hard_min_status_supported`.
- 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.