Some time ago, we implemented page flipping for several of the DRI drivers. Page flipping is an optimization where, on glXSwapBuffers, rather than blitting the contents of the GL window's back buffer to the front buffer, the driver simply updates the monitor's scanout registers to display the "back" buffer instead of the front; the back and front buffer essentially switch roles on every buffer swap. Note that one buffer swap is one frame of animation.

It seemed like a good idea at the time, but I (EricAnholt) have been arguing that it was a mistake, due to the added complexity, increased overhead for 2d, and X-versus-OpenGL nonconformance issues due to the shadow buffer used to maintain 2d contents between front and back.

So, how about some benchmarks? I ran quake3 with pageflipping enabled and disabled on a Radeon 64M VIVO, and got:

So, with quake3 at 1024x768 we see an improvement between .4 and 5.4% in framerate. But I suppose that's not really fair for the rv100, since nobody would actually run it at that resolution on that card. So how about 640x480?

Now, we see that if we crank down the resolution to a playable framerate, page flipping again becomes unimportant, even on the Radeon 7000.

From a theoretical perspective, let's assume that pageflipping turns glXSwapBuffers into a basically free operation, and that the back-to-front blit execution time is dominated by the video card's VRAM bandwidth. The peak performance win of pageflipping is therefore

Where framerate is the FPS count without pageflipping, and the constant 2 factor comes from the fact that every pixel in the blit is read once and written once. In the example above of a Radeon 7000 at 640x480x32, you have 2.6GB/s of card bandwidth to work with, and about 2.33M of bandwidth used per blit. So each blit takes about 0.88ms to complete. By making swapping a "free" operation and starting at 59.6fps, you'd gain at most an additional 52.5ms per second, or about 5% less rendering time per buffer swap. Likewise in the 1024x768 example you'd end up with at most an additional 70.3ms or 7% higher framerate.