]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
drm/i915/psr: Check possible errors for panel replay as well
authorJouni Högander <jouni.hogander@intel.com>
Fri, 5 Apr 2024 11:35:59 +0000 (14:35 +0300)
committerJouni Högander <jouni.hogander@intel.com>
Mon, 8 Apr 2024 07:28:53 +0000 (10:28 +0300)
On HPD interrupt we want to check if the reason for HPD was some panel
replay error detected by monitor/panel. This is already done for PSR. We
want to do this for panel replay as well. Modify intel_psr_short_pulse to
support panel replay as well.

Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Animesh Manna <animesh.manna@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240405113602.992714-6-jouni.hogander@intel.com
drivers/gpu/drm/i915/display/intel_psr.c

index 07c1ddec2d867625285daace189647b3a0ec9bfa..d7547eefc2fa0a278da6b068718256375e52f199 100644 (file)
@@ -3256,6 +3256,13 @@ static void psr_capability_changed_check(struct intel_dp *intel_dp)
        }
 }
 
+/*
+ * On common bits:
+ * DP_PSR_RFB_STORAGE_ERROR == DP_PANEL_REPLAY_RFB_STORAGE_ERROR
+ * DP_PSR_VSC_SDP_UNCORRECTABLE_ERROR == DP_PANEL_REPLAY_VSC_SDP_UNCORRECTABLE_ERROR
+ * DP_PSR_LINK_CRC_ERROR == DP_PANEL_REPLAY_LINK_CRC_ERROR
+ * this function is relying on PSR definitions
+ */
 void intel_psr_short_pulse(struct intel_dp *intel_dp)
 {
        struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);
@@ -3265,7 +3272,7 @@ void intel_psr_short_pulse(struct intel_dp *intel_dp)
                          DP_PSR_VSC_SDP_UNCORRECTABLE_ERROR |
                          DP_PSR_LINK_CRC_ERROR;
 
-       if (!CAN_PSR(intel_dp))
+       if (!CAN_PSR(intel_dp) && !CAN_PANEL_REPLAY(intel_dp))
                return;
 
        mutex_lock(&psr->lock);
@@ -3279,12 +3286,14 @@ void intel_psr_short_pulse(struct intel_dp *intel_dp)
                goto exit;
        }
 
-       if (status == DP_PSR_SINK_INTERNAL_ERROR || (error_status & errors)) {
+       if ((!psr->panel_replay_enabled && status == DP_PSR_SINK_INTERNAL_ERROR) ||
+           (error_status & errors)) {
                intel_psr_disable_locked(intel_dp);
                psr->sink_not_reliable = true;
        }
 
-       if (status == DP_PSR_SINK_INTERNAL_ERROR && !error_status)
+       if (!psr->panel_replay_enabled && status == DP_PSR_SINK_INTERNAL_ERROR &&
+           !error_status)
                drm_dbg_kms(&dev_priv->drm,
                            "PSR sink internal error, disabling PSR\n");
        if (error_status & DP_PSR_RFB_STORAGE_ERROR)
@@ -3304,8 +3313,10 @@ void intel_psr_short_pulse(struct intel_dp *intel_dp)
        /* clear status register */
        drm_dp_dpcd_writeb(&intel_dp->aux, DP_PSR_ERROR_STATUS, error_status);
 
-       psr_alpm_check(intel_dp);
-       psr_capability_changed_check(intel_dp);
+       if (!psr->panel_replay_enabled) {
+               psr_alpm_check(intel_dp);
+               psr_capability_changed_check(intel_dp);
+       }
 
 exit:
        mutex_unlock(&psr->lock);