From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Reding Subject: Re: [PATCH 7/8] drm/irq: Implement a generic vblank_wait function Date: Wed, 30 Jul 2014 16:20:25 +0200 Message-ID: <20140730142024.GO29590@ulmo> References: <1406669543-31213-1-git-send-email-daniel.vetter@ffwll.ch> <1406669543-31213-8-git-send-email-daniel.vetter@ffwll.ch> <53D85F95.3050502@daenzer.net> <20140730082212.GH4747@phenom.ffwll.local> <53D8AD9C.7000006@daenzer.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1166743196==" Return-path: In-Reply-To: <53D8AD9C.7000006@daenzer.net> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Michel =?utf-8?Q?D=C3=A4nzer?= Cc: Daniel Vetter , Intel Graphics Development , DRI Development List-Id: intel-gfx@lists.freedesktop.org --===============1166743196== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="p2pkNiL1PnZBJ6Nr" Content-Disposition: inline --p2pkNiL1PnZBJ6Nr Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 30, 2014 at 05:32:28PM +0900, Michel D=C3=A4nzer wrote: > On 30.07.2014 17:22, Daniel Vetter wrote: > > On Wed, Jul 30, 2014 at 11:59:33AM +0900, Michel D=C3=A4nzer wrote: > >> On 30.07.2014 06:32, Daniel Vetter wrote: > >>> + * due to lack of driver support or because the crtc is off. > >>> + */ > >>> +void drm_crtc_vblank_wait(struct drm_crtc *crtc) > >>> +{ > >>> + drm_vblank_wait(crtc->dev, drm_crtc_index(crtc)); > >>> +} > >>> +EXPORT_SYMBOL(drm_crtc_vblank_wait); > >>> + > >>> +/** > >> > >> Maybe the function names should be *_vblank_wait_next() or something to > >> clarify the purpose and reduce potential confusion versus drm_wait_vbl= ank(). > >=20 > > Yeah that name is just transferred from the i915 driver. What about > > drm_wait_one_vblank()/drm_crtc_wait_one_vblank()? >=20 > I don't care that much :), go ahead. Just my two cents: our downstream kernel has a helper somewhat like this which waits for a specified number of frames (apparently this is useful for some panels that require up to 5 or 6 frames before they display the correct image on screen). So perhaps something like this could work: void drm_wait_vblank_count(struct drm_device *dev, unsigned int crtc, unsigned int count) { u32 last; int ret; ret =3D drm_vblank_get(dev, crtc); if (WARN_ON(ret)) return; while (count--) { last =3D drm_vblank_count(dev, crtc); ... } drm_vblank_put(dev, crtc); } Then implement drm_wait_vblank() (or drm_wait_one_vblank()) on top of that as a special case. Of course one could equally well implement drm_wait_vblank_count() on top of your drm_wait_{one_,}vblank(). I couldn't think of a safe way to make the above work without the loop... Thierry --p2pkNiL1PnZBJ6Nr Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJT2P8oAAoJEN0jrNd/PrOhGHoP+wZxoNDmkF0yUDJC+OvjxZlO rmNVurpWO+KXIppK8FFRp0mAV8ujNaNk/s2zhXrZv81xDIKzJJ35n9ikhvO+WcFF ijIiEkTYlFBC56GGm32nzjqj41yYDapgl8lYgYOPCp7gYb1EOeM3vOcm/6Xt+uQ0 jZSRDqfCE3wlBqdLoq9TGO7QFK7GFsDh9/xsdFXOouVuLvtbF98d1zXFoI+YPPju +SKiUehNq87qDSNFUwFU4WzJrcQg0D5hmCui+fT+aeA334bEYeHx00BovBmhfoL9 bLn2yJgVNojK3tLNHWL0i9yCLfxhGoVpp5qxMzTok8AdzHV0rw8u/g89+kSIFfB2 aHhexvYU5GQOVpmqq9JH54aegXRFmkdJ4mJBYx25iuBNfLTOdnE6onHRloKj4QIa aw5knC4ozsmMOTla/cwgrkKfuto9e8fTYqIYU35JvtGvMGigHQZDy4o1Mh1nRe8/ qGHEFIB5WFJBhd+1Zj0bbD960XP9Jg16CXm8yJ8wbAvFKuVyBFIdJkMTQC1xMmgL rYQb2Nq+0qiUZ4cSrvQQkJNDoqywHIaPor0wvllTyztJsnLkGUE3wv68ZpomvZiq f4pWHYjXdCkn+4nybMGnxr+Z6INlELjwpAkYQP51R/bnnDcy71wRW94NQGoN6IeP sAM646lc0N4tPerBmyAV =GNpJ -----END PGP SIGNATURE----- --p2pkNiL1PnZBJ6Nr-- --===============1166743196== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel --===============1166743196==--