From: "Souza, Jose" Subject: Re: [PATCH 7/7] drm/i915/psr: Disable DRRS if enabled when enabling PSR from debugfs Date: Thu, 15 Nov 2018 20:57:28 +0000 Message-ID: <68d4f775093cf5eea613d5addab8e1770e9acbec.camel@intel.com> References: <20181109202016.18920-1-jose.souza@intel.com> <20181109202016.18920-7-jose.souza@intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0131401993==" Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 38BAF6E135 for ; Thu, 15 Nov 2018 20:57:30 +0000 (UTC) In-Reply-To: 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" , "maarten.lankhorst@linux.intel.com" Cc: "Pandiyan, Dhinakaran" List-Id: intel-gfx@lists.freedesktop.org --===============0131401993== Content-Language: en-US Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="=-Edc9BGW+q+LnbMykZ7EZ" --=-Edc9BGW+q+LnbMykZ7EZ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 2018-11-12 at 11:17 +0100, Maarten Lankhorst wrote: > Op 09-11-18 om 21:20 schreef Jos=C3=A9 Roberto de Souza: > > If panel supports DRRS and PSR and if driver is loaded without PSR > > enabled, driver will enable DRRS as expected but if PSR is enabled > > by > > debugfs latter it will keep PSR and DRRS enabled causing possible > > problems as DRRS will lower the refresh rate while PSR enabled. > >=20 > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=3D108341 > > Cc: Maarten Lankhorst > > Cc: Dhinakaran Pandiyan > > Signed-off-by: Jos=C3=A9 Roberto de Souza > > --- > > drivers/gpu/drm/i915/intel_psr.c | 5 ++++- > > 1 file changed, 4 insertions(+), 1 deletion(-) > >=20 > > diff --git a/drivers/gpu/drm/i915/intel_psr.c > > b/drivers/gpu/drm/i915/intel_psr.c > > index 853e3f1370a0..bfc6a08b5cf4 100644 > > --- a/drivers/gpu/drm/i915/intel_psr.c > > +++ b/drivers/gpu/drm/i915/intel_psr.c > > @@ -904,8 +904,11 @@ int intel_psr_set_debugfs_mode(struct > > drm_i915_private *dev_priv, > > =20 > > intel_psr_irq_control(dev_priv, dev_priv->psr.debug); > > =20 > > - if (dev_priv->psr.prepared && enable) > > + if (dev_priv->psr.prepared && enable) { > > + if (crtc_state) > > + intel_edp_drrs_disable(dp, crtc_state); > > intel_psr_enable_locked(dev_priv, crtc_state); > > + } > > =20 > > mutex_unlock(&dev_priv->psr.lock); > > return ret; >=20 > I've considered this, but I thought it was a feature, not a bug. It's > a pain to track > how we handle this as intended. >=20 > kms_frontbuffer_tracking is also controlling DRRS during the test, so > perhaps simply > fix the test? >=20 > It seems the no_drrs test simply checks that if PSR is enabled, we > don't have drrs > enabled. We probably care about the default configuration, so I would > simply disable > the pipe, update the PSR flag, and then start running the tests. Else > the only thing > we test is that debugfs disables DRRS. Not that the default modeset > path prevents > PSR and DRRS simultaneously. Yeah, I think we should force a modeset from debugs to test the default modeset path, fix the tests I think is a bad idea as it could leave some test cases unhandled. Also looking at DRRS it looks complete broken for page flips, it would kept set to DRRS_LOW forever. >=20 > ~Maarten >=20 > Maybe something like below? >=20 > Perhaps move the drrs manipulation functions from > kms_frontbuffer_tracking to lib/kms_psr.c >=20 > ----8<------- > diff --git a/tests/kms_psr.c b/tests/kms_psr.c > index 9767f475bf23..ffc356df06ce 100644 > --- a/tests/kms_psr.c > +++ b/tests/kms_psr.c > @@ -414,9 +414,6 @@ int main(int argc, char *argv[]) > kmstest_set_vt_graphics_mode(); > data.devid =3D intel_get_drm_devid(data.drm_fd); > =20 > - if (!data.with_psr_disabled) > - psr_enable(data.debugfs_fd); > - > igt_require_f(sink_support(&data), > "Sink does not support PSR\n"); > =20 > @@ -428,18 +425,25 @@ int main(int argc, char *argv[]) > } > =20 > igt_subtest("basic") { > - setup_test_plane(&data, DRM_PLANE_TYPE_PRIMARY); > - igt_assert(psr_wait_entry_if_enabled(&data)); > - test_cleanup(&data); > - } > + /* Disable display to get a default setup. */ > + igt_display_commit2(&data.display, > data.display.is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY); > + > + if (!data.with_psr_disabled) > + psr_enable(data.debugfs_fd); > =20 > - igt_subtest("no_drrs") { > setup_test_plane(&data, DRM_PLANE_TYPE_PRIMARY); > igt_assert(psr_wait_entry_if_enabled(&data)); > igt_assert(drrs_disabled(&data)); > test_cleanup(&data); > } > =20 > + igt_fixture { > + drrs_disable(); > + > + if (!data.with_psr_disabled) > + psr_enable(data.debugfs_fd); > + } > + > for (op =3D PAGE_FLIP; op <=3D RENDER; op++) { > igt_subtest_f("primary_%s", op_str(op)) { > data.op =3D op; >=20 --=-Edc9BGW+q+LnbMykZ7EZ 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/mOWkkFAlvt3bYACgkQVenbO/mO WknA4Af9Euh0ii+Yn5zco+T0cPYEtvGavhmzjRHuyGhZFmtnGh2Zz/DKxuf8PuEb acePaf8x8GtfBVCWDeVKlyncvdE+JxS0/lqTvnVqKPDi3dckqQNLef8l1zmFzZGG izME1IKzZyVovGcI1+4UgElp1OqP2EGmKcGA60ICxc7r6XEYrKUFj/B3AF0txg+i MwYWECVio2ezZzrY3BO8lemDGbMKMpoWID2XgBBkfvk830kSLNKbQfZIERe3KnZ7 xqPQwjXvXmtLYXY6ijMpEL45DSWGm5QfT3DXkPfMHUVHKGLCv8Lwag7dsyau8YnG B1EnpbcfW5qZ8gOak9sAy6n0qXUCLQ== =fOVg -----END PGP SIGNATURE----- --=-Edc9BGW+q+LnbMykZ7EZ-- --===============0131401993== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KSW50ZWwtZ2Z4 IG1haWxpbmcgbGlzdApJbnRlbC1nZnhAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vaW50ZWwtZ2Z4Cg== --===============0131401993==--