/* 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 *
*/
// Insert all the DCFCLK STAs first for (i = 0; i < p->num_dcfclk_stas; i++) {
s->entry.dcfclk_mhz = p->dcfclk_stas_mhz[i];
s->entry.fabricclk_mhz = 0;
s->entry.dram_speed_mts = 0; if (i > 0)
s->entry.socclk_mhz = max_socclk_mhz;
// Remove states that require higher clocks than are supported for (i = p->out_states->num_states - 1; i >= 0; i--) { if (p->out_states->state_array[i].dcfclk_mhz > max_dcfclk_mhz ||
p->out_states->state_array[i].fabricclk_mhz > max_fclk_mhz ||
p->out_states->state_array[i].dram_speed_mts > max_uclk_mhz)
remove_entry_from_table_at_index(p->out_states, i);
}
// At this point, the table contains all "points of interest" based on // DPMs from PMFW, and STAs. Table is sorted by BW, and all clock // ratios (by derate, are exact).
// Round up UCLK to DPMs for (i = p->out_states->num_states - 1; i >= 0; i--) { for (j = 0; j < num_uclk_dpms; j++) { if (p->in_states->state_array[j].dram_speed_mts >= p->out_states->state_array[i].dram_speed_mts) {
p->out_states->state_array[i].dram_speed_mts = p->in_states->state_array[j].dram_speed_mts; break;
}
}
}
// If FCLK is coarse grained, round up to next DPMs if (num_fclk_dpms > 2) { for (i = p->out_states->num_states - 1; i >= 0; i--) { for (j = 0; j < num_fclk_dpms; j++) { if (p->in_states->state_array[j].fabricclk_mhz >= p->out_states->state_array[i].fabricclk_mhz) {
p->out_states->state_array[i].fabricclk_mhz = p->in_states->state_array[j].fabricclk_mhz; break;
}
}
}
}
// Clamp to min FCLK/DCFCLK for (i = p->out_states->num_states - 1; i >= 0; i--) { if (p->out_states->state_array[i].fabricclk_mhz < min_fclk_mhz) {
p->out_states->state_array[i].fabricclk_mhz = min_fclk_mhz;
} if (p->out_states->state_array[i].dcfclk_mhz < min_dcfclk_mhz) {
p->out_states->state_array[i].dcfclk_mhz = min_dcfclk_mhz;
}
}
// Remove duplicate states, note duplicate states are always neighbouring since table is sorted.
i = 0; while (i < (int) p->out_states->num_states - 1) { if (p->out_states->state_array[i].dcfclk_mhz == p->out_states->state_array[i + 1].dcfclk_mhz &&
p->out_states->state_array[i].fabricclk_mhz == p->out_states->state_array[i + 1].fabricclk_mhz &&
p->out_states->state_array[i].dram_speed_mts == p->out_states->state_array[i + 1].dram_speed_mts)
remove_entry_from_table_at_index(p->out_states, i); else
i++;
}
return 0;
}
void build_unoptimized_policy_settings(enum dml_project_id project, struct dml_mode_eval_policy_st *policy)
{ for (int i = 0; i < __DML_NUM_PLANES__; i++) {
policy->MPCCombineUse[i] = dml_mpc_as_needed_for_voltage; // TOREVIEW: Is this still needed? When is MPCC useful for pstate given CRB?
policy->ODMUse[i] = dml_odm_use_policy_combine_as_needed;
policy->ImmediateFlipRequirement[i] = dml_immediate_flip_required;
policy->AllowForPStateChangeOrStutterInVBlank[i] = dml_prefetch_support_uclk_fclk_and_stutter_if_possible;
}
/* Change the default policy initializations as per spreadsheet. We might need to * review and change them later on as per Jun's earlier comments.
*/
policy->UseUnboundedRequesting = dml_unbounded_requesting_enable;
policy->UseMinimumRequiredDCFCLK = false;
policy->DRAMClockChangeRequirementFinal = true; // TOREVIEW: What does this mean?
policy->FCLKChangeRequirementFinal = true; // TOREVIEW: What does this mean?
policy->USRRetrainingRequiredFinal = true;
policy->EnhancedPrefetchScheduleAccelerationFinal = true; // TOREVIEW: What does this mean?
policy->NomDETInKByteOverrideEnable = false;
policy->NomDETInKByteOverrideValue = 0;
policy->DCCProgrammingAssumesScanDirectionUnknownFinal = true;
policy->SynchronizeTimingsFinal = true;
policy->SynchronizeDRRDisplaysForUCLKPStateChangeFinal = true;
policy->AssumeModeSupportAtMaxPwrStateEvenDRAMClockChangeNotSupported = true; // TOREVIEW: What does this mean?
policy->AssumeModeSupportAtMaxPwrStateEvenFClockChangeNotSupported = true; // TOREVIEW: What does this mean? if (project == dml_project_dcn35 ||
project == dml_project_dcn36 ||
project == dml_project_dcn351) {
policy->DCCProgrammingAssumesScanDirectionUnknownFinal = false;
policy->EnhancedPrefetchScheduleAccelerationFinal = 0;
policy->AllowForPStateChangeOrStutterInVBlankFinal = dml_prefetch_support_uclk_fclk_and_stutter_if_possible; /*new*/
policy->UseOnlyMaxPrefetchModes = 1;
}
}
Messung V0.5
¤ Dauer der Verarbeitung: 0.1 Sekunden
(vorverarbeitet)
¤
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.