drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c- Extension
.c- Size
- 12905 bytes
- Lines
- 389
- 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
dccg.hclk_mgr_internal.hdce_clk_mgr.hdce110/dce110_clk_mgr.hdce112/dce112_clk_mgr.hreg_helper.hdmcu.hcore_types.hdal_asic_id.hdce/dce_8_0_d.hdce/dce_8_0_sh_mask.h
Detected Declarations
function dentist_get_divider_from_didfunction valuefunction dce60_get_dp_ref_freq_khzfunction dce_get_dp_ref_freq_khzfunction dce12_get_dp_ref_freq_khzfunction dce_get_max_pixel_clock_for_all_pathsfunction dce_set_clockfunction dce_clock_read_integrated_infofunction dce_clock_read_ss_infofunction dce_pplib_apply_display_requirementsfunction dce_update_clocksfunction dce_clk_mgr_construct
Annotated Snippet
if (info.type.CENTER_MODE == 0) {
/* TODO: Currently for DP Reference clock we
* need only SS percentage for
* downspread */
clk_mgr_dce->dprefclk_ss_percentage =
info.spread_spectrum_percentage;
}
return;
}
result = bp->funcs->get_spread_spectrum_info(
bp, AS_SIGNAL_TYPE_DISPLAY_PORT, 0, &info);
/* Based on VBIOS, VBIOS will keep entry for DPREFCLK SS
* even if SS not enabled and in that case
* SSInfo.spreadSpectrumPercentage !=0 would be sign
* that SS is enabled
*/
if (result == BP_RESULT_OK &&
info.spread_spectrum_percentage != 0) {
clk_mgr_dce->ss_on_dprefclk = true;
clk_mgr_dce->dprefclk_ss_divider = info.spread_percentage_divider;
if (info.type.CENTER_MODE == 0) {
/* Currently for DP Reference clock we
* need only SS percentage for
* downspread */
clk_mgr_dce->dprefclk_ss_percentage =
info.spread_spectrum_percentage;
}
if (clk_mgr_dce->base.ctx->dc->config.ignore_dpref_ss)
clk_mgr_dce->dprefclk_ss_percentage = 0;
}
}
}
static void dce_pplib_apply_display_requirements(
struct dc *dc,
struct dc_state *context)
{
struct dm_pp_display_configuration *pp_display_cfg = &context->pp_display_cfg;
dce110_fill_display_configs(context, pp_display_cfg);
if (memcmp(&dc->current_state->pp_display_cfg, pp_display_cfg, sizeof(*pp_display_cfg)) != 0)
dm_pp_apply_display_requirements(dc->ctx, pp_display_cfg);
}
static void dce_update_clocks(struct clk_mgr *clk_mgr_base,
struct dc_state *context,
bool safe_to_lower)
{
const int max_disp_clk = clk_mgr_base->clks.max_supported_dispclk_khz;
int patched_disp_clk = MIN(max_disp_clk, context->bw_ctx.bw.dce.dispclk_khz);
if (should_set_clock(safe_to_lower, patched_disp_clk, clk_mgr_base->clks.dispclk_khz)) {
patched_disp_clk = dce_set_clock(clk_mgr_base, patched_disp_clk);
clk_mgr_base->clks.dispclk_khz = patched_disp_clk;
}
dce_pplib_apply_display_requirements(clk_mgr_base->ctx->dc, context);
}
static struct clk_mgr_funcs dce_funcs = {
.get_dp_ref_clk_frequency = dce_get_dp_ref_freq_khz,
.update_clocks = dce_update_clocks
};
void dce_clk_mgr_construct(
struct dc_context *ctx,
struct clk_mgr_internal *clk_mgr)
{
struct clk_mgr *base = &clk_mgr->base;
base->ctx = ctx;
base->funcs = &dce_funcs;
if (ctx->dce_version >= DCE_VERSION_8_0) {
clk_mgr->regs = &disp_clk_regs;
clk_mgr->clk_mgr_shift = &disp_clk_shift;
clk_mgr->clk_mgr_mask = &disp_clk_mask;
}
Annotation
- Immediate include surface: `dccg.h`, `clk_mgr_internal.h`, `dce_clk_mgr.h`, `dce110/dce110_clk_mgr.h`, `dce112/dce112_clk_mgr.h`, `reg_helper.h`, `dmcu.h`, `core_types.h`.
- Detected declarations: `function dentist_get_divider_from_did`, `function value`, `function dce60_get_dp_ref_freq_khz`, `function dce_get_dp_ref_freq_khz`, `function dce12_get_dp_ref_freq_khz`, `function dce_get_max_pixel_clock_for_all_paths`, `function dce_set_clock`, `function dce_clock_read_integrated_info`, `function dce_clock_read_ss_info`, `function dce_pplib_apply_display_requirements`.
- 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.