Skip to content

Commit 19167eb

Browse files
committed
drm/i915: Reorder intel_psr2_config_valid()
Future patches will bring PSR2 selective fetch configuration validation but most of the configuration checks will be used for HW tracking and selective fetch so the reoder was necessary. Reviewed-by: Gwan-gyeong Mun <[email protected]> Signed-off-by: José Roberto de Souza <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 093a3a3 commit 19167eb

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

drivers/gpu/drm/i915/display/intel_psr.c

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -681,21 +681,6 @@ static bool intel_psr2_config_valid(struct intel_dp *intel_dp,
681681
return false;
682682
}
683683

684-
/*
685-
* Some platforms lack PSR2 HW tracking and instead require manual
686-
* tracking by software. In this case, the driver is required to track
687-
* the areas that need updates and program hardware to send selective
688-
* updates.
689-
*
690-
* So until the software tracking is implemented, PSR2 needs to be
691-
* disabled for platforms without PSR2 HW tracking.
692-
*/
693-
if (!HAS_PSR_HW_TRACKING(dev_priv)) {
694-
drm_dbg_kms(&dev_priv->drm,
695-
"No PSR2 HW tracking in the platform\n");
696-
return false;
697-
}
698-
699684
/*
700685
* DSC and PSR2 cannot be enabled simultaneously. If a requested
701686
* resolution requires DSC to be enabled, priority is given to DSC
@@ -707,6 +692,12 @@ static bool intel_psr2_config_valid(struct intel_dp *intel_dp,
707692
return false;
708693
}
709694

695+
if (crtc_state->crc_enabled) {
696+
drm_dbg_kms(&dev_priv->drm,
697+
"PSR2 not enabled because it would inhibit pipe CRC calculation\n");
698+
return false;
699+
}
700+
710701
if (INTEL_GEN(dev_priv) >= 12) {
711702
psr_max_h = 5120;
712703
psr_max_v = 3200;
@@ -721,14 +712,6 @@ static bool intel_psr2_config_valid(struct intel_dp *intel_dp,
721712
max_bpp = 24;
722713
}
723714

724-
if (crtc_hdisplay > psr_max_h || crtc_vdisplay > psr_max_v) {
725-
drm_dbg_kms(&dev_priv->drm,
726-
"PSR2 not enabled, resolution %dx%d > max supported %dx%d\n",
727-
crtc_hdisplay, crtc_vdisplay,
728-
psr_max_h, psr_max_v);
729-
return false;
730-
}
731-
732715
if (crtc_state->pipe_bpp > max_bpp) {
733716
drm_dbg_kms(&dev_priv->drm,
734717
"PSR2 not enabled, pipe bpp %d > max supported %d\n",
@@ -749,9 +732,26 @@ static bool intel_psr2_config_valid(struct intel_dp *intel_dp,
749732
return false;
750733
}
751734

752-
if (crtc_state->crc_enabled) {
735+
/*
736+
* Some platforms lack PSR2 HW tracking and instead require manual
737+
* tracking by software. In this case, the driver is required to track
738+
* the areas that need updates and program hardware to send selective
739+
* updates.
740+
*
741+
* So until the software tracking is implemented, PSR2 needs to be
742+
* disabled for platforms without PSR2 HW tracking.
743+
*/
744+
if (!HAS_PSR_HW_TRACKING(dev_priv)) {
753745
drm_dbg_kms(&dev_priv->drm,
754-
"PSR2 not enabled because it would inhibit pipe CRC calculation\n");
746+
"No PSR2 HW tracking in the platform\n");
747+
return false;
748+
}
749+
750+
if (crtc_hdisplay > psr_max_h || crtc_vdisplay > psr_max_v) {
751+
drm_dbg_kms(&dev_priv->drm,
752+
"PSR2 not enabled, resolution %dx%d > max supported %dx%d\n",
753+
crtc_hdisplay, crtc_vdisplay,
754+
psr_max_h, psr_max_v);
755755
return false;
756756
}
757757

0 commit comments

Comments
 (0)