[Mesa-dev] [PATCH v3] glx/dri3: Use a separate xcb connection for Present events

Axel Davy axel.davy at ens.fr
Tue Apr 21 12:28:52 PDT 2015


Le 20/04/2015 07:08, Axel Davy a écrit :
> Le 20/04/2015 03:58, Michel Dänzer a écrit :
>> On 19.04.2015 06:17, Axel Davy wrote:
>>> v3: put the xcb_connection in dri3_screen, instead of dri3_context
>> What's the rationale for that? Couldn't that result in the same
>> xcb_connection being used in several threads again (for several GLX
>> contexts using the same screen)?
>>
>>
>
> One way is to have one xcb_connection to listen to present events, 
> which can be in dri3_screen, while we could have a second 
> xcb_connection in dri3_context, that would be used to send the present 
> requests.
> _______________________________________________
>
The GLX spec seems to allow having several threads rendering to the same 
drawable, and suggests only one thread does the glxSwapBuffers call.

Thus I think I have to do similar to what is done in gallium nine that is:
. A mutex to prevent the drawable structure fields related to Present
. A system with mutexes to make only one thread dispatch present events 
at a time
. One connection to dispatch the present events, the other one for 
sending them. (That way you can send while one thread is waiting to 
dispatch).

Axel


More information about the mesa-dev mailing list