/* * Copyright 2021 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 *
*/
/* Round up * Calculate number of frames such that at least 30 ms of time has * passed.
*/ if (vsync_rate_hz != 0) { unsignedint frame_time_microsec = 1000000 / vsync_rate_hz;
/* * Only enable static-screen optimizations for PSR1. For PSR SU, this * causes vstartup interrupt issues, used by amdgpu_dm to send vblank * events.
*/ if (link->psr_settings.psr_version < DC_PSR_VERSION_SU_1)
power_opt |= psr_power_opt_z10_static_screen;
/* * amdgpu_dm_psr_disable_all() - disable psr f/w for all streams * if psr is enabled on any stream * * Return: true if success
*/ bool amdgpu_dm_psr_disable_all(struct amdgpu_display_manager *dm)
{
DRM_DEBUG_DRIVER("Disabling psr if psr is enabled on any stream\n"); return dc_set_psr_allow_active(dm->dc, false);
}
/* * amdgpu_dm_psr_is_active_allowed() - check if psr is allowed on any stream * @dm: pointer to amdgpu_display_manager * * Return: true if allowed
*/
for (i = 0; i < dm->dc->current_state->stream_count ; i++) { struct dc_link *link; struct dc_stream_state *stream = dm->dc->current_state->streams[i];
link = stream->link; if (!link) continue; if (link->psr_settings.psr_feature_enabled &&
link->psr_settings.psr_allow_active) {
allow_active = true; break;
}
}
return allow_active;
}
/** * amdgpu_dm_psr_wait_disable() - Wait for eDP panel to exit PSR * @stream: stream state attached to the eDP link * * Waits for a max of 500ms for the eDP panel to exit PSR. * * Return: true if panel exited PSR, false otherwise.
*/ bool amdgpu_dm_psr_wait_disable(struct dc_stream_state *stream)
{ enum dc_psr_state psr_state = PSR_STATE0; struct dc_link *link = stream->link; int retry_count;
if (link == NULL) returnfalse;
for (retry_count = 0; retry_count <= 1000; retry_count++) {
dc_link_get_psr_state(link, &psr_state); if (psr_state == PSR_STATE0) break;
udelay(500);
}
if (retry_count == 1000) returnfalse;
returntrue;
}
Messung V0.5
¤ Dauer der Verarbeitung: 0.10 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.