Related

5 Comments

Ah, yes the cryptic labels to refer to the names given to the cairo backends. So image is a cairo_image_surface_t and solely uses pixman (i.e. software) for its compositing. xlib attempts to convert the incoming operation into RENDER primitives, but may fallback to using pixman on a local image surface (thus incurring the cost of XGetImage/XPutImage) if the XServer cannot handle the request. (On this machine, we have to fallback for the extended repeat modes since we are waiting on a new X.org release before we enable them to be sure that the driver support is ready.) gl is the most recent attempt at an OpenGL surface – it’s still very rough around the edges and has not been tuned yet. (However, the implementation looks fairly clean, so frankly I think that is the Mesa stack that is the limiting factor here. cairo-gl is reasonably fast in micro-benchmarks, benefitting greatly from direct rendering, but that performance does not carry across into ‘real-world’ complexity.) I’ll benchmark cairo-glitz at some point, because that highlights the limitation of solely implementing the RENDER extension using OpenGL (i.e. cairo-gl is faster than cairo-glitz on the hardware I have). cairo-drm is my experimental backend that issues rendering commands directly to the i915 hardware. (Thanks to the beauty of the GEM interface, the kernel handles all memory-management, all I have to do is pack batch buffers with rendering commands.) The purpose of such a custom backend is to explore the performance limitations of the GPU and to see how fast we can accelerate cairo on a given chipset. (Note that even the choices I have made so far, such as sending all geometry as scan line RECTLISTs, as opposed to using pixman to compute a trapezoidal mask, cf intel-gfx, is occasionally a net performance loss.) The goal is to make cairo-gl (and even cairo-xlib!) as fast. [And then to make cairo-drm faster…]

When looking at these graphs one crucial factor to remember is that these are only measurements of throughput. With regards to a responsive display, we also need tight bounds on latency. Measuring that in a meaningful is a task for the future. Also we need a handle on the measuing performance impact on interactive applications.

“I would also like to note, that if other performance-oriented opensource projects are interested, I would be willing to see if we can set-up such a Speed Center for them. There are already people interested in contributing to make it into a framework to be plugged into buildbots, software forges and the like. Stay tuned!”

Weird? No, just the usual stumbling blocks that a driver faces when trying to handle a rendering pattern that is not necessarily optimal for GPUs. Cairo is an immediate mode renderer that renders to lots of surfaces and combines them sequentially. This is lots of very short operations, generating lots of state changes, anathema to GPU performance. Though with a bit of time and care, the drivers can be fixed to be faster than the CPU even for Cairo, with the reduction in overhead improving the drivers for all.