switch (plane_state->format) { case SURFACE_PIXEL_FORMAT_GRPH_RGB565:
prescale_params->scale = 0x2082; break; case SURFACE_PIXEL_FORMAT_GRPH_ARGB8888: case SURFACE_PIXEL_FORMAT_GRPH_ABGR8888:
prescale_params->scale = 0x2020; break; case SURFACE_PIXEL_FORMAT_GRPH_ARGB2101010: case SURFACE_PIXEL_FORMAT_GRPH_ABGR2101010:
prescale_params->scale = 0x2008; break; case SURFACE_PIXEL_FORMAT_GRPH_ARGB16161616: case SURFACE_PIXEL_FORMAT_GRPH_ABGR16161616: case SURFACE_PIXEL_FORMAT_GRPH_ABGR16161616F:
prescale_params->scale = 0x2000; break; default:
ASSERT(false); break;
}
}
/* see comment above, m_arrPoints[1].y should be the Y value for the *regionend(m_numOfHwPoints),notlastHWpoint(m_numOfHwPoints-1)
*/
y3_max = dc_fixpt_max(y_r, dc_fixpt_max(y_g, y_b));
arr_points[1].y = y3_max;
arr_points[1].slope = dc_fixpt_zero;
if (output_tf->tf == TRANSFER_FUNCTION_PQ) { /* for PQ, we want to have a straight line from last HW X point, *andtheslopetobesuchthatwehit1.0at10000nits.
*/ conststruct fixed31_32 end_value = dc_fixpt_from_int(125);
while (i != hw_points + 1) { if (dc_fixpt_lt(rgb_plus_1->red, rgb->red))
rgb_plus_1->red = rgb->red; if (dc_fixpt_lt(rgb_plus_1->green, rgb->green))
rgb_plus_1->green = rgb->green; if (dc_fixpt_lt(rgb_plus_1->blue, rgb->blue))
rgb_plus_1->blue = rgb->blue;
/* enable early control to avoid corruption on DP monitor*/
active_total_with_borders =
timing->h_addressable
+ timing->h_border_left
+ timing->h_border_right;
if (lane_count != 0)
early_control = active_total_with_borders % lane_count;
if (early_control == 0)
early_control = lane_count;
/* Send VBIOS command to prompt eDP panel power */ if (power_up) { /* edp requires a min of 500ms from LCDVDD off to on */ unsignedlonglong remaining_min_edp_poweroff_time_ms = 500;
/* add time defined by a patch, if any (usually patch extra_t12_ms is 0) */ if (link->local_sink != NULL)
remaining_min_edp_poweroff_time_ms +=
link->panel_config.pps.extra_t12_ms;
/* Adjust remaining_min_edp_poweroff_time_ms if this is not the first time. */ if (ctx->dc->link_srv->dp_trace_get_edp_poweroff_timestamp(link) != 0) { if (time_since_edp_poweroff_ms < remaining_min_edp_poweroff_time_ms)
remaining_min_edp_poweroff_time_ms =
remaining_min_edp_poweroff_time_ms - time_since_edp_poweroff_ms; else
remaining_min_edp_poweroff_time_ms = 0;
}
if (remaining_min_edp_poweroff_time_ms) {
DC_LOG_HW_RESUME_S3( "%s: remaining_min_edp_poweroff_time_ms=%llu: begin wait.\n",
__func__, remaining_min_edp_poweroff_time_ms);
msleep(remaining_min_edp_poweroff_time_ms);
DC_LOG_HW_RESUME_S3( "%s: remaining_min_edp_poweroff_time_ms=%llu: end wait.\n",
__func__, remaining_min_edp_poweroff_time_ms);
dm_output_to_console("%s: wait %lld ms to power on eDP.\n",
__func__, remaining_min_edp_poweroff_time_ms);
} else {
DC_LOG_HW_RESUME_S3( "%s: remaining_min_edp_poweroff_time_ms=%llu: no wait required.\n",
__func__, remaining_min_edp_poweroff_time_ms);
}
}
/* For eDP, the following delays might need to be considered *afterlinktrainingcompleted: *idleperiod-min.accountsforrequiredBS-Idlepattern, *max.allowsforsourceframesynchronization); *50msecmax.delayfromvalidvideodatafromsource *tovideoondislpayorbacklightenable. * *Disablethedelayfornow. *Enableitinthefutureifnecessary.
*/ /* dc_service_sleep_in_milliseconds(50); */ /*edp 1.2*/ if (link->panel_cntl)
pwrseq_instance = link->panel_cntl->pwrseq_inst;
if (cntl.action == TRANSMITTER_CONTROL_BACKLIGHT_ON) { if (!link->dc->config.edp_no_power_sequencing) /* *Sometimes,DPreceiverchippower-controlledexternallybyan *EmbeddedControllercouldbetreatedandusedaseDP, *ifitdrivesmobiledisplay.Inthiscase, *weshouldn'tbedoingpower-sequencing,hencewecanskip *waitingforT7-ready.
*/
ctx->dc->link_srv->edp_receiver_ready_T7(link); else
DC_LOG_DC("edp_receiver_ready_T7 skipped\n");
}
/* Setting link_powered_externally will bypass delays in the backlight *astheyarenotrequiredifthelinkisbeingpoweredbyadifferent *source.
*/ if (ctx->dc->ctx->dmub_srv &&
ctx->dc->debug.dmub_command_table) { if (cntl.action == TRANSMITTER_CONTROL_BACKLIGHT_ON)
ctx->dc_bios->funcs->enable_lvtma_control(ctx->dc_bios,
LVTMA_CONTROL_LCD_BLON,
pwrseq_instance, link->link_powered_externally); else
ctx->dc_bios->funcs->enable_lvtma_control(ctx->dc_bios,
LVTMA_CONTROL_LCD_BLOFF,
pwrseq_instance, link->link_powered_externally);
}
if (!enable) { /*follow oem panel config's requirement*/
pre_T11_delay += link->panel_config.pps.extra_pre_t11_ms; if (pre_T11_delay)
msleep(pre_T11_delay);
}
}
void dce110_enable_audio_stream(struct pipe_ctx *pipe_ctx)
{ /* notify audio driver for audio modes of monitor */ struct dc *dc; struct clk_mgr *clk_mgr; unsignedint i, num_audio = 1; conststruct link_hwss *link_hwss;
if (!pipe_ctx->stream) return;
dc = pipe_ctx->stream->ctx->dc;
clk_mgr = dc->clk_mgr;
link_hwss = get_link_hwss(pipe_ctx->stream->link, &pipe_ctx->link_res);
if (pipe_ctx->stream_res.audio && pipe_ctx->stream_res.audio->enabled == true) return;
if (pipe_ctx->stream_res.audio) { for (i = 0; i < MAX_PIPES; i++) { /*current_state not updated yet*/ if (dc->current_state->res_ctx.pipe_ctx[i].stream_res.audio != NULL)
num_audio++;
}
if (num_audio >= 1 && clk_mgr->funcs->enable_pme_wa) /*this is the first audio. apply the PME w/a in order to wake AZ from D3*/
clk_mgr->funcs->enable_pme_wa(clk_mgr);
link_hwss->enable_audio_packet(pipe_ctx);
if (pipe_ctx->stream_res.audio)
pipe_ctx->stream_res.audio->enabled = true;
}
}
dc = pipe_ctx->stream->ctx->dc;
clk_mgr = dc->clk_mgr;
link_hwss = get_link_hwss(pipe_ctx->stream->link, &pipe_ctx->link_res);
if (pipe_ctx->stream_res.audio && pipe_ctx->stream_res.audio->enabled == false) return;
link_hwss->disable_audio_packet(pipe_ctx);
if (pipe_ctx->stream_res.audio) {
pipe_ctx->stream_res.audio->enabled = false;
if (clk_mgr->funcs->enable_pme_wa) /*this is the first audio. apply the PME w/a in order to wake AZ from D3*/
clk_mgr->funcs->enable_pme_wa(clk_mgr);
/* TODO: notify audio driver for if audio modes list changed
* add audio mode list change flag */ /* dal_audio_disable_azalia_audio_jack_presence(stream->audio, *stream->stream_engine_id);
*/
}
}
if (hws && hws->wa_state.skip_blank_stream) return;
if (link->local_sink && link->local_sink->sink_signal == SIGNAL_TYPE_EDP) { if (!link->skip_implict_edp_power_control && hws)
hws->funcs.edp_backlight_control(link, false);
link->dc->hwss.set_abm_immediate_disable(pipe_ctx);
}
if (link->dc->link_srv->dp_is_128b_132b_signal(pipe_ctx)) { /* TODO - DP2.0 HW: Set ODM mode in dp hpo encoder here */
pipe_ctx->stream_res.hpo_dp_stream_enc->funcs->dp_blank(
pipe_ctx->stream_res.hpo_dp_stream_enc);
} elseif (dc_is_dp_signal(pipe_ctx->stream->signal)) {
pipe_ctx->stream_res.stream_enc->funcs->dp_blank(link, pipe_ctx->stream_res.stream_enc);
if (!dc_is_embedded_signal(pipe_ctx->stream->signal)) { /* *Afteroutputisidlepatternsomesinksneedtimetorecognizethestream *haschangedortheyenterprotectionstateandhang.
*/
msleep(60);
}
}
/*for HDMI, audio ACR is with deep color ratio factor*/ if (dc_is_hdmi_tmds_signal(pipe_ctx->stream->signal) &&
audio_output->crtc_info.requested_pixel_clock_100Hz ==
(stream->timing.pix_clk_100hz)) { if (pipe_ctx->stream_res.pix_clk_params.pixel_encoding == PIXEL_ENCODING_YCBCR420) {
audio_output->crtc_info.requested_pixel_clock_100Hz =
audio_output->crtc_info.requested_pixel_clock_100Hz/2;
audio_output->crtc_info.calculated_pixel_clock_100Hz =
pipe_ctx->stream_res.pix_clk_params.requested_pix_clk_100hz/2;
if (dc->config.disable_hbr_audio_dp2) if (pipe_ctx->stream_res.audio->funcs->az_disable_hbr_audio &&
dc->link_srv->dp_is_128b_132b_signal(pipe_ctx))
pipe_ctx->stream_res.audio->funcs->az_disable_hbr_audio(pipe_ctx->stream_res.audio);
}
/* make sure no pipes syncd to the pipe being enabled */ if (!pipe_ctx->stream->apply_seamless_boot_optimization && dc->config.use_pipe_ctx_sync_logic)
check_syncd_pipes_for_disabled_master_pipe(dc, context, pipe_ctx->pipe_idx);
// DRR should set trigger event to monitor surface update event if (stream->adjust.v_total_min != 0 && stream->adjust.v_total_max != 0)
event_triggers = 0x80; /* Event triggers and num frames initialized for DRR, but can be *laterupdatedforPSRuse.NoteDRRtriggereventsaregenerated *regardlessofwhethernumframesmet.
*/ if (pipe_ctx->stream_res.tg->funcs->set_static_screen_control)
pipe_ctx->stream_res.tg->funcs->set_static_screen_control(
pipe_ctx->stream_res.tg, event_triggers, 2);
if (!dc_is_virtual_signal(pipe_ctx->stream->signal))
pipe_ctx->stream_res.stream_enc->funcs->dig_connect_to_otg(
pipe_ctx->stream_res.stream_enc,
pipe_ctx->stream_res.tg->inst);
if (dc_is_dp_signal(pipe_ctx->stream->signal))
dc->link_srv->dp_trace_source_sequence(link, DPCD_SOURCE_SEQ_AFTER_CONNECT_DIG_FE_OTG);
/* Temporary workaround to perform DSC programming ahead of stream enablement *forsmartmux/SPRS *TODO:RemoveSmartMux/SPRSchecksoncemovementofDSCprogrammingisgeneralized
*/ if (pipe_ctx->stream->timing.flags.DSC) { if ((pipe_ctx->stream->signal == SIGNAL_TYPE_EDP &&
((link->dc->config.smart_mux_version && link->dc->is_switch_in_progress_dest)
|| link->is_dds || link->skip_implict_edp_power_control)) &&
(dc_is_dp_signal(pipe_ctx->stream->signal) ||
dc_is_virtual_signal(pipe_ctx->stream->signal)))
dc->link_srv->set_dsc_enable(pipe_ctx, true);
}
if (!stream->dpms_off)
dc->link_srv->set_dpms_on(context, pipe_ctx);
/* Phantom and main stream share the same link (because the stream *isconstructedwiththesamesink).Makesurenottooverride *andlinkprogrammingonthemain.
*/ if (dc_state_get_pipe_subvp_type(context, pipe_ctx) != SUBVP_PHANTOM) {
pipe_ctx->stream->link->psr_settings.psr_feature_enabled = false;
pipe_ctx->stream->link->replay_settings.replay_feature_enabled = false;
} return DC_OK;
}
staticvoid power_down_controllers(struct dc *dc)
{ int i;
for (i = 0; i < dc->res_pool->timing_generator_count; i++) {
dc->res_pool->timing_generators[i]->funcs->disable_crtc(
dc->res_pool->timing_generators[i]);
}
}
staticvoid power_down_clock_sources(struct dc *dc)
{ int i;
if (dc->res_pool->dp_clock_source->funcs->cs_power_down(
dc->res_pool->dp_clock_source) == false)
dm_error("Failed to power down pll! (dp clk src)\n");
for (i = 0; i < dc->res_pool->clk_src_count; i++) { if (dc->res_pool->clock_sources[i]->funcs->cs_power_down(
dc->res_pool->clock_sources[i]) == false)
dm_error("Failed to power down pll! (clk src index=%d)\n", i);
}
}
staticvoid power_down_all_hw_blocks(struct dc *dc)
{
power_down_encoders(dc);
power_down_controllers(dc);
power_down_clock_sources(dc);
if (dc->fbc_compressor)
dc->fbc_compressor->funcs->disable_fbc(dc->fbc_compressor);
}
staticvoid disable_vga_and_power_gate_all_controllers( struct dc *dc)
{ int i; struct timing_generator *tg; struct dc_context *ctx = dc->ctx;
for (i = 0; i < dc->res_pool->timing_generator_count; i++) {
tg = dc->res_pool->timing_generators[i];
if (tg->funcs->disable_vga)
tg->funcs->disable_vga(tg);
} for (i = 0; i < dc->res_pool->pipe_count; i++) { /* Enable CLOCK gating for each pipe BEFORE controller
* powergating. */
enable_display_pipe_clock_gating(ctx, true);
staticvoid get_edp_streams(struct dc_state *context, struct dc_stream_state **edp_streams, int *edp_stream_num)
{ int i;
*edp_stream_num = 0; for (i = 0; i < context->stream_count; i++) { if (context->streams[i]->signal == SIGNAL_TYPE_EDP) {
edp_streams[*edp_stream_num] = context->streams[i]; if (++(*edp_stream_num) == MAX_NUM_EDP) return;
}
}
}
staticvoid get_edp_links_with_sink( struct dc *dc, struct dc_link **edp_links_with_sink, int *edp_with_sink_num)
{ int i;
/* check if there is an eDP panel not in use */
*edp_with_sink_num = 0; for (i = 0; i < dc->link_count; i++) { if (dc->links[i]->local_sink &&
dc->links[i]->local_sink->sink_signal == SIGNAL_TYPE_EDP) {
edp_links_with_sink[*edp_with_sink_num] = dc->links[i]; if (++(*edp_with_sink_num) == MAX_NUM_EDP) return;
}
}
}
if (!dc->caps.is_apu ||
dc->ctx->dce_version < DCN_VERSION_3_15) return; /*VBIOS supports dsc starts from dcn315*/ for (i = 0; i < dc->res_pool->res_cap->num_dsc; i++) { struct dcn_dsc_state s = {0};
dsc = dc->res_pool->dscs[i];
dsc->funcs->dsc_read_state(dsc, &s); if (s.dsc_fw_en) { /* disable DSC in OPTC */ if (i < dc->res_pool->timing_generator_count) {
tg = dc->res_pool->timing_generators[i];
tg->funcs->set_dsc_config(tg, OPTC_DSC_DISABLED, 0, 0);
} /* disable DSC in stream encoder */ if (i < dc->res_pool->stream_enc_count) {
se = dc->res_pool->stream_enc[i];
se->funcs->dp_set_dsc_config(se, OPTC_DSC_DISABLED, 0, 0);
se->funcs->dp_set_dsc_pps_info_packet(se, false, NULL, true);
} /* disable DSC block */ if (dccg->funcs->set_ref_dscclk)
dccg->funcs->set_ref_dscclk(dccg, dsc->inst);
dsc->funcs->dsc_disable(dsc);
/* power down DSC */ if (pg_cntl != NULL)
pg_cntl->funcs->dsc_pg_control(pg_cntl, dsc->inst, false);
}
}
}
/* Check fastboot support, disable on DCE 6-8 because of blank screens */ if (edp_num && edp_stream_num && dc->ctx->dce_version < DCE_VERSION_10_0) { for (i = 0; i < edp_num; i++) {
edp_link = edp_links[i]; if (edp_link != edp_streams[0]->link) continue; // enable fastboot if backend is enabled on eDP if (edp_link->link_enc->funcs->is_dig_enabled &&
edp_link->link_enc->funcs->is_dig_enabled(edp_link->link_enc) &&
edp_link->link_status.link_active) { struct dc_stream_state *edp_stream = edp_streams[0];
// For Mux-platform, the default value is false. // Disable fast boot during mux switching. // The flag would be clean after switching done. if (dc->is_switch_in_progress_dest && edp_link->is_dds)
can_apply_edp_fast_boot = false;
edp_stream->apply_edp_fast_boot_optimization = can_apply_edp_fast_boot; if (can_apply_edp_fast_boot) {
DC_LOG_EVENT_LINK_TRAINING("eDP fast boot Enable\n");
// Vbios & Driver support different pixel rate div policy.
pipe_ctx = resource_get_otg_master_for_stream(&context->res_ctx, edp_stream); if (pipe_ctx &&
hws->funcs.is_dp_dig_pixel_rate_div_policy &&
hws->funcs.is_dp_dig_pixel_rate_div_policy(pipe_ctx)) { // Get Vbios div factor from register
dc->res_pool->dccg->funcs->get_pixel_rate_div(
dc->res_pool->dccg,
pipe_ctx->stream_res.tg->inst,
&pipe_ctx->pixel_rate_divider.div_factor1,
&pipe_ctx->pixel_rate_divider.div_factor2);
// VBios doesn't support pixel rate div, so force it. // If VBios supports it, we check it from reigster or other flags.
pipe_ctx->stream_res.pix_clk_params.dio_se_pix_per_cycle = 1;
}
} break;
}
} // We are trying to enable eDP, don't power down VDD if (can_apply_edp_fast_boot)
keep_edp_vdd_on = true;
}
// Check seamless boot support for (i = 0; i < context->stream_count; i++) { if (context->streams[i]->apply_seamless_boot_optimization) {
can_apply_seamless_boot = true; break;
}
}
/* eDP should not have stream in resume from S4 and so even with VBios post *itshouldgetturnedoff
*/ if (edp_with_sink_num)
edp_link_with_sink = edp_links_with_sink[0];
// During a mux switch, powering down the HW blocks and then enabling // the link via a DPCD SET_POWER write causes a brief flash
keep_edp_vdd_on |= dc->is_switch_in_progress_dest;
if (!can_apply_edp_fast_boot && !can_apply_seamless_boot) { if (edp_link_with_sink && !keep_edp_vdd_on) { /*turn off backlight before DP_blank and encoder powered down*/
hws->funcs.edp_backlight_control(edp_link_with_sink, false);
} /*resume from S3, no vbios posting, no need to power down again*/ if (dcb && dcb->funcs && !dcb->funcs->is_accelerated_mode(dcb))
clk_mgr_exit_optimized_pwr_state(dc, dc->clk_mgr);
power_down_all_hw_blocks(dc);
/* DSC could be enabled on eDP during VBIOS post. *TocleanupdscblocksifeDPisinlinkbutnotactive.
*/ if (edp_link_with_sink && (edp_stream_num == 0))
clean_up_dsc_blocks(dc);
disable_vga_and_power_gate_all_controllers(dc); if (edp_link_with_sink && !keep_edp_vdd_on)
dc->hwss.edp_power_control(edp_link_with_sink, false); if (dcb && dcb->funcs && !dcb->funcs->is_accelerated_mode(dcb))
clk_mgr_optimize_pwr_state(dc, dc->clk_mgr);
}
bios_set_scratch_acc_mode_change(dc->ctx->dc_bios, 1);
}
if (i == underlay_idx)
res_ctx->pipe_ctx[i].plane_res.mi->funcs->mem_input_program_chroma_display_marks(
res_ctx->pipe_ctx[i].plane_res.mi,
nbp_marks,
max_marks,
max_marks,
MAX_WATERMARK);
/* TODO: If multiple pipes are to be supported, you need *someGSLstuff.Staticscreentriggersmaybeprogrammeddifferently *aswell.
*/ for (i = 0; i < num_pipes; i++) { /* dc_state_destruct() might null the stream resources, so fetch tg *herefirsttoavoidaracecondition.Thelifetimeofthepointee *itself(thetiming_generatorobject)isnotaproblemhere.
*/ struct timing_generator *tg = pipe_ctx[i]->stream_res.tg;
if ((tg != NULL) && tg->funcs) {
set_drr_and_clear_adjust_pending(pipe_ctx[i], pipe_ctx[i]->stream, ¶ms); if (adjust.v_total_max != 0 && adjust.v_total_min != 0) if (tg->funcs->set_static_screen_control)
tg->funcs->set_static_screen_control(
tg, event_triggers, num_frames);
}
}
}
staticvoid get_position(struct pipe_ctx **pipe_ctx, int num_pipes, struct crtc_position *position)
{ int i = 0;
/* TODO: handle pipes > 1
*/ for (i = 0; i < num_pipes; i++)
pipe_ctx[i]->stream_res.tg->funcs->get_position(pipe_ctx[i]->stream_res.tg, position);
}
if (params->triggers.overlay_update)
triggers |= 0x100; if (params->triggers.surface_update)
triggers |= 0x80; if (params->triggers.cursor_update)
triggers |= 0x2; if (params->triggers.force_trigger)
triggers |= 0x1;
if (num_pipes) { struct dc *dc = pipe_ctx[0]->stream->ctx->dc;
if (dc->fbc_compressor)
triggers |= 0x84;
}
for (i = 0; i < num_pipes; i++)
pipe_ctx[i]->stream_res.tg->funcs->
set_static_screen_control(pipe_ctx[i]->stream_res.tg,
triggers, params->num_frames);
}
staticvoid dce110_reset_hw_ctx_wrap( struct dc *dc, struct dc_state *context)
{ int i;
/* Reset old context */ /* look up the targets that have been removed since last commit */ for (i = 0; i < MAX_PIPES; i++) { struct pipe_ctx *pipe_ctx_old =
&dc->current_state->res_ctx.pipe_ctx[i]; struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i];
/* Note: We need to disable output if clock sources change, *sincebiosdoesoptimizationanddoesn'tapplyifchanging *PHYwhennotalreadydisabled.
*/
/* Skip underlay pipe since it will be handled in commit surface*/ if (!pipe_ctx_old->stream || pipe_ctx_old->top_pipe) continue;
/* Disable if new stream is null. O/w, if stream is *disabledalready,noneedtodisableagain.
*/ if (!pipe_ctx->stream || !pipe_ctx->stream->dpms_off) {
dc->link_srv->set_dpms_off(pipe_ctx_old);
/* no HDMI audio is found, try DP audio */ if (i == dc->res_pool->pipe_count) { for (i = 0; i < dc->res_pool->pipe_count; i++) { struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i];
if (pipe_ctx->stream == NULL) continue;
if (pipe_ctx->top_pipe) continue;
if (!dc_is_dp_signal(pipe_ctx->stream->signal)) continue;
if (pipe_ctx->stream_res.audio != NULL) {
build_audio_output(context,
pipe_ctx,
&pipe_ctx->stream_res.audio_output);
/* reset syncd pipes from disabled pipes */ if (dc->config.use_pipe_ctx_sync_logic)
reset_syncd_pipes_from_disabled_pipes(dc, context);
/* Reset old context */ /* look up the targets that have been removed since last commit */
hws->funcs.reset_hw_ctx_wrap(dc, context);
/* Skip applying if no targets */ if (context->stream_count <= 0) return DC_OK;
/* Apply new context */
dcb->funcs->set_scratch_critical_state(dcb, true);
/* below is for real asic only */ for (i = 0; i < dc->res_pool->pipe_count; i++) { struct pipe_ctx *pipe_ctx_old =
&dc->current_state->res_ctx.pipe_ctx[i]; struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i];
if (pipe_ctx->stream == NULL || pipe_ctx->top_pipe) continue;
if (pipe_ctx->stream == pipe_ctx_old->stream) { if (pipe_ctx_old->clock_source != pipe_ctx->clock_source)
dce_crtc_switch_to_clk_src(dc->hwseq,
pipe_ctx->clock_source, i); continue;
}
hws->funcs.enable_display_power_gating(
dc, i, dc->ctx->dc_bios,
PIPE_GATING_CONTROL_DISABLE);
}
if (dc->fbc_compressor)
dc->fbc_compressor->funcs->disable_fbc(dc->fbc_compressor);
dce110_setup_audio_dto(dc, context);
if (dc->hwseq->funcs.setup_hpo_hw_control && was_hpo_acquired != is_hpo_acquired) {
dc->hwseq->funcs.setup_hpo_hw_control(dc->hwseq, is_hpo_acquired);
}
for (i = 0; i < dc->res_pool->pipe_count; i++) { struct pipe_ctx *pipe_ctx_old =
&dc->current_state->res_ctx.pipe_ctx[i]; struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i];
if (pipe_ctx->stream == NULL) continue;
if (pipe_ctx->stream == pipe_ctx_old->stream &&
pipe_ctx->stream->link->link_state_valid) { continue;
}
if (pipe_ctx_old->stream && !pipe_need_reprogram(pipe_ctx_old, pipe_ctx)) continue;
if (pipe_ctx->top_pipe || pipe_ctx->prev_odm_pipe) continue;
status = dce110_apply_single_controller_ctx_to_hw(
pipe_ctx,
context,
dc);
if (DC_OK != status) return status;
#ifdef CONFIG_DRM_AMD_DC_FP if (hws->funcs.resync_fifo_dccg_dio)
hws->funcs.resync_fifo_dccg_dio(hws, dc, context, i); #endif
}
if (dc->fbc_compressor)
enable_fbc(dc, dc->current_state);
/* To avoid endless loop we wait at most
* frames_to_wait_on_triggered_reset frames for the reset to occur. */ const uint32_t frames_to_wait_on_triggered_reset = 10;
uint32_t i;
for (i = 0; i < frames_to_wait_on_triggered_reset; i++) {
if (!tg->funcs->is_counter_moving(tg)) {
DC_ERROR("TG counter is not moving!\n"); break;
}
if (tg->funcs->did_triggered_reset_occur(tg)) {
rc = true; /* usually occurs at i=1 */
DC_SYNC_INFO("GSL: reset occurred at wait count: %d\n",
i); break;
}
/* Wait for one frame. */
tg->funcs->wait_for_state(tg, CRTC_STATE_VACTIVE);
tg->funcs->wait_for_state(tg, CRTC_STATE_VBLANK);
}
if (false == rc)
DC_ERROR("GSL: Timeout on reset trigger!\n");
return rc;
}
/* Enable timing synchronization for a group of Timing Generators. */ staticvoid dce110_enable_timing_synchronization( struct dc *dc, struct dc_state *state, int group_index, int group_size, struct pipe_ctx *grouped_pipes[])
{ struct dc_context *dc_ctx = dc->ctx; struct dcp_gsl_params gsl_params = { 0 }; int i;
DC_LOGGER_INIT();
DC_SYNC_INFO("GSL: Setting-up...\n");
/* Designate a single TG in the group as a master. *SinceHWdoesn'tcarewhichone,wealwaysassign
* the 1st one in the group. */
gsl_params.gsl_group = 0;
gsl_params.gsl_master = grouped_pipes[0]->stream_res.tg->inst;
for (i = 0; i < group_size; i++)
grouped_pipes[i]->stream_res.tg->funcs->setup_global_swap_lock(
grouped_pipes[i]->stream_res.tg, &gsl_params);
for (i = 1/* skip the master */; i < group_size; i++)
grouped_pipes[i]->stream_res.tg->funcs->enable_reset_trigger(
grouped_pipes[i]->stream_res.tg,
gsl_params.gsl_group);
for (i = 1/* skip the master */; i < group_size; i++) {
DC_SYNC_INFO("GSL: waiting for reset to occur.\n");
wait_for_reset_trigger_to_occur(dc_ctx, grouped_pipes[i]->stream_res.tg);
grouped_pipes[i]->stream_res.tg->funcs->disable_reset_trigger(
grouped_pipes[i]->stream_res.tg);
}
/* GSL Vblank synchronization is a one time sync mechanism, assumption
* is that the sync'ed displays will not drift out of sync over time*/
DC_SYNC_INFO("GSL: Restoring register states.\n"); for (i = 0; i < group_size; i++)
grouped_pipes[i]->stream_res.tg->funcs->tear_down_global_swap_lock(grouped_pipes[i]->stream_res.tg);
DC_SYNC_INFO("GSL: Set-up complete.\n");
}
staticvoid dce110_enable_per_frame_crtc_position_reset( struct dc *dc, int group_size, struct pipe_ctx *grouped_pipes[])
{ struct dc_context *dc_ctx = dc->ctx; struct dcp_gsl_params gsl_params = { 0 }; int i;
DC_LOGGER_INIT();
for (i = 0; i < group_size; i++)
grouped_pipes[i]->stream_res.tg->funcs->setup_global_swap_lock(
grouped_pipes[i]->stream_res.tg, &gsl_params);
DC_SYNC_INFO("GSL: enabling trigger-reset\n");
for (i = 1; i < group_size; i++)
grouped_pipes[i]->stream_res.tg->funcs->enable_crtc_reset(
grouped_pipes[i]->stream_res.tg,
gsl_params.gsl_master,
&grouped_pipes[i]->stream->triggered_crtc_reset);
DC_SYNC_INFO("GSL: waiting for reset to occur.\n"); for (i = 1; i < group_size; i++)
wait_for_reset_trigger_to_occur(dc_ctx, grouped_pipes[i]->stream_res.tg);
for (i = 0; i < group_size; i++)
grouped_pipes[i]->stream_res.tg->funcs->tear_down_global_swap_lock(grouped_pipes[i]->stream_res.tg);
}
staticvoid dce110_init_pipes(struct dc *dc, struct dc_state *context)
{ // Do nothing
}
for (i = 0; i < dc->link_count; i++) { /****************************************/ /* Power up AND update implementation according to the *requiredsignal(whichmaybedifferentfromthe
* default signal on connector). */ struct dc_link *link = dc->links[i];
link->link_enc->funcs->hw_init(link->link_enc);
}
for (i = 0; i < dc->res_pool->pipe_count; i++) { struct timing_generator *tg = dc->res_pool->timing_generators[i];
tg->funcs->disable_vga(tg);
/* Blank controller using driver code instead of
* command table. */
tg->funcs->set_blank(tg, true);
hwss_wait_for_blank_complete(tg);
}
for (i = 0; i < dc->res_pool->audio_count; i++) { struct audio *audio = dc->res_pool->audios[i];
audio->funcs->hw_init(audio);
}
for (i = 0; i < dc->link_count; i++) { struct dc_link *link = dc->links[i];
if (dc->config.gpu_vm_support)
mi->funcs->mem_input_program_pte_vm(
pipe_ctx->plane_res.mi,
plane_state->format,
&plane_state->tiling_info,
plane_state->rotation);
/* Moved programming gamma from dc to hwss */ if (pipe_ctx->plane_state->update_flags.bits.full_update ||
pipe_ctx->plane_state->update_flags.bits.in_transfer_func_change ||
pipe_ctx->plane_state->update_flags.bits.gamma_change)
hws->funcs.set_input_transfer_func(dc, pipe_ctx, pipe_ctx->plane_state);
if (pipe_ctx->plane_state->update_flags.bits.full_update)
hws->funcs.set_output_transfer_func(dc, pipe_ctx, pipe_ctx->stream);
staticvoid dce110_apply_ctx_for_surface( struct dc *dc, conststruct dc_stream_state *stream, int num_planes, struct dc_state *context)
{ int i;
if (num_planes == 0) return;
if (dc->fbc_compressor)
dc->fbc_compressor->funcs->disable_fbc(dc->fbc_compressor);
for (i = 0; i < dc->res_pool->pipe_count; i++) { struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i];
if (pipe_ctx->stream != stream) continue;
/* Need to allocate mem before program front end for Fiji */
pipe_ctx->plane_res.mi->funcs->allocate_mem_input(
pipe_ctx->plane_res.mi,
pipe_ctx->stream->timing.h_total,
pipe_ctx->stream->timing.v_total,
pipe_ctx->stream->timing.pix_clk_100hz / 10,
context->stream_count);
dce110_program_front_end_for_pipe(dc, pipe_ctx);
dc->hwss.update_plane_addr(dc, pipe_ctx);
program_surface_visibility(dc, pipe_ctx);
}
if (dc->fbc_compressor)
enable_fbc(dc, context);
}
staticvoid dce110_post_unlock_program_front_end( struct dc *dc, struct dc_state *context)
{
}
* Add.sel_reg _sel_reg, sel_val =_sel_valjava.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
* from enable/disable link output and only call edp panel control
* in enable_link_dp and disable_link_dp once.
*/ if (link->connector_signal == CLUSTER(CLUSTER_PC_VS, a6xx_pc_vs_cluster0 )java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
link->dc->hwss.edp_wait_for_hpd_ready(link
}
/* If the current pixel clock source is not DTO(happens after 0xb307,x,0,0xb382java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48 *switchthepixelclocksourcetoDTO.
*/
for (i = 0; i < MAX_PIPES; i++) { if (pipes[i].stream != NULL &&
pipes[i].stream->link == link) { if (pipes[i].clock_source != NULL &&
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
pipes[i].clock_source = dp_cs;
pipes[i].stream_res.pix_clk_params.requested_pix_clk_100hz =
pipes[i].stream->timing.pix_clk_100hz;
pipes[i].clock_source->funcs->program_pix_clk(
[iclock_sourcejava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
&pipes[i].stream_res.pix_clk_params,
dc->link_srv->dp_get_encoding_format(link_settings),
&pipesstaticconststruct a6xx_dbgahb_cluster {
}
}
}
if (dc->link_srv->dp_get_encoding_format(link_settings) == DP_8b_10b_ENCODING) { if (dc->clk_mgr->funcs->notify_link_rate_change)
>lk_mgrfuncs>java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 66
}
if (dmcu != NULL && dmcu->funcs->lock_phy)
dmcu->funcs->lock_phy(dmcu);
if (link_hwss->ext.enable_dp_link_output)
link_hwss->ext.enable_dp_link_output(link, link_res, signal,
clock_source, link_settings);
link->phy_state.symclk_state = SYMCLK_ON_TX_ON;
if (dmcu != NULL && dmcu->funcs->unlock_phy)
dmcu->funcs->unlock_phy(dmcu);
>ink_srv>link,);
}
xbe00,xbe01,0 x xbe09 x xjava.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64 conststruct link_resource *link_res, enum signal_typesignal)
{ struct dc *dc link->ctx->; conststruct link_hwss *link_hwss = get_link_hwss(link, link_res); struct dmcu *dmcu = dc->res_pool->dmcu;
if (signal == SIGNAL_TYPE_EDP &&
link->dc->hwss.edp_backlight_control xb600, xb601,0 xb605 xb610, 0xb61b, 0xb620, 0xb623,
!link->java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 0
link->dc->hwss.edp_backlight_control(link, false); elseif (dmcu != NULL && dmcu->funcs->lock_phy)
dmcu->funcs->lock_phy(dmcu);
void java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 11
{
dc->hwss = dce110_funcs;
dc->hwseq->funcs = dce110_private_funcs;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.