From: "Souza, Jose" Subject: Re: [PATCH v6 8/9] drm/i915: Force PSR1 exit when getting pipe CRC Date: Fri, 8 Mar 2019 18:44:27 +0000 Message-ID: <0c551e31f62f96e8edb22bc89638e1466bdd10e7.camel@intel.com> References: <20190308000050.6226-1-jose.souza@intel.com> <20190308000050.6226-8-jose.souza@intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0203239999==" Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9C91A6E3A8 for ; Fri, 8 Mar 2019 18:44:29 +0000 (UTC) In-Reply-To: <20190308000050.6226-8-jose.souza@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: "intel-gfx@lists.freedesktop.org" Cc: "Pandiyan, Dhinakaran" List-Id: intel-gfx@lists.freedesktop.org --===============0203239999== Content-Language: en-US Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="=-rX8uI67E/YoBqAEcD3X6" --=-rX8uI67E/YoBqAEcD3X6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 2019-03-07 at 16:00 -0800, Jos=C3=A9 Roberto de Souza wrote: > If PSR1 is active when pipe CRC is enabled the CRC calculations will > be inhibit by the transition to low power states that PSR1 brings. > So lets force a PSR1 exit and as soon as pipe CRC is enabled it will > block PSR1 activation and avoid CRC timeouts when running IGT tests. >=20 > There is a little window between the call to force exit PSR and the > write to pipe CRC registers that needs to happen within the minimum > of 6 idles frames otherwise PSR1 will be active again causing the CRC > timeouts but anyways this will at least reduce the occurrence of CRC > timeouts. >=20 > This can possibily fix issues present right now but I did not found > any open, I mostly got this issue from previous CI runs of this > series, bellow some exambles: >=20 > * igt@kms_color@pipe-b-ctm-0-75: > - shard-apl: PASS -> FAIL +9 >=20 > * igt@kms_cursor_legacy@flip-vs-cursor-busy-crc-legacy: > - shard-apl: PASS -> DMESG-FAIL +17 >=20 > * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-indfb-pgflip-blt: > - shard-kbl: PASS -> DMESG-FAIL +12 >=20 > * igt@kms_pipe_crc_basic@read-crc-pipe-c: > - shard-kbl: PASS -> FAIL +7 >=20 > v6: s/PSR/PSR1 (Dhinakaran) I forgot to add DK's rv-b https://patchwork.freedesktop.org/patch/290564/?series=3D57628&rev=3D1#comm= ent_547027 >=20 > Cc: Dhinakaran Pandiyan > Cc: Ville Syrj=C3=A4l=C3=A4 > Signed-off-by: Jos=C3=A9 Roberto de Souza > --- > drivers/gpu/drm/i915/intel_psr.c | 36 ++++++++++++++++++++-------- > ---- > 1 file changed, 23 insertions(+), 13 deletions(-) >=20 > diff --git a/drivers/gpu/drm/i915/intel_psr.c > b/drivers/gpu/drm/i915/intel_psr.c > index 9847f6b0cd9a..053dbba6abde 100644 > --- a/drivers/gpu/drm/i915/intel_psr.c > +++ b/drivers/gpu/drm/i915/intel_psr.c > @@ -452,6 +452,7 @@ static void hsw_activate_psr1(struct intel_dp > *intel_dp) > * frames, we'll go with 9 frames for now > */ > idle_frames =3D max(idle_frames, dev_priv->psr.sink_sync_latency > + 1); > + > val |=3D idle_frames << EDP_PSR_IDLE_FRAME_SHIFT; > =20 > val |=3D max_sleep_time << EDP_PSR_MAX_SLEEP_TIME_SHIFT; > @@ -853,6 +854,20 @@ void intel_psr_disable(struct intel_dp > *intel_dp, > cancel_work_sync(&dev_priv->psr.work); > } > =20 > +static void psr_force_hw_tracking_exit(struct drm_i915_private > *dev_priv) > +{ > + /* > + * Display WA #0884: all > + * This documented WA for bxt can be safely applied > + * broadly so we can force HW tracking to exit PSR > + * instead of disabling and re-enabling. > + * Workaround tells us to write 0 to CUR_SURFLIVE_A, > + * but it makes more sense write to the current active > + * pipe. > + */ > + I915_WRITE(CURSURFLIVE(dev_priv->psr.pipe), 0); > +} > + > /** > * intel_psr_update - Update PSR state > * @intel_dp: Intel DP > @@ -877,8 +892,13 @@ void intel_psr_update(struct intel_dp *intel_dp, > enable =3D crtc_state->has_psr && psr_global_enabled(psr->debug); > psr2_enable =3D intel_psr2_enabled(dev_priv, crtc_state); > =20 > - if (enable =3D=3D psr->enabled && psr2_enable =3D=3D psr->psr2_enabled) > + if (enable =3D=3D psr->enabled && psr2_enable =3D=3D psr->psr2_enabled)= =20 > { > + /* Force a PSR exit when enabling CRC to avoid CRC > timeouts */ > + if (crtc_state->crc_enabled && psr->enabled) > + psr_force_hw_tracking_exit(dev_priv); > + > goto unlock; > + } > =20 > if (psr->enabled) > intel_psr_disable_locked(intel_dp); > @@ -1148,18 +1168,8 @@ void intel_psr_flush(struct drm_i915_private > *dev_priv, > dev_priv->psr.busy_frontbuffer_bits &=3D ~frontbuffer_bits; > =20 > /* By definition flush =3D invalidate + flush */ > - if (frontbuffer_bits) { > - /* > - * Display WA #0884: all > - * This documented WA for bxt can be safely applied > - * broadly so we can force HW tracking to exit PSR > - * instead of disabling and re-enabling. > - * Workaround tells us to write 0 to CUR_SURFLIVE_A, > - * but it makes more sense write to the current active > - * pipe. > - */ > - I915_WRITE(CURSURFLIVE(dev_priv->psr.pipe), 0); > - } > + if (frontbuffer_bits) > + psr_force_hw_tracking_exit(dev_priv); > =20 > if (!dev_priv->psr.active && !dev_priv- > >psr.busy_frontbuffer_bits) > schedule_work(&dev_priv->psr.work); --=-rX8uI67E/YoBqAEcD3X6 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/mOWkkFAlyCuAkACgkQVenbO/mO WklgFAf8DxZ33BybKKGY8Eqb3nbRAjKqqEJX8ynhpWTPtwch3OMAWf1SxsUHPUx0 iMEiqIN4uolSHHShNCLkGq3Ep0l3dTBOKDDgGQwC/ONW2yqadra2eaX7YH3RBFIu b6+CRvaWppbvVk9oBQuBwQYdlpLAauttt2hkl7Hh3+X2D6B34pke6fd7o1ddcFJt kfG4aYcWqjzHV5xua+ebrRtLcOTO+f61xaq//hluqsLhMIZN4Q0lxbviMOzT0RCL aDTWW0FLGjSwNjRLlSN+oKHeq7JyVC6QNW8CmYhLzdue0CilMQ3RCkEna38kAHn0 7vQx8Cf9qcGSbo1U2Mc2T8+3C7RSrA== =LVjv -----END PGP SIGNATURE----- --=-rX8uI67E/YoBqAEcD3X6-- --===============0203239999== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KSW50ZWwtZ2Z4 IG1haWxpbmcgbGlzdApJbnRlbC1nZnhAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vaW50ZWwtZ2Z4 --===============0203239999==--