Skip to content

Commit e827d14

Browse files
committed
Merge tag 'drm-intel-fixes-2022-04-20' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes
- Unset enable_psr2_sel_fetch if PSR2 detection fails - Fix to detect when VRR is turned off from panel settings Signed-off-by: Dave Airlie <airlied@redhat.com> From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/YmAKuHwon7hGyIoC@jlahtine-mobl.ger.corp.intel.com
2 parents b2d229d + bb02330 commit e827d14

File tree

2 files changed

+32
-23
lines changed

2 files changed

+32
-23
lines changed

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

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4383,13 +4383,20 @@ intel_dp_update_420(struct intel_dp *intel_dp)
43834383
static void
43844384
intel_dp_set_edid(struct intel_dp *intel_dp)
43854385
{
4386+
struct drm_i915_private *i915 = dp_to_i915(intel_dp);
43864387
struct intel_connector *connector = intel_dp->attached_connector;
43874388
struct edid *edid;
4389+
bool vrr_capable;
43884390

43894391
intel_dp_unset_edid(intel_dp);
43904392
edid = intel_dp_get_edid(intel_dp);
43914393
connector->detect_edid = edid;
43924394

4395+
vrr_capable = intel_vrr_is_capable(&connector->base);
4396+
drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s] VRR capable: %s\n",
4397+
connector->base.base.id, connector->base.name, str_yes_no(vrr_capable));
4398+
drm_connector_set_vrr_capable_property(&connector->base, vrr_capable);
4399+
43934400
intel_dp_update_dfp(intel_dp, edid);
43944401
intel_dp_update_420(intel_dp);
43954402

@@ -4422,6 +4429,9 @@ intel_dp_unset_edid(struct intel_dp *intel_dp)
44224429

44234430
intel_dp->dfp.ycbcr_444_to_420 = false;
44244431
connector->base.ycbcr_420_allowed = false;
4432+
4433+
drm_connector_set_vrr_capable_property(&connector->base,
4434+
false);
44254435
}
44264436

44274437
static int
@@ -4572,14 +4582,9 @@ static int intel_dp_get_modes(struct drm_connector *connector)
45724582
int num_modes = 0;
45734583

45744584
edid = intel_connector->detect_edid;
4575-
if (edid) {
4585+
if (edid)
45764586
num_modes = intel_connector_update_modes(connector, edid);
45774587

4578-
if (intel_vrr_is_capable(connector))
4579-
drm_connector_set_vrr_capable_property(connector,
4580-
true);
4581-
}
4582-
45834588
/* Also add fixed mode, which may or may not be present in EDID */
45844589
if (intel_dp_is_edp(intel_attached_dp(intel_connector)) &&
45854590
intel_connector->panel.fixed_mode) {

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

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -887,6 +887,20 @@ static bool intel_psr2_config_valid(struct intel_dp *intel_dp,
887887
return false;
888888
}
889889

890+
/* Wa_16011303918:adl-p */
891+
if (crtc_state->vrr.enable &&
892+
IS_ADLP_DISPLAY_STEP(dev_priv, STEP_A0, STEP_B0)) {
893+
drm_dbg_kms(&dev_priv->drm,
894+
"PSR2 not enabled, not compatible with HW stepping + VRR\n");
895+
return false;
896+
}
897+
898+
if (!_compute_psr2_sdp_prior_scanline_indication(intel_dp, crtc_state)) {
899+
drm_dbg_kms(&dev_priv->drm,
900+
"PSR2 not enabled, PSR2 SDP indication do not fit in hblank\n");
901+
return false;
902+
}
903+
890904
if (HAS_PSR2_SEL_FETCH(dev_priv)) {
891905
if (!intel_psr2_sel_fetch_config_valid(intel_dp, crtc_state) &&
892906
!HAS_PSR_HW_TRACKING(dev_priv)) {
@@ -900,12 +914,12 @@ static bool intel_psr2_config_valid(struct intel_dp *intel_dp,
900914
if (!crtc_state->enable_psr2_sel_fetch &&
901915
IS_TGL_DISPLAY_STEP(dev_priv, STEP_A0, STEP_C0)) {
902916
drm_dbg_kms(&dev_priv->drm, "PSR2 HW tracking is not supported this Display stepping\n");
903-
return false;
917+
goto unsupported;
904918
}
905919

906920
if (!psr2_granularity_check(intel_dp, crtc_state)) {
907921
drm_dbg_kms(&dev_priv->drm, "PSR2 not enabled, SU granularity not compatible\n");
908-
return false;
922+
goto unsupported;
909923
}
910924

911925
if (!crtc_state->enable_psr2_sel_fetch &&
@@ -914,25 +928,15 @@ static bool intel_psr2_config_valid(struct intel_dp *intel_dp,
914928
"PSR2 not enabled, resolution %dx%d > max supported %dx%d\n",
915929
crtc_hdisplay, crtc_vdisplay,
916930
psr_max_h, psr_max_v);
917-
return false;
918-
}
919-
920-
if (!_compute_psr2_sdp_prior_scanline_indication(intel_dp, crtc_state)) {
921-
drm_dbg_kms(&dev_priv->drm,
922-
"PSR2 not enabled, PSR2 SDP indication do not fit in hblank\n");
923-
return false;
924-
}
925-
926-
/* Wa_16011303918:adl-p */
927-
if (crtc_state->vrr.enable &&
928-
IS_ADLP_DISPLAY_STEP(dev_priv, STEP_A0, STEP_B0)) {
929-
drm_dbg_kms(&dev_priv->drm,
930-
"PSR2 not enabled, not compatible with HW stepping + VRR\n");
931-
return false;
931+
goto unsupported;
932932
}
933933

934934
tgl_dc3co_exitline_compute_config(intel_dp, crtc_state);
935935
return true;
936+
937+
unsupported:
938+
crtc_state->enable_psr2_sel_fetch = false;
939+
return false;
936940
}
937941

938942
void intel_psr_compute_config(struct intel_dp *intel_dp,

0 commit comments

Comments
 (0)