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 problem is that the dri3_context structure is not always accessible
(for example when you bind
the context, dri3_get_buffers is called, but the context is not current
yet).
It seemed more natural to put the connection in dri3_drawable, and then
in dri3_screen, since it seemed ok to have several dri3_drawable using
the same connection as long as the event queue was protected (the
'special_event' queue makes you listen to the events of one window in
particular).
But yes, there may still be a problem if you use two threads with same
connection: in particular if one is waiting for present events while the
other one is sending a present request. I observed with gallium nine the
event is lost in that case. The solution was to use another connection
to send the events.
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.
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev