From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Reding Subject: Re: [PATCH 2/2] drm/atomic: add plane iterator macros Date: Fri, 21 Nov 2014 21:42:25 +0100 Message-ID: <20141121204223.GB10379@mithrandir> References: <1416601712-25036-1-git-send-email-robdclark@gmail.com> <1416601712-25036-2-git-send-email-robdclark@gmail.com> <20141121203840.GC25711@phenom.ffwll.local> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1625699352==" Return-path: Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) by gabe.freedesktop.org (Postfix) with ESMTP id D76B26F341 for ; Fri, 21 Nov 2014 12:42:27 -0800 (PST) Received: by mail-wi0-f178.google.com with SMTP id hi2so414292wib.17 for ; Fri, 21 Nov 2014 12:42:27 -0800 (PST) In-Reply-To: <20141121203840.GC25711@phenom.ffwll.local> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Daniel Vetter Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============1625699352== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SkvwRMAIpAhPCcCJ" Content-Disposition: inline --SkvwRMAIpAhPCcCJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 21, 2014 at 09:38:40PM +0100, Daniel Vetter wrote: > On Fri, Nov 21, 2014 at 03:28:32PM -0500, Rob Clark wrote: > > Add helper macros to iterate the current, or incoming set of planes > > attached to a crtc. These helpers are only available for drivers > > converted to use atomic-helpers. > >=20 > > Signed-off-by: Rob Clark > > --- > > Documentation/DocBook/drm.tmpl | 1 + > > include/drm/drm_atomic_helper.h | 26 ++++++++++++++++++++++++++ > > 2 files changed, 27 insertions(+) > >=20 > > diff --git a/Documentation/DocBook/drm.tmpl b/Documentation/DocBook/drm= =2Etmpl > > index 8c54f9a..3789f2d 100644 > > --- a/Documentation/DocBook/drm.tmpl > > +++ b/Documentation/DocBook/drm.tmpl > > @@ -2343,6 +2343,7 @@ void intel_crt_init(struct drm_device *dev) > > Atomic State Reset and Initialization > > !Pdrivers/gpu/drm/drm_atomic_helper.c atomic state reset and initializ= ation > > > > +!Iinclude/drm/drm_atomic_helper.h > > !Edrivers/gpu/drm/drm_atomic_helper.c > > > > > > diff --git a/include/drm/drm_atomic_helper.h b/include/drm/drm_atomic_h= elper.h > > index 64b4e91..42d56e6 100644 > > --- a/include/drm/drm_atomic_helper.h > > +++ b/include/drm/drm_atomic_helper.h > > @@ -96,5 +96,31 @@ drm_atomic_helper_connector_duplicate_state(struct d= rm_connector *connector); > > void drm_atomic_helper_connector_destroy_state(struct drm_connector *c= onnector, > > struct drm_connector_state *state); > > =20 > > +/** > > + * drm_crtc_for_each_plane - iterate over planes currently attached to= crtc > > + * @plane: the loop cursor > > + * @crtc: the crtc whose planes are iterated > > + * > > + * This iterates over the current state, useful (for example) when app= lying > > + * atomic state after it has been checked and swapped. To iterate ove= r the > > + * planes which *will* be attached (for ->atomic_check()) see > > + * drm_crtc_for_each_pending_plane() > > + */ > > +#define drm_crtc_for_each_plane(plane, crtc) \ > > + list_for_each_entry((plane), &(crtc)->dev->mode_config.plane_list, he= ad) \ > > + if ((crtc)->state->plane_mask & (1 << drm_plane_index(plane))) >=20 > Implement this as drm_crtc_for_each_pending_plane(plane, (crtc)->state)? > Which means _pending is a strange name ... Yeah, I think the drm_crtc_for_each_pending_plane() could be drm_crtc_state_for_each_plane(), then your suggestion makes perfect sense. Thierry --SkvwRMAIpAhPCcCJ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJUb6OvAAoJEN0jrNd/PrOhaVUP/R/LlsbWuhTESYUGO1NpNsA/ 03Tyc18wggSk1XgNTf83NGnZ3Wv/2Pj7PxvCEYiDVfpL28RLRNvAOTSSbdfy1uPa mGupuK2x8AOSqa0+7vSCoon7hQuSPQ6DhnbmwuZeV12NVypCEgTYfwANS5UiR8f4 hAg/zSUz15d91OvEXp8O2llh2hNVzOMsLw66HKnRMVC9O2WCxIfGCpdSukbEZGpY gPcJ4YEeqayWm1po9nhUMm+Wp285y2bNKnERu4RrCMND+1mn/3A0UO1YSsgYDHk1 Jug0HKu1+MEGGNqhlHJeKyiuQLD59Y1PXtB7IBIOM0rLuqEaKJ8bgCVnf9h8JgKX ahIJ+2l6JZmHJ67iJ1bRTfkCVPIrxcb0xUlNzhJChU+2iQDjpgbkz0VmDHMPvzKf a+e7xWX0IdJejGVOVA/50b89eqpVctn0oSPOPoQax569EuX+THAzypGQBALQpzTi GRrXY0aQFQ7PBuhs9GeNB4xdax1RvBZBM/5oryKv/fttDfLZVpbiVq/w1TdQt6du qJ4jm0M1WFw1kIO7vV7FSSipsS01paRBL4DmvEE6NcjFTaMXmF1hTgvPgNc16SHt Rr9tFu3rnModtA6ti4Bm2wpt2w2Wul+xru+D2UBhZ+GOfj9z+1cL2W/3erx0/sU5 pB5YNyJ1o1uq0qiECR7O =1yGs -----END PGP SIGNATURE----- --SkvwRMAIpAhPCcCJ-- --===============1625699352== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHA6Ly9saXN0 cy5mcmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9kcmktZGV2ZWwK --===============1625699352==--