From: "Souza, Jose" Subject: Re: [PATCH v4 9/9] drm/i915/psr: Check if source supports sink specific SU granularity Date: Tue, 4 Dec 2018 20:11:45 +0000 Message-ID: <7c527d41ef6ddc6b1c1e833123ea0a230127da56.camel@intel.com> References: <20181204003403.23361-1-jose.souza@intel.com> <20181204003403.23361-9-jose.souza@intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1831832128==" Return-path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by gabe.freedesktop.org (Postfix) with ESMTPS id EE1336E2D8 for ; Tue, 4 Dec 2018 20:11:48 +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" , "Pandiyan, Dhinakaran" Cc: "Vivi, Rodrigo" List-Id: intel-gfx@lists.freedesktop.org --===============1831832128== Content-Language: en-US Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="=-PGvX0CK7w6RkIyEueWZr" --=-PGvX0CK7w6RkIyEueWZr Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2018-12-04 at 12:02 -0800, Dhinakaran Pandiyan wrote: > On Mon, 2018-12-03 at 16:34 -0800, Jos=C3=A9 Roberto de Souza wrote: > > According to eDP spec, sink can required specific selective update > > granularity that source must comply. > > Here caching the value if required and checking if source supports > > it. > >=20 > > v3: > > - Returning the default granularity in case DPCD read > > fails(Dhinakaran) > > - Changed DPCD error message level(Dhinakaran) > >=20 > > v4: > > - Setting granularity to defaul when granularity read is equal to > > 0(Dhinakaran) > >=20 > > Cc: Rodrigo Vivi > > Cc: Dhinakaran Pandiyan > > Signed-off-by: Jos=C3=A9 Roberto de Souza > > --- > > drivers/gpu/drm/i915/i915_drv.h | 1 + > > drivers/gpu/drm/i915/intel_psr.c | 34 > > +++++++++++++++++++++++++++++- > > -- > > 2 files changed, 32 insertions(+), 3 deletions(-) > >=20 > > diff --git a/drivers/gpu/drm/i915/i915_drv.h > > b/drivers/gpu/drm/i915/i915_drv.h > > index 12b8476b09a2..81618af7a5d7 100644 > > --- a/drivers/gpu/drm/i915/i915_drv.h > > +++ b/drivers/gpu/drm/i915/i915_drv.h > > @@ -508,6 +508,7 @@ struct i915_psr { > > ktime_t last_exit; > > bool sink_not_reliable; > > bool irq_aux_error; > > + u16 su_x_granularity; > > }; > > =20 > > enum intel_pch { > > diff --git a/drivers/gpu/drm/i915/intel_psr.c > > b/drivers/gpu/drm/i915/intel_psr.c > > index 298c3145212d..cb04d806f456 100644 > > --- a/drivers/gpu/drm/i915/intel_psr.c > > +++ b/drivers/gpu/drm/i915/intel_psr.c > > @@ -261,6 +261,32 @@ static u8 > > intel_dp_get_sink_sync_latency(struct > > intel_dp *intel_dp) > > return val; > > } > > =20 > > +static u16 intel_dp_get_su_x_granulartiy(struct intel_dp > > *intel_dp) > > +{ > > + u16 val; > > + ssize_t r; > > + > > + /* > > + * Returning the default X granularity if granularity not > > required or > > + * if DPCD read fails > > + */ > > + if (!(intel_dp->psr_dpcd[1] & DP_PSR2_SU_GRANULARITY_REQUIRED)) > > + return 4; > > + > > + r =3D drm_dp_dpcd_read(&intel_dp->aux, DP_PSR2_SU_X_GRANULARITY, > > &val, 2); > > + if (r !=3D 2) > > + DRM_DEBUG_KMS("Unable to read > > DP_PSR2_SU_X_GRANULARITY\n"); > > + > > + /* > > + * Spec says that if the value read is 0 the default > > granularity should > > + * be used instead. > > + */ > > + if (r !=3D 2 || val =3D=3D 0) > > + val =3D 4; > > + > > + return val; > > +} > > + > > void intel_psr_init_dpcd(struct intel_dp *intel_dp) > > { > > struct drm_i915_private *dev_priv =3D > > @@ -315,6 +341,8 @@ void intel_psr_init_dpcd(struct intel_dp > > *intel_dp) > > if (dev_priv->psr.sink_psr2_support) { > > dev_priv->psr.colorimetry_support =3D > > intel_dp_get_colorimetry_status(intel_d > > p); > > + dev_priv->psr.su_x_granularity =3D > > + intel_dp_get_su_x_granulartiy(intel_dp) > > ; > > } > > } > > } > > @@ -541,9 +569,9 @@ static bool intel_psr2_config_valid(struct > > intel_dp *intel_dp, > > * X coordinate and Y granularity requirements will always be > > met. We > > * only need to validate the SU block width is a multiple of 4. > This comment added in the previous patch is now outdated :) The patch > looks good otherwise, Good catch, thanks. I will update to: -only need to validate the SU block width is a multiple of 4. +only need to validate the SU block width is a multiple of x granularity. > Reviewed-by: Dhinakaran Pandiyan >=20 > > */ > > - if (crtc_hdisplay % 4) { > > - DRM_DEBUG_KMS("PSR2 not enabled, hdisplay(%d) not > > multiple of 4\n", > > - crtc_hdisplay); > > + if (crtc_hdisplay % dev_priv->psr.su_x_granularity) { > > + DRM_DEBUG_KMS("PSR2 not enabled, hdisplay(%d) not > > multiple of %d\n", > > + crtc_hdisplay, dev_priv- > > > psr.su_x_granularity); > > return false; > > } > > =20 --=-PGvX0CK7w6RkIyEueWZr 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/mOWkkFAlwG34AACgkQVenbO/mO WknDGAf+NGlofX7K5h7Vw4X9/6JxfIe9bPLfGPjDzkEeKVYDuuTom8ya2f3cbmRI WJs2l94eW7Zfi7voWcd229lLvLePa+eIMntB2YzIkXCUPyS5wC0Xx7PoM1TZegne PH+5M6q8MGB5isKv18S6itYXKDlquSF+CSn50joOBH+oHGndMnlFfRqqS6Ba+Pg0 lR1JwiCjkF9h57+7VGXwDoUiOvDGzid1td4MtWAogJAhpV4N8zg18kNuR81Sod61 BDnnAaTGyiOdKKr8PtqsR6mv7kmskJrSPoDkMaYxIT8jxH2RA0AgejVQiRaDFnMC W9gkeRd2HAgEiL15/iYCLui8R0CrAw== =eZPT -----END PGP SIGNATURE----- --=-PGvX0CK7w6RkIyEueWZr-- --===============1831832128== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KSW50ZWwtZ2Z4 IG1haWxpbmcgbGlzdApJbnRlbC1nZnhAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vaW50ZWwtZ2Z4Cg== --===============1831832128==--