Mesa: Thread Offloading, Asynchronous SwapBuffers

Posted by Michael Larabel on November 15, 2012

Marek Olšák continues to work on Mesa/Gallium3D performance improvements. Marek's latest work is on implementing a-synchronous SwapBuffers and to allow for thread offloading of SwapBuffers via a new DRI2 extension to the libGL-Mesa interface.

Marek explains his new Mesa patches with, "The motivation for the thread offloading is that it increases performance for some CPU-bound games (e.g. openarena) and the fact that the radeon gallium driver can already offload a context flush, which hides *a lot* of kernel overhead and is the main reason behind all this (the swap must be done in the driver thread for the offloading to work). Last but not least, we can use the extension for better thread offloading of OpenGL or Gallium (or both). The idea is that the swap is performed in the driver-private thread. libGL only tells the driver it can offload the flush and sets a callback function, which swaps buffers and is called in the driver-private thread after flushing is finished. By the time the buffers are swapped, some GL commands for the next frame might have already been executed. The driver has to make sure that any new rendering won't get ahead of the swapping."

However, there are some issues with the work in its current form in terms of DRI invalidate events potentially being received too late and the a-synchronous SwapBuffers don't work too well with compositing window managers.

This patch work from Marek is still being discussed and can be found on the mesa-dev list.

Discuss this article in our forums, IRC channel, or email the author. You can also follow our content via RSS and on social networks like Facebook, Identi.ca, and Twitter (@Phoronix and @MichaelLarabel). Subscribe to Phoronix Premium to view our content without advertisements, view entire articles on a single page, and experience other benefits.
Latest Hardware Reviews
  1. Intel Haswell HD Graphics 4600 vs. AMD Radeon Graphics On Linux
  2. Intel Haswell HD Graphics 4600 Performance On Ubuntu Linux
  3. Intel Core i7 4770K "Haswell" Benchmarks On Ubuntu Linux
  4. The First Experience Of Intel Haswell On Linux
Latest Software Articles
  1. Optimized Binaries Provide Great Benefits For Intel Haswell
  2. 11-Way Linux, BSD Platform Comparison
  3. SNA Acceleration Works Great For Intel Core i7 Haswell
  4. The Linux Evolution For Intel Haswell's Performance
Latest Linux News
  1. D Language Still Showing Promise, Advancements
  2. Planetary Annihilation Released For Linux Gamers
  3. Gentoo Starts Work On KDE-Wayland Support
  4. NVIDIA To License Its Kepler GPU Technology
  5. KDE's KWin Made Lots Of Progress In 4.11
  6. Ubuntu Announces Carrier Advisory Group
  7. Qt 5.1 Release Candidate 1 Has Arrived
  8. In-Fighting Continues Over Mir On Non-Unity Ubuntu
  9. Subversion 1.8 Presents New Features
  10. LLVM 3.3 Officially Released
  11. LLVM/Clang Now Uses Loop Vectorizer At New Levels
Latest Forum Talk
  1. Mir Still Causing Concerns By Ubuntu Derivatives
  2. KDE's KWin Made Lots Of Progress In 4.11
  3. I got robbed at gunpoint today....
  4. NVIDIA To License Its Kepler GPU Technology
  5. In-Fighting Continues Over Mir On Non-Unity Ubuntu
  6. The Wayland Situation: Facts About X vs. Wayland
  1. Computers
  2. Display Drivers
  3. Graphics Cards
  4. Motherboards
  5. Peripherals
  6. Processors
  7. Software
  8. Operating Systems
  9. All Articles
  1. Linux Benchmarking
  2. OpenBenchmarking.org
  3. Phoronix Test Suite