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@xxxxxxxxx> > Reviewed-by: Rodrigo Vivi <rodrigo.vivi@xxxxxxxxx> > Signed-off-by: José Roberto de Souza <jose.souza@xxxxxxxxx> > --- > 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@xxxxxxxxx> > unlock: > mutex_unlock(&dev_priv->psr.lock); _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx