GLX_EXT_buffer_age Patches For Mesa DRI2
Written by Michael Larabel in Mesa on 21 January 2015 at 02:50 AM EST. 6 Comments
MESA --
While there have been GLX_EXT_buffer_age patches for Mesa going back months, they've been for DRI3. Chris Wilson of Intel has now implemented GLX_EXT_buffer_age support along the DRI2 code-paths.

Chris Wilson of Intel's Open-Source Technology Center wrote to the Mesa mailing list this week, "In order to suport GLX_EXT_buffer_age in DRI2, we need to pass back the last swap buffer count that the back buffer was defined for. For simplicity, we can reuse an existing field in the DRI2GetBuffers reply that is not used by current drivers, the flags. Since we change the interpretation of this flag, we also declare the semantic change with a DRI2 parameter and depend upon the DDX to enable the change responsibility (which is just a matter of reviewing whether the flags field has ever been used for a non-zero value)."

Chris implemented the support along the necessary Mesa code-paths and implemented the DRI2 BufferAge support for the Radeon and Nouveau drivers. These patches have yet to be merged for mainline Mesa Git but would be likely material for Mesa 10.5.

GLX_EXT_buffer_age allows for more efficient use by compositors and applications. The OpenGL.org specification describes:
The aim of this extension is to expose enough information to applications about how the driver manages the set of front and back buffers associated with a given surface to allow applications to re-use the contents of old frames and minimize how much must be redrawn for the next frame.

There are lots of different ways for a driver to manage these buffers, from double buffering, different styles of triple buffering and even n-buffering or simply single buffer rendering. We also need to consider that power management events or memory pressure events might also result in some of the buffers not currently in-use being freed.

This extension lets applications query the age of the back buffer contents for a GLX surface as the number of frames elapsed since the contents were most recently defined. The back buffer can either be reported as invalid (has an age of 0) or it may be reported to contain the contents from n frames prior to the current frame.
Related News
About The Author
Author picture

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 or contacted via MichaelLarabel.com.

Popular News This Week