drm/i915/display: Use initial_fastset_check() to compute and apply the initial PSR state

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: default avatarJosé Roberto de Souza <jose.souza@intel.com>
Reviewed-by: default avatarImre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201102221048.104294-1-jose.souza@intel.com
parent 5f8f9652
...@@ -133,7 +133,6 @@ int intel_digital_connector_atomic_check(struct drm_connector *conn, ...@@ -133,7 +133,6 @@ int intel_digital_connector_atomic_check(struct drm_connector *conn,
struct drm_crtc_state *crtc_state; struct drm_crtc_state *crtc_state;
intel_hdcp_atomic_check(conn, old_state, new_state); intel_hdcp_atomic_check(conn, old_state, new_state);
intel_psr_atomic_check(conn, old_state, new_state);
if (!new_state->crtc) if (!new_state->crtc)
return 0; return 0;
......
...@@ -18373,8 +18373,6 @@ int intel_modeset_init(struct drm_i915_private *i915) ...@@ -18373,8 +18373,6 @@ int intel_modeset_init(struct drm_i915_private *i915)
intel_init_ipc(i915); intel_init_ipc(i915);
intel_psr_set_force_mode_changed(i915->psr.dp);
return 0; return 0;
} }
......
...@@ -3778,6 +3778,12 @@ bool intel_dp_initial_fastset_check(struct intel_encoder *encoder, ...@@ -3778,6 +3778,12 @@ bool intel_dp_initial_fastset_check(struct intel_encoder *encoder,
return false; 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; return true;
} }
......
...@@ -1024,8 +1024,6 @@ void intel_psr_enable(struct intel_dp *intel_dp, ...@@ -1024,8 +1024,6 @@ void intel_psr_enable(struct intel_dp *intel_dp,
if (!CAN_PSR(dev_priv) || dev_priv->psr.dp != intel_dp) if (!CAN_PSR(dev_priv) || dev_priv->psr.dp != intel_dp)
return; return;
dev_priv->psr.force_mode_changed = false;
if (!crtc_state->has_psr) if (!crtc_state->has_psr)
return; return;
...@@ -1334,8 +1332,6 @@ void intel_psr_update(struct intel_dp *intel_dp, ...@@ -1334,8 +1332,6 @@ void intel_psr_update(struct intel_dp *intel_dp,
if (!CAN_PSR(dev_priv) || READ_ONCE(psr->dp) != intel_dp) if (!CAN_PSR(dev_priv) || READ_ONCE(psr->dp) != intel_dp)
return; return;
dev_priv->psr.force_mode_changed = false;
mutex_lock(&dev_priv->psr.lock); mutex_lock(&dev_priv->psr.lock);
enable = crtc_state->has_psr; enable = crtc_state->has_psr;
...@@ -1869,40 +1865,3 @@ bool intel_psr_enabled(struct intel_dp *intel_dp) ...@@ -1869,40 +1865,3 @@ bool intel_psr_enabled(struct intel_dp *intel_dp)
return ret; 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;
}
...@@ -43,10 +43,6 @@ void intel_psr_short_pulse(struct intel_dp *intel_dp); ...@@ -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, int intel_psr_wait_for_idle(const struct intel_crtc_state *new_crtc_state,
u32 *out_value); u32 *out_value);
bool intel_psr_enabled(struct intel_dp *intel_dp); 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, int intel_psr2_sel_fetch_update(struct intel_atomic_state *state,
struct intel_crtc *crtc); struct intel_crtc *crtc);
void intel_psr2_program_trans_man_trk_ctl(const struct intel_crtc_state *crtc_state); void intel_psr2_program_trans_man_trk_ctl(const struct intel_crtc_state *crtc_state);
......
...@@ -508,7 +508,6 @@ struct i915_psr { ...@@ -508,7 +508,6 @@ struct i915_psr {
bool dc3co_enabled; bool dc3co_enabled;
u32 dc3co_exit_delay; u32 dc3co_exit_delay;
struct delayed_work dc3co_work; struct delayed_work dc3co_work;
bool force_mode_changed;
struct drm_dp_vsc_sdp vsc; struct drm_dp_vsc_sdp vsc;
}; };
......
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