From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Reding Subject: Re: [PATCH 1/4] drm/atomic-helper: Add an atomice best_encoder callback Date: Tue, 4 Aug 2015 10:52:43 +0200 Message-ID: <20150804085242.GA3886@ulmo> References: <1438615451-856-1-git-send-email-daniel.vetter@ffwll.ch> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0608171736==" Return-path: In-Reply-To: <1438615451-856-1-git-send-email-daniel.vetter@ffwll.ch> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Daniel Vetter Cc: Daniel Vetter , Intel Graphics Development , Linus Torvalds , Theodore Ts'o , DRI Development List-Id: intel-gfx@lists.freedesktop.org --===============0608171736== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="y0ulUmNC+osPPQO6" Content-Disposition: inline --y0ulUmNC+osPPQO6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 03, 2015 at 05:24:08PM +0200, Daniel Vetter wrote: > With legacy helpers all the routing was already set up when calling > best_encoder and so could be inspected. But with atomic it's staged, > hence we need a new atomic compliant callback for drivers which need > to inspect the requested state and can't just decided the best encoder > statically. >=20 > This is needed to fix up i915 dp mst where we need to pick the right > encoder depending upon the requested CRTC for the connector. >=20 > v2: Don't forget to amend the kerneldoc >=20 > Cc: Chris Wilson > Cc: Linus Torvalds > Cc: Theodore Ts'o > Signed-off-by: Daniel Vetter > --- > drivers/gpu/drm/drm_atomic_helper.c | 7 ++++++- > include/drm/drm_crtc_helper.h | 3 +++ > 2 files changed, 9 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_at= omic_helper.c > index aac212297b49..8694ca9beee3 100644 > --- a/drivers/gpu/drm/drm_atomic_helper.c > +++ b/drivers/gpu/drm/drm_atomic_helper.c > @@ -196,7 +196,12 @@ update_connector_routing(struct drm_atomic_state *st= ate, int conn_idx) > } > =20 > funcs =3D connector->helper_private; > - new_encoder =3D funcs->best_encoder(connector); > + > + if (funcs->atomic_best_encoder) > + new_encoder =3D funcs->atomic_best_encoder(connector, > + connector_state); > + else > + new_encoder =3D funcs->best_encoder(connector); > =20 > if (!new_encoder) { > DRM_DEBUG_ATOMIC("No suitable encoder found for [CONNECTOR:%d:%s]\n", > diff --git a/include/drm/drm_crtc_helper.h b/include/drm/drm_crtc_helper.h > index c8fc187061de..918aa68b5199 100644 > --- a/include/drm/drm_crtc_helper.h > +++ b/include/drm/drm_crtc_helper.h > @@ -168,6 +168,7 @@ struct drm_encoder_helper_funcs { > * @get_modes: get mode list for this connector > * @mode_valid: is this mode valid on the given connector? (optional) > * @best_encoder: return the preferred encoder for this connector > + * @atomic_best_encoder: atomic version of @best_encoder This could arguably be more verbose, but the limits of kerneldoc don't make that easy. Perhaps a more verbose description could be provided in done in the DRM DocBook, along with other documentation about atomic mode-setting. Irrespective of that, this makes sense, so: Acked-by: Thierry Reding --y0ulUmNC+osPPQO6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCAAGBQJVwH1XAAoJEN0jrNd/PrOhkmEQAIlbymtNUuDzIHyFvHsNCHhQ usSjqYD03STXCaXXMI4P6JS2r1XKgVKd3a1gWpPARAHinnFk9kgOLmM/1wNL1M7/ vDsvZ9yGSNFF428fOuX2ALSItwBFSdo7hguiF8UiTHGhxjV64khPfYL/maFe5Ewq x1KRejJCUtCqaAE4ObE7EnsJ93XwRmXJqQVg+VPtoxEeMvxlMZV7Uii9HIvJM+LQ WyG7m5lounRTy7LZmv6upesbg7LAjaFGVdxyeOgUsLbnUbG2o1aHUu+LuwKWRYKU HD3J1vOVTqU/InD/RjRIUE9hOuh9YPLBEGDxOdi/hzj+hL21WPmRB0JamOvBTlPr tclUv/2O2APmmhVuYXB+IGXVpqSDuYokK6WL+7eGjOlrmY9fC3ge5ZNL4zSqnXL0 qDaqgeafpO4vhYeNtkdrkEvZ7Tc7O5gbpwPDJ4TGDjbHgw9Yna7Zac3KAHvkSKMz +bXbpsL773FcNSZ/mi05/i3FhU+BbMxJIvOgbfuG5SjG6Cd/BiB5C5uJ7fbAcbum /N16tM9s+N6Dwaqu2JZr76QYdUuRCxFCsdq9Kxj+OaYLx15liUhNoBzWdDTspqk6 bKPHNI4WzpxUCXRfHYCyWxnDf8/ce7P3xRer0YmSqkB+cg9oFg6wvpGxv5ye9REU hbNPrSOB4LEpzQX/MwWh =Qqaw -----END PGP SIGNATURE----- --y0ulUmNC+osPPQO6-- --===============0608171736== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KSW50ZWwtZ2Z4 IG1haWxpbmcgbGlzdApJbnRlbC1nZnhAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHA6Ly9saXN0 cy5mcmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9pbnRlbC1nZngK --===============0608171736==--