// SPDX-License-Identifier: MIT /* * Copyright 2022 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Authors: AMD *
*/
if (!dsc) {
DC_LOG_DSC("DSC is NULL for tg instance %d:", pipe_ctx->stream_res.tg->inst); return;
}
if (dsc->funcs->dsc_read_state) {
dsc->funcs->dsc_read_state(dsc, &dsc_state); if (!dsc_state.dsc_fw_en) {
DC_LOG_DSC("DSC has been disabled for tg instance %d:", pipe_ctx->stream_res.tg->inst); return;
}
}
// Given any pipe_ctx, return the total ODM combine factor, and optionally return // the OPPids which are used staticunsignedint get_odm_config(struct pipe_ctx *pipe_ctx, unsignedint *opp_instances)
{ unsignedint opp_count = 1; struct pipe_ctx *odm_pipe;
// First get to the top pipe for (odm_pipe = pipe_ctx; odm_pipe->prev_odm_pipe; odm_pipe = odm_pipe->prev_odm_pipe)
;
// First pipe is always used if (opp_instances)
opp_instances[0] = odm_pipe->stream_res.opp->inst;
// Find and count odm pipes, if any for (odm_pipe = odm_pipe->next_odm_pipe; odm_pipe; odm_pipe = odm_pipe->next_odm_pipe) { if (opp_instances)
opp_instances[opp_count] = odm_pipe->stream_res.opp->inst;
opp_count++;
}
return opp_count;
}
void dcn314_update_odm(struct dc *dc, struct dc_state *context, struct pipe_ctx *pipe_ctx)
{ struct pipe_ctx *odm_pipe; int opp_cnt = 0; int opp_inst[MAX_PIPES] = {0}; int odm_slice_width = resource_get_odm_slice_dst_width(pipe_ctx, false); int last_odm_slice_width = resource_get_odm_slice_dst_width(pipe_ctx, true); struct mpc *mpc = dc->res_pool->mpc; int i;
/* Check if no longer using pipe for ODM, then need to disconnect DSC for that pipe */ if (!pipe_ctx->next_odm_pipe && current_pipe_ctx->next_odm_pipe &&
current_pipe_ctx->next_odm_pipe->stream_res.dsc) { struct display_stream_compressor *dsc = current_pipe_ctx->next_odm_pipe->stream_res.dsc; /* disconnect DSC block from stream */
dsc->funcs->dsc_disconnect(dsc);
}
}
}
for (i = 0; i < dc->res_pool->pipe_count; i++) { if (i <= current_pipe_idx) {
pipe = &context->res_ctx.pipe_ctx[i];
} else {
pipe = &dc->current_state->res_ctx.pipe_ctx[i];
}
if (pipe->top_pipe || pipe->prev_odm_pipe) continue;
for (i = 0; i < dc->res_pool->pipe_count; i++) { if (i <= current_pipe_idx)
pipe = &context->res_ctx.pipe_ctx[i]; else
pipe = &dc->current_state->res_ctx.pipe_ctx[i];
if (otg_disabled[i]) { int opp_inst[MAX_PIPES] = { pipe->stream_res.opp->inst }; int opp_cnt = 1; int last_odm_slice_width = resource_get_odm_slice_dst_width(pipe, true); int odm_slice_width = resource_get_odm_slice_dst_width(pipe, false); struct pipe_ctx *odm_pipe;
if (hws->ctx->dc->res_pool->dccg->funcs->dpp_root_clock_control)
hws->ctx->dc->res_pool->dccg->funcs->dpp_root_clock_control(
hws->ctx->dc->res_pool->dccg, dpp_inst, clock_on);
}
staticvoid apply_symclk_on_tx_off_wa(struct dc_link *link)
{ /* There are use cases where SYMCLK is referenced by OTG. For instance * for TMDS signal, OTG relies SYMCLK even if TX video output is off. * However current link interface will power off PHY when disabling link * output. This will turn off SYMCLK generated by PHY. The workaround is * to identify such case where SYMCLK is still in use by OTG when we * power off PHY. When this is detected, we will temporarily power PHY * back on and move PHY's SYMCLK state to SYMCLK_ON_TX_OFF by calling * program_pix_clk interface. When OTG is disabled, we will then power * off PHY by calling disable link output again. * * In future dcn generations, we plan to rework transmitter control * interface so that we could have an option to set SYMCLK ON TX OFF * state in one step without this workaround
*/
link_hwss->disable_link_output(link, link_res, signal);
link->phy_state.symclk_state = SYMCLK_OFF_TX_OFF; /* * Add the logic to extract BOTH power up and power down sequences * from enable/disable link output and only call edp panel control * in enable_link_dp and disable_link_dp once.
*/ if (dmcu != NULL && dmcu->funcs->unlock_phy)
dmcu->funcs->unlock_phy(dmcu);
dc->link_srv->dp_trace_source_sequence(link, DPCD_SOURCE_SEQ_AFTER_DISABLE_LINK_PHY);
apply_symclk_on_tx_off_wa(link);
}
/** * dcn314_dpp_pg_control - DPP power gate control. * * @hws: dce_hwseq reference. * @dpp_inst: DPP instance reference. * @power_on: true if we want to enable power gate, false otherwise. * * Enable or disable power gate in the specific DPP instance. * If power gating is disabled, will force disable cursor in the DPP instance.
*/ void dcn314_dpp_pg_control( struct dce_hwseq *hws, unsignedint dpp_inst, bool power_on)
{
uint32_t power_gate = power_on ? 0 : 1;
uint32_t pwr_status = power_on ? 0 : 2;
if (hws->ctx->dc->debug.disable_dpp_power_gate) { /* Workaround for DCN314 with disabled power gating */ if (!power_on) {
/* Force disable cursor if power gating is disabled */ struct dpp *dpp = hws->ctx->dc->res_pool->dpps[dpp_inst]; if (dpp && dpp->funcs->dpp_force_disable_cursor)
dpp->funcs->dpp_force_disable_cursor(dpp);
} return;
} if (REG(DOMAIN1_PG_CONFIG) == 0) return;
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.