struct dc_link *link = NULL;
struct psr_config psr_config = {0};
struct psr_context psr_context = {0};
+ struct dc *dc = NULL;
bool ret = false;
if (stream == NULL)
return false;
link = stream->link;
+ dc = link->ctx->dc;
if (link->psr_settings.psr_version != DC_PSR_VERSION_UNSUPPORTED) {
- psr_config.psr_version = link->psr_settings.psr_version;
- psr_config.psr_frame_capture_indication_req = 0;
- psr_config.psr_rfb_setup_time = 0x37;
- psr_config.psr_sdp_transmit_line_num_deadline = 0x20;
- psr_config.allow_smu_optimizations = 0x0;
+ mod_power_calc_psr_configs(&psr_config, link, stream);
+
+ /* linux DM specific updating for psr config fields */
+ psr_config.allow_smu_optimizations =
+ (amdgpu_dc_feature_mask & DC_PSR_ALLOW_SMU_OPT) &&
+ mod_power_only_edp(dc->current_state, stream);
+ psr_config.allow_multi_disp_optimizations =
+ (amdgpu_dc_feature_mask & DC_PSR_ALLOW_MULTI_DISP_OPT);
ret = dc_link_setup_psr(link, stream, &psr_config, &psr_context);