[Mesa-dev] Manipulate GALLIUM_HUD post-launch (interactively)

Martin Peres martin.peres at linux.intel.com
Thu Oct 29 03:27:43 PDT 2015

On 29/10/15 12:33, Eero Tamminen wrote:
> Hi,
> On 10/28/2015 11:24 PM, Jimmy Berry wrote:
>> I have found myself desiring the ability to manipulate the GALLIUM_HUD
>> variable while an application is running. At the most basic simply
>> being able to toggle the hud on and off would be great. Otherwise, one
>> has to relaunch an application and get back to the same state which
>> may not always be trivial.
>> Obviously there are a lot of other possibilities for such a mechanism
>> even manipulating other variables interactively.
>> I discussed the idea with imirkin_ on #dri-devel who agreed that
>> something like a socket interface would be a reasonable way to
>> approach the problem, but suggested I toss out the idea on the mailing
>> list to acquire more thoughts.
>> I have extensive development experience, but none in the kernel nor
>> mesa space. If desirable I would be interested in attempting to
>> implement this idea.
> Some other possibilities than socket:
> * Using (non-blocking) fifo, so that it can be more easily controlled 
> from shell script than with socket
> * Using signal to toggle the HUD
> Signal handler should be set only when user requests it, e.g. with 
> environment variable (that way Mesa doesn't by itself steal signals 
> from applications).

You cannot depend on signals in libraries. The application may have 
replaced the library's handler with its own.

A non-blocking FIFO, socket or a message queue (using the thread 
callback mode) would do the trick! The latter would have the lowest 
impact on performance since there would be no need to poll on the socket 
or FIFO every frame.

More information about the mesa-dev mailing list