From: "Souza, Jose" Subject: Re: [PATCH v4 7/9] drm/i915: Drop redundant checks to update PSR state Date: Mon, 4 Mar 2019 20:45:42 +0000 Message-ID: <69ac9babdf19d13f40f467ea2e639738b7580923.camel@intel.com> References: <20190302013456.24138-1-jose.souza@intel.com> <20190302013456.24138-7-jose.souza@intel.com> <20190304184235.GF10303@intel.com> <71240c722e87829ac771567517de519777fd811b.camel@intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1147608005==" Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id 82DA089DC7 for ; Mon, 4 Mar 2019 20:45:45 +0000 (UTC) In-Reply-To: <71240c722e87829ac771567517de519777fd811b.camel@intel.com> Content-Language: en-US List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: "Vivi, Rodrigo" , "Pandiyan, Dhinakaran" Cc: "intel-gfx@lists.freedesktop.org" List-Id: intel-gfx@lists.freedesktop.org --===============1147608005== Content-Language: en-US Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="=-/wobKHUmTj7kDf3Wn9Gs" --=-/wobKHUmTj7kDf3Wn9Gs Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 2019-03-04 at 10:54 -0800, Dhinakaran Pandiyan wrote: > On Mon, 2019-03-04 at 10:42 -0800, Rodrigo Vivi wrote: > > On Fri, Mar 01, 2019 at 05:34:54PM -0800, Jos=C3=A9 Roberto de Souza > > wrote: > > > All of this checks are redudant and can be removed as the if > > > bellow > > > already takes care when there is no changes in the state. > >=20 > > is it just redundant or does it really change the behaviour for > > PSR2 > > as needed? >=20 > I have the same question now that I read Jos=C3=A9's response to patch > 8/9. > At first, I ignored reading this patch because it included the word > "redundant" in the commit message :) It is just redudant, the 'if (enable =3D=3D psr->enabled && psr2_enable =3D= =3D psr->psr2_enabled)' takes care of going from PSR1 -> PSR1, PSR2 -> PSR2 and disabled -> disabled, all other combinations requires one the calls bellow that can be simplified. >=20 > > code seems right, explanation here not so sure... > > but if this is really right and I am missing something feel > > free to use: > >=20 > >=20 > > Reviewed-by: Rodrigo Vivi > >=20 > > otherwise please change the msg. > >=20 > > Thanks, > > Rodrigo. > >=20 > > > Cc: Dhinakaran Pandiyan > > > Signed-off-by: Jos=C3=A9 Roberto de Souza > > > --- > > > drivers/gpu/drm/i915/intel_psr.c | 12 ++++-------- > > > 1 file changed, 4 insertions(+), 8 deletions(-) > > >=20 > > > 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 =3D=3D psr->enabled && psr2_enable =3D=3D psr->psr2_enab= led) > > > goto unlock; > > > =20 > > > - if (psr->enabled) { > > > - if (!enable || psr2_enable !=3D psr->psr2_enabled) > > > - intel_psr_disable_locked(intel_dp); > > > - } > > > + if (psr->enabled) > > > + intel_psr_disable_locked(intel_dp); > > > =20 > > > - if (enable) { > > > - if (!psr->enabled || psr2_enable !=3D psr->psr2_enabled) > > > - intel_psr_enable_locked(dev_priv, crtc_state); > > > - } > > > + if (enable) > > > + intel_psr_enable_locked(dev_priv, crtc_state); > > > =20 > > > unlock: > > > mutex_unlock(&dev_priv->psr.lock); > > > --=20 > > > 2.21.0 > > >=20 > > > _______________________________________________ > > > Intel-gfx mailing list > > > Intel-gfx@lists.freedesktop.org > > > https://lists.freedesktop.org/mailman/listinfo/intel-gfx --=-/wobKHUmTj7kDf3Wn9Gs Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEVNG051EijGa0MiaQVenbO/mOWkkFAlx9jnQACgkQVenbO/mO WkkSjQf/UrTCv2eBOTUxQTJzoROoIuNLUCE9wO2xbXufMmTo2TJSYyvhhPy89du9 rYkk/nAMTm8EtLtVCshsGZ79Yh65Ix1aRkM3u9zcPUBlAdRKT675SDbymGdtEtmL 9bXjk75PE800BiFxy05G5skE+rwIG/B/0DQZBxlPAsEGZURmsLGDpZvX5LXtrl9f jgxBlZA+B1qpsgaI77kY43vrG4BvTFq5HqJi+1ST3i2CcSpxMeLtaSXEWXsGFd/j di9BUbzBiDJIVdu4NJzJy9DTlOSSk4ZXgeWQ6VVFn9wZ/oqGwX8scFQbGdJNAjIw EQD1w/tbNFgwxMek8h5F0WqOJfYxww== =hOcS -----END PGP SIGNATURE----- --=-/wobKHUmTj7kDf3Wn9Gs-- --===============1147608005== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KSW50ZWwtZ2Z4 IG1haWxpbmcgbGlzdApJbnRlbC1nZnhAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vaW50ZWwtZ2Z4 --===============1147608005==--