drm/i915/display: Use initial_fastset_check() to compute and apply the initial PSR...
authorJosé Roberto de Souza <jose.souza@intel.com>
Mon, 2 Nov 2020 22:10:48 +0000 (14:10 -0800)
committerJosé Roberto de Souza <jose.souza@intel.com>
Thu, 5 Nov 2020 13:38:51 +0000 (05:38 -0800)
Replace the previous approach to force compute the initial PSR state
after i915 take over from firmware by the better and recently added
initial_fastset_check() hook.

Cc: Imre Deak <imre.deak@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201102221048.104294-1-jose.souza@intel.com
drivers/gpu/drm/i915/display/intel_atomic.c
drivers/gpu/drm/i915/display/intel_display.c
drivers/gpu/drm/i915/display/intel_dp.c
drivers/gpu/drm/i915/display/intel_psr.c
drivers/gpu/drm/i915/display/intel_psr.h
drivers/gpu/drm/i915/i915_drv.h

index 86be032..63d8d68 100644 (file)
@@ -133,7 +133,6 @@ int intel_digital_connector_atomic_check(struct drm_connector *conn,
        struct drm_crtc_state *crtc_state;
 
        intel_hdcp_atomic_check(conn, old_state, new_state);
-       intel_psr_atomic_check(conn, old_state, new_state);
 
        if (!new_state->crtc)
                return 0;
index 19a4d81..8c4687b 100644 (file)
@@ -18373,8 +18373,6 @@ int intel_modeset_init(struct drm_i915_private *i915)
 
        intel_init_ipc(i915);
 
-       intel_psr_set_force_mode_changed(i915->psr.dp);
-
        return 0;
 }
 
index cf09aca..3b0dbda 100644 (file)
@@ -3778,6 +3778,12 @@ bool intel_dp_initial_fastset_check(struct intel_encoder *encoder,
                return false;
        }
 
+       if (CAN_PSR(i915) && intel_dp_is_edp(intel_dp)) {
+               drm_dbg_kms(&i915->drm, "Forcing full modeset to compute PSR state\n");
+               crtc_state->uapi.mode_changed = true;
+               return false;
+       }
+
        return true;
 }
 
index 1576c37..b3631b7 100644 (file)
@@ -1024,8 +1024,6 @@ void intel_psr_enable(struct intel_dp *intel_dp,
        if (!CAN_PSR(dev_priv) || dev_priv->psr.dp != intel_dp)
                return;
 
-       dev_priv->psr.force_mode_changed = false;
-
        if (!crtc_state->has_psr)
                return;
 
@@ -1334,8 +1332,6 @@ void intel_psr_update(struct intel_dp *intel_dp,
        if (!CAN_PSR(dev_priv) || READ_ONCE(psr->dp) != intel_dp)
                return;
 
-       dev_priv->psr.force_mode_changed = false;
-
        mutex_lock(&dev_priv->psr.lock);
 
        enable = crtc_state->has_psr;
@@ -1869,40 +1865,3 @@ bool intel_psr_enabled(struct intel_dp *intel_dp)
 
        return ret;
 }
-
-void intel_psr_atomic_check(struct drm_connector *connector,
-                           struct drm_connector_state *old_state,
-                           struct drm_connector_state *new_state)
-{
-       struct drm_i915_private *dev_priv = to_i915(connector->dev);
-       struct intel_connector *intel_connector;
-       struct intel_digital_port *dig_port;
-       struct drm_crtc_state *crtc_state;
-
-       if (!CAN_PSR(dev_priv) || !new_state->crtc ||
-           !dev_priv->psr.force_mode_changed)
-               return;
-
-       intel_connector = to_intel_connector(connector);
-       dig_port = enc_to_dig_port(to_intel_encoder(new_state->best_encoder));
-       if (dev_priv->psr.dp != &dig_port->dp)
-               return;
-
-       crtc_state = drm_atomic_get_new_crtc_state(new_state->state,
-                                                  new_state->crtc);
-       crtc_state->mode_changed = true;
-}
-
-void intel_psr_set_force_mode_changed(struct intel_dp *intel_dp)
-{
-       struct drm_i915_private *dev_priv;
-
-       if (!intel_dp)
-               return;
-
-       dev_priv = dp_to_i915(intel_dp);
-       if (!CAN_PSR(dev_priv) || intel_dp != dev_priv->psr.dp)
-               return;
-
-       dev_priv->psr.force_mode_changed = true;
-}
index 3eca9dc..0a51797 100644 (file)
@@ -43,10 +43,6 @@ void intel_psr_short_pulse(struct intel_dp *intel_dp);
 int intel_psr_wait_for_idle(const struct intel_crtc_state *new_crtc_state,
                            u32 *out_value);
 bool intel_psr_enabled(struct intel_dp *intel_dp);
-void intel_psr_atomic_check(struct drm_connector *connector,
-                           struct drm_connector_state *old_state,
-                           struct drm_connector_state *new_state);
-void intel_psr_set_force_mode_changed(struct intel_dp *intel_dp);
 int intel_psr2_sel_fetch_update(struct intel_atomic_state *state,
                                struct intel_crtc *crtc);
 void intel_psr2_program_trans_man_trk_ctl(const struct intel_crtc_state *crtc_state);
index d7765b3..8094088 100644 (file)
@@ -508,7 +508,6 @@ struct i915_psr {
        bool dc3co_enabled;
        u32 dc3co_exit_delay;
        struct delayed_work dc3co_work;
-       bool force_mode_changed;
        struct drm_dp_vsc_sdp vsc;
 };