Commit c66c670d authored by Jouni Högander's avatar Jouni Högander

drm/i915/psr: Split intel_psr2_config_valid for panel replay

Part of intel_psr2_config_valid is valid for panel replay. rename it as
intel_sel_update_config_valid. Split psr2 specific part and name it as
intel_psr2_config_valid.

v3:
  - move early transport check to psr2 specific check
  - check intel_psr2_config_valid only for non-Panel Replay case
v2:
  - use psr2_global_enabled for panel replay as well
  - goto unsupported instead of return when global enabled check fails
Signed-off-by: default avatarJouni Högander <jouni.hogander@intel.com>
Reviewed-by: default avatarAnimesh Manna <animesh.manna@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240510093823.3146455-12-jouni.hogander@intel.com
parent 328add88
...@@ -1147,9 +1147,6 @@ static bool intel_psr2_sel_fetch_config_valid(struct intel_dp *intel_dp, ...@@ -1147,9 +1147,6 @@ static bool intel_psr2_sel_fetch_config_valid(struct intel_dp *intel_dp,
return false; return false;
} }
if (psr2_su_region_et_valid(intel_dp))
crtc_state->enable_psr2_su_region_et = true;
return crtc_state->enable_psr2_sel_fetch = true; return crtc_state->enable_psr2_sel_fetch = true;
} }
...@@ -1520,11 +1517,6 @@ static bool intel_psr2_config_valid(struct intel_dp *intel_dp, ...@@ -1520,11 +1517,6 @@ static bool intel_psr2_config_valid(struct intel_dp *intel_dp,
return false; return false;
} }
if (!psr2_global_enabled(intel_dp)) {
drm_dbg_kms(&dev_priv->drm, "PSR2 disabled by flag\n");
return false;
}
/* /*
* DSC and PSR2 cannot be enabled simultaneously. If a requested * DSC and PSR2 cannot be enabled simultaneously. If a requested
* resolution requires DSC to be enabled, priority is given to DSC * resolution requires DSC to be enabled, priority is given to DSC
...@@ -1537,12 +1529,6 @@ static bool intel_psr2_config_valid(struct intel_dp *intel_dp, ...@@ -1537,12 +1529,6 @@ static bool intel_psr2_config_valid(struct intel_dp *intel_dp,
return false; return false;
} }
if (crtc_state->crc_enabled) {
drm_dbg_kms(&dev_priv->drm,
"PSR2 not enabled because it would inhibit pipe CRC calculation\n");
return false;
}
if (DISPLAY_VER(dev_priv) >= 12) { if (DISPLAY_VER(dev_priv) >= 12) {
psr_max_h = 5120; psr_max_h = 5120;
psr_max_v = 3200; psr_max_v = 3200;
...@@ -1593,30 +1579,60 @@ static bool intel_psr2_config_valid(struct intel_dp *intel_dp, ...@@ -1593,30 +1579,60 @@ static bool intel_psr2_config_valid(struct intel_dp *intel_dp,
return false; return false;
} }
if (HAS_PSR2_SEL_FETCH(dev_priv)) { if (!crtc_state->enable_psr2_sel_fetch &&
if (!intel_psr2_sel_fetch_config_valid(intel_dp, crtc_state) && (crtc_hdisplay > psr_max_h || crtc_vdisplay > psr_max_v)) {
!HAS_PSR_HW_TRACKING(dev_priv)) {
drm_dbg_kms(&dev_priv->drm, drm_dbg_kms(&dev_priv->drm,
"PSR2 not enabled, selective fetch not valid and no HW tracking available\n"); "PSR2 not enabled, resolution %dx%d > max supported %dx%d\n",
crtc_hdisplay, crtc_vdisplay,
psr_max_h, psr_max_v);
return false; return false;
} }
tgl_dc3co_exitline_compute_config(intel_dp, crtc_state);
if (psr2_su_region_et_valid(intel_dp))
crtc_state->enable_psr2_su_region_et = true;
return true;
}
static bool intel_sel_update_config_valid(struct intel_dp *intel_dp,
struct intel_crtc_state *crtc_state)
{
struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);
if (HAS_PSR2_SEL_FETCH(dev_priv) &&
!intel_psr2_sel_fetch_config_valid(intel_dp, crtc_state) &&
!HAS_PSR_HW_TRACKING(dev_priv)) {
drm_dbg_kms(&dev_priv->drm,
"Selective update not enabled, selective fetch not valid and no HW tracking available\n");
goto unsupported;
} }
if (!psr2_granularity_check(intel_dp, crtc_state)) { if (!psr2_global_enabled(intel_dp)) {
drm_dbg_kms(&dev_priv->drm, "PSR2 not enabled, SU granularity not compatible\n"); drm_dbg_kms(&dev_priv->drm, "Selective update disabled by flag\n");
goto unsupported; goto unsupported;
} }
if (!crtc_state->enable_psr2_sel_fetch && if (!crtc_state->has_panel_replay && !intel_psr2_config_valid(intel_dp, crtc_state))
(crtc_hdisplay > psr_max_h || crtc_vdisplay > psr_max_v)) { goto unsupported;
if (crtc_state->has_panel_replay && (DISPLAY_VER(dev_priv) < 14 ||
!intel_dp->psr.sink_panel_replay_su_support))
goto unsupported;
if (crtc_state->crc_enabled) {
drm_dbg_kms(&dev_priv->drm, drm_dbg_kms(&dev_priv->drm,
"PSR2 not enabled, resolution %dx%d > max supported %dx%d\n", "Selective update not enabled because it would inhibit pipe CRC calculation\n");
crtc_hdisplay, crtc_vdisplay, goto unsupported;
psr_max_h, psr_max_v); }
if (!psr2_granularity_check(intel_dp, crtc_state)) {
drm_dbg_kms(&dev_priv->drm,
"Selective update not enabled, SU granularity not compatible\n");
goto unsupported; goto unsupported;
} }
tgl_dc3co_exitline_compute_config(intel_dp, crtc_state);
return true; return true;
unsupported: unsupported:
...@@ -1698,7 +1714,7 @@ void intel_psr_compute_config(struct intel_dp *intel_dp, ...@@ -1698,7 +1714,7 @@ void intel_psr_compute_config(struct intel_dp *intel_dp,
if (!crtc_state->has_psr) if (!crtc_state->has_psr)
return; return;
crtc_state->has_sel_update = intel_psr2_config_valid(intel_dp, crtc_state); crtc_state->has_sel_update = intel_sel_update_config_valid(intel_dp, crtc_state);
} }
void intel_psr_get_config(struct intel_encoder *encoder, void intel_psr_get_config(struct intel_encoder *encoder,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment