/* SPDX-License-Identifier: MIT */ /* * Copyright 2023 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 *
*/
/* Cannot configure crc on a CRTC that is disabled */ if (!optc1_is_tg_enabled(optc)) returnfalse;
if (!params->enable || params->reset)
REG_WRITE(OTG_CRC_CNTL, 0);
if (!params->enable) returntrue;
/* Program frame boundaries */ switch (params->crc_eng_inst) { case 0: /* Window A x axis start and end. */
REG_UPDATE_2(OTG_CRC0_WINDOWA_X_CONTROL,
OTG_CRC0_WINDOWA_X_START, params->windowa_x_start,
OTG_CRC0_WINDOWA_X_END, params->windowa_x_end);
/* Window A y axis start and end. */
REG_UPDATE_2(OTG_CRC0_WINDOWA_Y_CONTROL,
OTG_CRC0_WINDOWA_Y_START, params->windowa_y_start,
OTG_CRC0_WINDOWA_Y_END, params->windowa_y_end);
/* Window B x axis start and end. */
REG_UPDATE_2(OTG_CRC0_WINDOWB_X_CONTROL,
OTG_CRC0_WINDOWB_X_START, params->windowb_x_start,
OTG_CRC0_WINDOWB_X_END, params->windowb_x_end);
/* Window B y axis start and end. */
REG_UPDATE_2(OTG_CRC0_WINDOWB_Y_CONTROL,
OTG_CRC0_WINDOWB_Y_START, params->windowb_y_start,
OTG_CRC0_WINDOWB_Y_END, params->windowb_y_end);
if (optc1->base.ctx->dc->debug.otg_crc_db && optc1->tg_mask->OTG_CRC_WINDOW_DB_EN != 0)
REG_UPDATE_4(OTG_CRC_CNTL,
OTG_CRC_CONT_EN, params->continuous_mode ? 1 : 0,
OTG_CRC0_SELECT, params->selection,
OTG_CRC_EN, 1,
OTG_CRC_WINDOW_DB_EN, 1); else
REG_UPDATE_3(OTG_CRC_CNTL,
OTG_CRC_CONT_EN, params->continuous_mode ? 1 : 0,
OTG_CRC0_SELECT, params->selection,
OTG_CRC_EN, 1); break; case 1: /* Window A x axis start and end. */
REG_UPDATE_2(OTG_CRC1_WINDOWA_X_CONTROL,
OTG_CRC1_WINDOWA_X_START, params->windowa_x_start,
OTG_CRC1_WINDOWA_X_END, params->windowa_x_end);
/* Window A y axis start and end. */
REG_UPDATE_2(OTG_CRC1_WINDOWA_Y_CONTROL,
OTG_CRC1_WINDOWA_Y_START, params->windowa_y_start,
OTG_CRC1_WINDOWA_Y_END, params->windowa_y_end);
/* Window B x axis start and end. */
REG_UPDATE_2(OTG_CRC1_WINDOWB_X_CONTROL,
OTG_CRC1_WINDOWB_X_START, params->windowb_x_start,
OTG_CRC1_WINDOWB_X_END, params->windowb_x_end);
/* Window B y axis start and end. */
REG_UPDATE_2(OTG_CRC1_WINDOWB_Y_CONTROL,
OTG_CRC1_WINDOWB_Y_START, params->windowb_y_start,
OTG_CRC1_WINDOWB_Y_END, params->windowb_y_end);
staticvoid optc35_setup_manual_trigger(struct timing_generator *optc)
{ if (!optc || !optc->ctx) return;
struct optc *optc1 = DCN10TG_FROM_TG(optc); struct dc *dc = optc->ctx->dc;
if (dc->caps.dmub_caps.mclk_sw && !dc->debug.disable_fams)
dc_dmub_srv_set_drr_manual_trigger_cmd(dc, optc->inst); else { /* * MIN_MASK_EN is gone and MASK is now always enabled. * * To get it to it work with manual trigger we need to make sure * we program the correct bit.
*/
REG_UPDATE_4(OTG_V_TOTAL_CONTROL,
OTG_V_TOTAL_MIN_SEL, 1,
OTG_V_TOTAL_MAX_SEL, 1,
OTG_FORCE_LOCK_ON_EVENT, 0,
OTG_SET_V_TOTAL_MIN_MASK, (1 << 1)); /* TRIGA */
// Setup manual flow control for EOF via TRIG_A if (optc->funcs && optc->funcs->setup_manual_trigger)
optc->funcs->setup_manual_trigger(optc);
}
}
if (optc->funcs && optc->funcs->set_vtotal_min_max)
optc->funcs->set_vtotal_min_max(optc, max_otg_v_total, max_otg_v_total);
REG_WRITE(OTG_V_COUNT_STOP_CONTROL, vcount_stop);
REG_WRITE(OTG_V_COUNT_STOP_CONTROL2, vcount_stop_timer);
} else { // Variable rate, keep DRR trigger mask if (params->vertical_total_min > max_otg_v_total) { // cannot be supported // If MAX_OTG_V_COUNT < DRR trigger < v_total_min < v_total_max, // DRR trigger will drop the vtotal counting directly to a new frame. // But it should trigger between v_total_min and v_total_max.
ASSERT(0);
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.