[Mesa-dev] [PATCH 0/5] Head-up display for Gallium DRI2 drivers

Brian Paul brianp at vmware.com
Mon Mar 25 08:28:55 PDT 2013

On 03/25/2013 08:45 AM, Brian Paul wrote:
> On 03/22/2013 05:50 PM, Marek Olšák wrote:
>> Hi everyone, one image is better than a thousand words:
>> http://people.freedesktop.org/~mareko/gallium-hud.png
>> So there you have it. This gallium module can draw transparent
>> graphs and text on top of what apps are rendering. By default, it
>> can show framerate, cpu load (each CPU or the average of all of
>> them), and the results of PRIMITIVES_GENERATED and OCCLUSION_COUNTER
>> queries (the latter is printed as "pixels rendered"). Furthermore,
>> there is a new interface for gallium allowing drivers to expose
>> driver-specific queries in a way similar to
>> GL_AMD_performance_monitor. It uses the existing pipe_query
>> interface. Drivers can use this to expose performance counters or
>> other internal information. BTW, I guess I should mention that I
>> ripped the font off from freeglut.
>> The HUD is controlled by the GALLIUM_HUD environment variable, where
>> you can list names of data sources. Set GALLIUM_HUD=help for more
>> info, it also prints all available names (including the
>> driver-specific queries). This is what I used for the image above:
>> GALLIUM_HUD="cpu0+cpu1+cpu2+cpu3:100,cpu:100,fps;draw-calls,requested-VRAM+requested-GTT,pixels-rendered"
>> So basically I'd like to be able to display as much useful info in
>> the HUD as possible. We should definitely add some ioctls for
>> querying useful stats from the kernel DRM/TTM and be able to see in
>> real time what happens in Mesa and the kernel. It's pretty easy -
>> just expose a new query through the gallium interface and the HUD
>> will automatically pick it up.
>> (for moderators: the second patch might get stuck in the moderation
>> queue)
> This looks really great, Marek!
> Could you update the gallium docs with your interface additions?
> Could you also create a Mesa/docs/ page which describes how this works
> and how to use it?
> I can't wait to try this with llvmpipe and the svga driver.
> I'll try to review your patches ASAP...

OK, I did a quick pass through the series and it looks good to me.

Reviewed-by: Brian Paul <brianp at vmware.com>

After you check this in I'll hook the HUD into the st/xlib code for 


More information about the mesa-dev mailing list