From: "Souza, Jose" Subject: Re: [PATCH v2 6/6] drm/i915/debugfs: Print PSR selective update status register values Date: Thu, 10 Jan 2019 22:29:34 +0000 Message-ID: <06cd6ed88da5ae433d4b9cb632a864259af0dadd.camel@intel.com> References: <20190103142107.18304-1-jose.souza@intel.com> <20190103142107.18304-6-jose.souza@intel.com> <6c1a7d8e3e497e022a3bab0fd35482df6085e7c5.camel@intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1090189418==" Return-path: Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6166E6E0D3 for ; Thu, 10 Jan 2019 22:29:36 +0000 (UTC) In-Reply-To: <6c1a7d8e3e497e022a3bab0fd35482df6085e7c5.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: "intel-gfx@lists.freedesktop.org" , "Pandiyan, Dhinakaran" Cc: "Vivi, Rodrigo" List-Id: intel-gfx@lists.freedesktop.org --===============1090189418== Content-Language: en-US Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="=-SVoXT7wFoM5T5nyZlwzz" --=-SVoXT7wFoM5T5nyZlwzz Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2019-01-09 at 18:11 -0800, Dhinakaran Pandiyan wrote: > On Thu, 2019-01-03 at 06:21 -0800, Jos=C3=A9 Roberto de Souza wrote: > > The value of this registers will be used to test if PSR2 is doing > > selective update and if the number of blocks match with the > > expected. > >=20 > > v2: > > - Using new macros > > - Changed the string output > >=20 > > Cc: Rodrigo Vivi > > Cc: Dhinakaran Pandiyan > > Signed-off-by: Jos=C3=A9 Roberto de Souza > > --- > > drivers/gpu/drm/i915/i915_debugfs.c | 32 +++++++++++++++++++++++++ > > ---- > > 1 file changed, 28 insertions(+), 4 deletions(-) > >=20 > > diff --git a/drivers/gpu/drm/i915/i915_debugfs.c > > b/drivers/gpu/drm/i915/i915_debugfs.c > > index 5ebf0e647ac7..4e92078bc65d 100644 > > --- a/drivers/gpu/drm/i915/i915_debugfs.c > > +++ b/drivers/gpu/drm/i915/i915_debugfs.c > > @@ -2621,10 +2621,34 @@ static int i915_edp_psr_status(struct > > seq_file *m, void *data) > > seq_printf(m, "Performance counter: %u\n", val); > > } > > =20 > > - if ((psr->debug & I915_PSR_DEBUG_IRQ) && !psr->psr2_enabled) { > > - seq_printf(m, "Last attempted entry at: %lld\n", > > - psr->last_entry_attempt); > > - seq_printf(m, "Last exit at: %lld\n", psr->last_exit); > > + if (!psr->psr2_enabled) { > > + if (psr->debug & I915_PSR_DEBUG_IRQ) { > > + seq_printf(m, "Last attempted entry at: > > %lld\n", > > + psr->last_entry_attempt); > > + seq_printf(m, "Last exit at: %lld\n", psr- > > > last_exit); > > + } > > + } else { > > + u8 frame; > > + > > + seq_puts(m, "Frame:\tPSR2 SU blocks:\n"); > > + > > + for (frame =3D 0; frame < PSR2_SU_STATUS_FRAMES; frame++) > > { > > + u32 su_blocks; > > + > > + /* > > + * Avoid register reads as each register > > contains more > > + * than one frame value > > + */ > I don't think the comment is needed, but if you want to retain it I > suggest explicitly saying each register contains data for three > frames? The last one have only 2 frames. >=20 > Not sure if it matters, how about completing all the three register > reads before printing so that we reduce the chances of crossing a > frame > boundary between register reads? Hum sounds good, I will do that. >=20 > > + if ((frame % 3) =3D=3D 0) > > + val =3D I915_READ(PSR2_SU_STATUS(frame)); > > + > > + su_blocks =3D val & PSR2_SU_STATUS_MASK(frame); > > + su_blocks =3D su_blocks >> > > PSR2_SU_STATUS_SHIFT(frame); > > + /* Only printing frames with SU blocks */ > > + if (!su_blocks) > > + continue; > Why not print zero if that's the number of blocks updated in a frame? I think 8 frames with value zero are not worth to print everytime and IGT will only care about the frame 0 but I don't see any problem in printing it. >=20 > > + seq_printf(m, "%d\t%d\n", frame, su_blocks); > > + } > > } > > =20 > > unlock: --=-SVoXT7wFoM5T5nyZlwzz 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/mOWkkFAlw3x0wACgkQVenbO/mO Wkngjwf9Fc0nPOHicgGKft9CU5mrPftj04fOQXZ1XhoG3Nc8gBkWq4+946zcSqjY GC9cSmMQBuXH/rxU3UVu7kyZ/MXutZ0aPKKlacLICfeg85JtX/3kkndvI+YFkwAk tRpS3M+7pmyf3byUGKVkSZCsvbKDScv5r3gGwotkBCBNDN0vV1eVFQsFApEdjrcL dKockoOWy+EbnO0vJuWsPYrx7jWK8CRZNAJv5MMgVf2ru6jsg0neTLabqY06Vmu5 iZUUesCkRtIS8OOIAzuCOkj5pEiGXm2bCq6CIWeS/Fbnij/UH0mx+8Uk/9FNhYt7 xJzYi1WEWT9F3LAoleZVOELxrTMAXg== =04xM -----END PGP SIGNATURE----- --=-SVoXT7wFoM5T5nyZlwzz-- --===============1090189418== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KSW50ZWwtZ2Z4 IG1haWxpbmcgbGlzdApJbnRlbC1nZnhAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vaW50ZWwtZ2Z4Cg== --===============1090189418==--