[Intel-gfx] [PATCH v5 7/9] drm/i915: Drop redundant checks to update PSR state
Dhinakaran Pandiyan
dhinakaran.pandiyan at intel.com
Thu Mar 7 21:03:20 UTC 2019
On Tue, 2019-03-05 at 22:47 -0800, José Roberto de Souza wrote:
> All of this checks are redudant and can be removed as the if bellow
below*
> already takes care when there is no changes in the state.
>
> Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan at intel.com>
> Reviewed-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
> Signed-off-by: José Roberto de Souza <jose.souza at intel.com>
> ---
> drivers/gpu/drm/i915/intel_psr.c | 12 ++++--------
> 1 file changed, 4 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_psr.c
> b/drivers/gpu/drm/i915/intel_psr.c
> index 73453d89a841..d3e3996551c6 100644
> --- a/drivers/gpu/drm/i915/intel_psr.c
> +++ b/drivers/gpu/drm/i915/intel_psr.c
> @@ -878,15 +878,11 @@ void intel_psr_update(struct intel_dp
> *intel_dp,
> if (enable == psr->enabled && psr2_enable == psr->psr2_enabled)
> goto unlock;
>
> - if (psr->enabled) {
> - if (!enable || psr2_enable != psr->psr2_enabled)
> - intel_psr_disable_locked(intel_dp);
> - }
> + if (psr->enabled)
> + intel_psr_disable_locked(intel_dp);
>
> - if (enable) {
> - if (!psr->enabled || psr2_enable != psr->psr2_enabled)
> - intel_psr_enable_locked(dev_priv, crtc_state);
> - }
> + if (enable)
> + intel_psr_enable_locked(dev_priv, crtc_state);
>
Looks like all cases are handled
PSR1 -> PSR2, disable, PSR1
PSR2 -> PSR1, disable, PSR2
disable -> PSR1, disable, PSR2
Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan at intel.com>
> unlock:
> mutex_unlock(&dev_priv->psr.lock);
More information about the Intel-gfx
mailing list