KeithP Looks To Reduce The Latency Of Using The X.Org Present Extension

Written by Michael Larabel in X.Org on 13 December 2014 at 09:40 AM EST. 19 Comments
X.ORG
Keith Packard who is largely responsible for DRI3 and the Present Extension is looking to take care of one of the flaws of using Present: there can be an extra frame delay if using a compositing window manager with X11.

The Intel employee explained in a new blog post, "The current Present extension is pretty unfriendly to compositing managers, causing an extra frame of latency between the applications operation and the scanout buffer...When an application uses PresentPixmap, that operation is generally delayed until the next vblank interval. When using X without composting, this ensures that the operation will get started in the vblank interval, and, if the rendering operation is quick enough, you'll get the frame presented without any tearing. When using a compositing manager, the operation is still delayed until the vblank interval. That means that the CopyArea and subsequent Damage event generation don't occur until the display has already started the next frame. The compositing manager receives the damage event and constructs a new frame, but it also wants to avoid tearing, so that frame won't get displayed immediately, instead it'll get delayed until the next frame, introducing the lag."

Keith had the idea to now do the CopyArea and generated Damage right when PresentPixmap is requested but to hold off on issuing the PresentComplete event until the vblank happened. "With the contents updated and damage delivered, the compositing manager can immediately start constructing a new scene for the upcoming frame. When that is complete, it can also use PresentPixmap (either directly or through OpenGL) to queue the screen update. If it's fast enough, that will all happen before vblank and the application contents will actually appear at the desired time. Now, at the appointed vblank time, the PresentComplete event will get delivered to the client, telling it that the operation has finished and that its contents are now on the screen. If the compositing manager was quick, this event won't even be a lie."

Keith explained this on his personal blog and he currently has a set of three patches to the X.Org Server for implementing this present extension improvement for those using compositing window managers (most everyone these days).
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week