diff options
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 42 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c | 25 |
2 files changed, 41 insertions, 26 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c index 48dfb305a0b0..51a78283a86d 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c | |||
@@ -175,32 +175,22 @@ struct resource_pool *dc_create_resource_pool(struct dc *dc, | |||
175 | if (res_pool != NULL) { | 175 | if (res_pool != NULL) { |
176 | struct dc_firmware_info fw_info = { { 0 } }; | 176 | struct dc_firmware_info fw_info = { { 0 } }; |
177 | 177 | ||
178 | if (dc->ctx->dc_bios->funcs->get_firmware_info( | 178 | if (dc->ctx->dc_bios->funcs->get_firmware_info(dc->ctx->dc_bios, |
179 | dc->ctx->dc_bios, &fw_info) == BP_RESULT_OK) { | 179 | &fw_info) == BP_RESULT_OK) { |
180 | res_pool->ref_clocks.xtalin_clock_inKhz = fw_info.pll_info.crystal_frequency; | 180 | res_pool->ref_clocks.xtalin_clock_inKhz = |
181 | 181 | fw_info.pll_info.crystal_frequency; | |
182 | if (IS_FPGA_MAXIMUS_DC(dc->ctx->dce_environment)) { | 182 | /* initialize with firmware data first, no all |
183 | // On FPGA these dividers are currently not configured by GDB | 183 | * ASIC have DCCG SW component. FPGA or |
184 | res_pool->ref_clocks.dccg_ref_clock_inKhz = res_pool->ref_clocks.xtalin_clock_inKhz; | 184 | * simulation need initialization of |
185 | res_pool->ref_clocks.dchub_ref_clock_inKhz = res_pool->ref_clocks.xtalin_clock_inKhz; | 185 | * dccg_ref_clock_inKhz, dchub_ref_clock_inKhz |
186 | } else if (res_pool->dccg && res_pool->hubbub) { | 186 | * with xtalin_clock_inKhz |
187 | // If DCCG reference frequency cannot be determined (usually means not set to xtalin) then this is a critical error | 187 | */ |
188 | // as this value must be known for DCHUB programming | 188 | res_pool->ref_clocks.dccg_ref_clock_inKhz = |
189 | (res_pool->dccg->funcs->get_dccg_ref_freq)(res_pool->dccg, | 189 | res_pool->ref_clocks.xtalin_clock_inKhz; |
190 | fw_info.pll_info.crystal_frequency, | 190 | res_pool->ref_clocks.dchub_ref_clock_inKhz = |
191 | &res_pool->ref_clocks.dccg_ref_clock_inKhz); | 191 | res_pool->ref_clocks.xtalin_clock_inKhz; |
192 | 192 | } else | |
193 | // Similarly, if DCHUB reference frequency cannot be determined, then it is also a critical error | 193 | ASSERT_CRITICAL(false); |
194 | (res_pool->hubbub->funcs->get_dchub_ref_freq)(res_pool->hubbub, | ||
195 | res_pool->ref_clocks.dccg_ref_clock_inKhz, | ||
196 | &res_pool->ref_clocks.dchub_ref_clock_inKhz); | ||
197 | } else { | ||
198 | // Not all ASICs have DCCG sw component | ||
199 | res_pool->ref_clocks.dccg_ref_clock_inKhz = res_pool->ref_clocks.xtalin_clock_inKhz; | ||
200 | res_pool->ref_clocks.dchub_ref_clock_inKhz = res_pool->ref_clocks.xtalin_clock_inKhz; | ||
201 | } | ||
202 | } else | ||
203 | ASSERT_CRITICAL(false); | ||
204 | } | 194 | } |
205 | 195 | ||
206 | return res_pool; | 196 | return res_pool; |
diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c index 6925d25d2457..0b84a322b8a2 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c | |||
@@ -523,6 +523,7 @@ static void dcn20_init_hw(struct dc *dc) | |||
523 | struct dc_bios *dcb = dc->ctx->dc_bios; | 523 | struct dc_bios *dcb = dc->ctx->dc_bios; |
524 | struct resource_pool *res_pool = dc->res_pool; | 524 | struct resource_pool *res_pool = dc->res_pool; |
525 | struct dc_state *context = dc->current_state; | 525 | struct dc_state *context = dc->current_state; |
526 | struct dc_firmware_info fw_info = { { 0 } }; | ||
526 | 527 | ||
527 | if (dc->clk_mgr && dc->clk_mgr->funcs->init_clocks) | 528 | if (dc->clk_mgr && dc->clk_mgr->funcs->init_clocks) |
528 | dc->clk_mgr->funcs->init_clocks(dc->clk_mgr); | 529 | dc->clk_mgr->funcs->init_clocks(dc->clk_mgr); |
@@ -546,6 +547,30 @@ static void dcn20_init_hw(struct dc *dc) | |||
546 | } else { | 547 | } else { |
547 | if (!dcb->funcs->is_accelerated_mode(dcb)) { | 548 | if (!dcb->funcs->is_accelerated_mode(dcb)) { |
548 | bios_golden_init(dc); | 549 | bios_golden_init(dc); |
550 | if (dc->ctx->dc_bios->funcs->get_firmware_info( | ||
551 | dc->ctx->dc_bios, &fw_info) == BP_RESULT_OK) { | ||
552 | res_pool->ref_clocks.xtalin_clock_inKhz = fw_info.pll_info.crystal_frequency; | ||
553 | |||
554 | if (!IS_FPGA_MAXIMUS_DC(dc->ctx->dce_environment)) { | ||
555 | if (res_pool->dccg && res_pool->hubbub) { | ||
556 | |||
557 | (res_pool->dccg->funcs->get_dccg_ref_freq)(res_pool->dccg, | ||
558 | fw_info.pll_info.crystal_frequency, | ||
559 | &res_pool->ref_clocks.dccg_ref_clock_inKhz); | ||
560 | |||
561 | (res_pool->hubbub->funcs->get_dchub_ref_freq)(res_pool->hubbub, | ||
562 | res_pool->ref_clocks.dccg_ref_clock_inKhz, | ||
563 | &res_pool->ref_clocks.dchub_ref_clock_inKhz); | ||
564 | } else { | ||
565 | // Not all ASICs have DCCG sw component | ||
566 | res_pool->ref_clocks.dccg_ref_clock_inKhz = | ||
567 | res_pool->ref_clocks.xtalin_clock_inKhz; | ||
568 | res_pool->ref_clocks.dchub_ref_clock_inKhz = | ||
569 | res_pool->ref_clocks.xtalin_clock_inKhz; | ||
570 | } | ||
571 | } | ||
572 | } else | ||
573 | ASSERT_CRITICAL(false); | ||
549 | disable_vga(dc->hwseq); | 574 | disable_vga(dc->hwseq); |
550 | } | 575 | } |
551 | 576 | ||