drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_clk_mgr.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_clk_mgr.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_clk_mgr.c- Extension
.c- Size
- 33004 bytes
- Lines
- 937
- 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
dcn314_clk_mgr.hdccg.hclk_mgr_internal.hdce100/dce_clk_mgr.hdcn20/dcn20_clk_mgr.hreg_helper.hcore_types.hdm_helpers.hdcn30/dcn30_clk_mgr.hdcn31/dcn31_clk_mgr.hdc_dmub_srv.hlink_service.hdcn314_smu.hlogger_types.h
Detected Declarations
struct IP_BASE_INSTANCEstruct IP_BASEfunction dcn314_get_active_display_cnt_wafunction dcn314_disable_otg_wafunction dcn314_is_spll_ssc_enabledfunction dcn314_init_clocksfunction dcn314_update_clocksfunction get_vco_frequency_from_regfunction dcn314_enable_pme_wafunction dcn314_are_clock_states_equalfunction dcn314_dump_clk_registersfunction dcn314_build_watermark_rangesfunction dcn314_notify_wm_rangesfunction dcn314_get_dpm_table_from_smufunction is_valid_clock_valuefunction convert_wck_ratiofunction find_max_clk_valuefunction dcn314_clk_mgr_helper_populate_bw_paramsfunction dcn314_read_ss_info_from_lutfunction dcn314_clk_mgr_constructfunction dcn314_clk_mgr_destroy
Annotated Snippet
struct IP_BASE_INSTANCE {
unsigned int segment[MAX_SEGMENT];
};
struct IP_BASE {
struct IP_BASE_INSTANCE instance[MAX_INSTANCE];
};
static const struct IP_BASE CLK_BASE = { { { { 0x00016C00, 0x02401800, 0, 0, 0, 0, 0, 0 } },
{ { 0x00016E00, 0x02401C00, 0, 0, 0, 0, 0, 0 } },
{ { 0x00017000, 0x02402000, 0, 0, 0, 0, 0, 0 } },
{ { 0x00017200, 0x02402400, 0, 0, 0, 0, 0, 0 } },
{ { 0x0001B000, 0x0242D800, 0, 0, 0, 0, 0, 0 } },
{ { 0x0001B200, 0x0242DC00, 0, 0, 0, 0, 0, 0 } },
{ { 0x0001B400, 0x0242E000, 0, 0, 0, 0, 0, 0 } } } };
#undef DC_LOGGER
#define DC_LOGGER \
clk_mgr->base.base.ctx->logger
#define regCLK1_CLK_PLL_REQ 0x0237
#define regCLK1_CLK_PLL_REQ_BASE_IDX 0
#define CLK1_CLK_PLL_REQ__FbMult_int__SHIFT 0x0
#define CLK1_CLK_PLL_REQ__PllSpineDiv__SHIFT 0xc
#define CLK1_CLK_PLL_REQ__FbMult_frac__SHIFT 0x10
#define CLK1_CLK_PLL_REQ__FbMult_int_MASK 0x000001FFL
#define CLK1_CLK_PLL_REQ__PllSpineDiv_MASK 0x0000F000L
#define CLK1_CLK_PLL_REQ__FbMult_frac_MASK 0xFFFF0000L
#define regCLK1_CLK2_BYPASS_CNTL 0x029c
#define regCLK1_CLK2_BYPASS_CNTL_BASE_IDX 0
#define CLK1_CLK2_BYPASS_CNTL__CLK2_BYPASS_SEL__SHIFT 0x0
#define CLK1_CLK2_BYPASS_CNTL__CLK2_BYPASS_DIV__SHIFT 0x10
#define CLK1_CLK2_BYPASS_CNTL__CLK2_BYPASS_SEL_MASK 0x00000007L
#define CLK1_CLK2_BYPASS_CNTL__CLK2_BYPASS_DIV_MASK 0x000F0000L
#define regCLK6_0_CLK6_spll_field_8 0x464b
#define regCLK6_0_CLK6_spll_field_8_BASE_IDX 0
#define CLK6_0_CLK6_spll_field_8__spll_ssc_en__SHIFT 0xd
#define CLK6_0_CLK6_spll_field_8__spll_ssc_en_MASK 0x00002000L
#define REG(reg_name) \
(CLK_BASE.instance[0].segment[reg ## reg_name ## _BASE_IDX] + reg ## reg_name)
#define TO_CLK_MGR_DCN314(clk_mgr)\
container_of(clk_mgr, struct clk_mgr_dcn314, base)
static int dcn314_get_active_display_cnt_wa(
struct dc *dc,
struct dc_state *context)
{
int i, display_count;
bool tmds_present = false;
display_count = 0;
for (i = 0; i < context->stream_count; i++) {
const struct dc_stream_state *stream = context->streams[i];
if (stream->signal == SIGNAL_TYPE_HDMI_TYPE_A ||
stream->signal == SIGNAL_TYPE_DVI_SINGLE_LINK ||
stream->signal == SIGNAL_TYPE_DVI_DUAL_LINK)
tmds_present = true;
/* Checking stream / link detection ensuring that PHY is active*/
if (dc_is_dp_signal(stream->signal) && !stream->dpms_off)
display_count++;
/* FRL can't be tracked by DIG enablement */
if (dc_is_hdmi_frl_signal(stream->signal))
display_count++;
}
for (i = 0; i < dc->link_count; i++) {
const struct dc_link *link = dc->links[i];
/* abusing the fact that the dig and phy are coupled to see if the phy is enabled */
if (link->link_enc && link->link_enc->funcs->is_dig_enabled &&
link->link_enc->funcs->is_dig_enabled(link->link_enc))
display_count++;
}
/* WA for hang on HDMI after display off back on*/
if (display_count == 0 && tmds_present)
display_count = 1;
return display_count;
}
Annotation
- Immediate include surface: `dcn314_clk_mgr.h`, `dccg.h`, `clk_mgr_internal.h`, `dce100/dce_clk_mgr.h`, `dcn20/dcn20_clk_mgr.h`, `reg_helper.h`, `core_types.h`, `dm_helpers.h`.
- Detected declarations: `struct IP_BASE_INSTANCE`, `struct IP_BASE`, `function dcn314_get_active_display_cnt_wa`, `function dcn314_disable_otg_wa`, `function dcn314_is_spll_ssc_enabled`, `function dcn314_init_clocks`, `function dcn314_update_clocks`, `function get_vco_frequency_from_reg`, `function dcn314_enable_pme_wa`, `function dcn314_are_clock_states_equal`.
- 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.