[PATCH 4/5] drm/amdgpu: Wait for end of last waited-for vblank before programming flip

Chris Wilson chris at chris-wilson.co.uk
Tue Jun 14 08:12:44 UTC 2016


On Tue, Jun 14, 2016 at 07:53:41AM +0200, Daniel Vetter wrote:
> On Tue, Jun 14, 2016 at 11:09:10AM +0900, Michel Dänzer wrote:
> > E.g.: In cases where page flipping cannot be used, Xorg / the DDX driver
> > waits for the target vertical blank period before emitting the drawing
> > commands for a buffer swap operation. If the vblank notification only
> > arrives when the vertical blank period is already over, this is very
> > likely to result in tearing.
> > 
> > Some X compositors and AFAIK even applications such as media players can
> > use DRM_IOCTL_WAIT_VBLANK similarly. Obviously it's not intended to be
> > used directly like that, but nonetheless it is.
> 
> Is there really anything using it like that outside of -ati? I didn't know
> that we pass vblank waits to X clients.

No, because EGL doesn't offer an equivalent to OML_sync_control
applications like kodi have implemented their own vblank scheduling via
DRM_IOCTL_WAIT_VBLANK directly.

> Either way annoying, since it
> means you need to keep things working like this for amd drivers forever.
> Afaik others don't use it like that, at least not on intel. Weston has
> some hacks to use vblank waits for plane flips, but that's all disabled
> code because it just doesn't work - you need full atomic.

Inside Xorg/Present, as Michel said, the vblank notification is used to
drive onscreen copies *within* the vblank period (i.e. to try and avoid
visible tearing).
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the dri-devel mailing list