From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Reding Subject: Re: [PATCH 17/17] drm/dp: Add drm_dp_link_choose() helper Date: Tue, 13 Mar 2018 13:36:02 +0100 Message-ID: <20180313123602.GA12970@ulmo> References: <20180205193827.20374-1-thierry.reding@gmail.com> <20180205193827.20374-18-thierry.reding@gmail.com> <8760793qrk.fsf@intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0148837337==" Return-path: Received: from mail-wr0-x232.google.com (mail-wr0-x232.google.com [IPv6:2a00:1450:400c:c0c::232]) by gabe.freedesktop.org (Postfix) with ESMTPS id F17A989B42 for ; Tue, 13 Mar 2018 12:36:05 +0000 (UTC) Received: by mail-wr0-x232.google.com with SMTP id o8so22208996wra.1 for ; Tue, 13 Mar 2018 05:36:05 -0700 (PDT) In-Reply-To: <8760793qrk.fsf@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Jani Nikula Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============0148837337== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="BXVAT5kNtrzKuDFl" Content-Disposition: inline --BXVAT5kNtrzKuDFl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Feb 07, 2018 at 02:53:19PM +0200, Jani Nikula wrote: > On Mon, 05 Feb 2018, Thierry Reding wrote: > > From: Thierry Reding > > > > This helper chooses an appropriate configuration, according to the > > bitrate requirements of the video mode and the capabilities of the > > DisplayPort sink. > > > > Signed-off-by: Thierry Reding > > --- > > drivers/gpu/drm/drm_dp_helper.c | 55 +++++++++++++++++++++++++++++++++= ++++++++ > > include/drm/drm_dp_helper.h | 5 ++++ > > 2 files changed, 60 insertions(+) > > > > diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_h= elper.c > > index c8b18c0161d7..fb6ee3ebc37d 100644 > > --- a/drivers/gpu/drm/drm_dp_helper.c > > +++ b/drivers/gpu/drm/drm_dp_helper.c > > @@ -557,6 +557,61 @@ int drm_dp_link_configure(struct drm_dp_aux *aux, = struct drm_dp_link *link) > > } > > EXPORT_SYMBOL(drm_dp_link_configure); > > =20 > > +/** > > + * drm_dp_link_choose() - choose the lowest possible configuration for= a mode > > + * @link: DRM DP link object > > + * @mode: DRM display mode > > + * @info: DRM display information > > + * > > + * According to the eDP specification, a source should select a config= uration > > + * with the lowest number of lanes and the lowest possible link rate t= hat can > > + * match the bitrate requirements of a video mode. However it must ens= ure not > > + * to exceed the capabilities of the sink. >=20 > Just a couple of notes here: Sorry, this got burried under too much email. > Recent eDP allows more rates than just the ones mentioned. So you'll > actually have a number of source and sink rates, and you'll have to > intersect them to find the common rates. We have this in i915. I'm aware of this and I have a local patch to implement this. However I currently don't have an eDP setup where I can test it, so I didn't think it right to submit the patch. > Although the spec says use the "smallest" link parameters possible, > we've found that many panels out in the wild only work at the maximum > sink parameters. Presumably the sink max rate and width correspond to > the native resolution, and not much testing happens using other > parameters. :( I suppose I could just drop this helper. Or perhaps add a note about the potential pitfalls. It works fine for my particular use-case, so I could move it into the Tegra driver. How about the other patches? It's getting really late for v4.17, but I'd like to still get these in if possible so I can reduce my local patch count and merge DP support for Tegra186. Thierry --BXVAT5kNtrzKuDFl Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEiOrDCAFJzPfAjcif3SOs138+s6EFAlqnxa4ACgkQ3SOs138+ s6Ev3A//TX9tdoePOQm74phUcx3slcELfUuZa2lKx9Zb6XIS6jcL6NKXn+AS2krj Mt/JHSiAf5cCICoN4zonvieVGQq5SiE3ysBCKnenyqxpSNB4DPicNGL5T5frhoW8 ACV5JYUbEeBht5YFMoOJQWVD+SFzAfU27BdRZDvemWnwiP8K6yjcARo09ljUSaZ7 8gOQ3E0CBfriereJFJXIK4ZRhRC9D/2QMOHOCWeuPqpR+T2rKsT41PktqTDK7QS/ fOadzbJrIVFHTw9odorU1OUmOjgmko4nOBMsfHLIsVQHXJ/7ihiJ0aqO5qq8Ll81 vUzqZHkctDP3PkERQ/InwaCfCqQ6Ly/Yo/q2KRn+ECtf29D1UTGJ3Mp37/bId1pW dBMePvL7OZRchCP+ay2QzOFKQT12Hl+Nnb1UUWfVqycib6/40qC3yyuHrLDeskfx zJEdTF0wIP3WzQgkuKNhZpm0VNmz8AeV+Mem0SPQGmfkdUH2yu+Xu3SGwrgvPUuJ nUFna5M563eByeoGhfScLvP+Zc/rPNBIxDqJRWuUdoWKnzB/4qW9ee0062ZKiI6s jZZRBQaUZXVFqlbkd78jnXgHtIMOvFgbTyR8YCak5HpdG/BNQhgPSN+ofXNJHldE 9eR6ysb5+GCH4RMgE1BZD2FJGQwZsyhK6Zu6HjdQR+Z2eTBT5Go= =GliW -----END PGP SIGNATURE----- --BXVAT5kNtrzKuDFl-- --===============0148837337== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============0148837337==--