From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?B?TWljaGVsIETDpG56ZXI=?= Subject: Re: [Intel-gfx] [PATCH 7/8] drm/irq: Implement a generic vblank_wait function Date: Thu, 31 Jul 2014 10:14:02 +0900 Message-ID: <53D9985A.1050202@daenzer.net> 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> <20140730142024.GO29590@ulmo> <20140730143621.GF4193@intel.com> <20140730152135.GD1345@ulmo> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1415234260==" Return-path: In-Reply-To: <20140730152135.GD1345@ulmo> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Thierry Reding , =?UTF-8?B?VmlsbGUgU3lyasOk?= =?UTF-8?B?bMOk?= Cc: Daniel Vetter , Intel Graphics Development , DRI Development List-Id: intel-gfx@lists.freedesktop.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --===============1415234260== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="d6s4SkLwDsSKooDgropGNEhecH8JahVnt" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --d6s4SkLwDsSKooDgropGNEhecH8JahVnt Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 31.07.2014 00:21, Thierry Reding wrote: > On Wed, Jul 30, 2014 at 05:36:21PM +0300, Ville Syrj=C3=A4l=C3=A4 wrote= : >> On Wed, Jul 30, 2014 at 04:20:25PM +0200, Thierry Reding wrote: >>> 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 somethi= ng to >>>>>> clarify the purpose and reduce potential confusion versus drm_wait= _vblank(). >>>>> >>>>> Yeah that name is just transferred from the i915 driver. What about= >>>>> drm_wait_one_vblank()/drm_crtc_wait_one_vblank()? >>>> >>>> I don't care that much :), go ahead. >>> >>> Just my two cents: our downstream kernel has a helper somewhat like t= his >>> which waits for a specified number of frames (apparently this is usef= ul >>> 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); >>> } >> >> Would be nicer to wait for an absolute vblank count instead IMO. Or >> if you want to pass a relative count in just convert it to an absolute= >> count first and wait for it (taking wraparound into account obviously)= =2E >=20 > Hmm... would something like this work? >=20 > target =3D drm_vblank_count(dev, crtc) + count; >=20 > ret =3D wait_event_timeout(..., > drm_vblank_count(dev, crtc) =3D=3D target, > ...); >=20 > That should properly take into account wrap-around given that both site= s > use drm_vblank_count(). I think it would be better to refactor drm_wait_vblank() than to reinvent it. --=20 Earthling Michel D=C3=A4nzer | http://www.amd= =2Ecom Libre software enthusiast | Mesa and X developer --d6s4SkLwDsSKooDgropGNEhecH8JahVnt Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Using GnuPG with Icedove - http://www.enigmail.net/ iD8DBQFT2ZhaWoGvjmrbsgARAhu/AKCZGQLqZxzKhEs7AFob4vWTtFR18wCbB9kN LclUVr7OP58Wunlhfg60lKE= =Y8jO -----END PGP SIGNATURE----- --d6s4SkLwDsSKooDgropGNEhecH8JahVnt-- --===============1415234260== 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 --===============1415234260==--