On 2018-05-08 06:41 PM, Adam Jackson wrote: > On Fri, 2018-05-04 at 15:45 +0200, Mario Kleiner wrote: > >> The real problem, if i understand it correctly, is the way the life-time >> of dri3_drawables and loader_dri3_drawables is managed atm. by Mesa's >> bindContext() functions. Whenever glXMakeCurrent() etc. are called to >> assign new/different GLXDrawables to the same context (ie. one context >> reused for drawing into many different drawables, as opposed to using >> one dedicated context for each drawable), we destroy the underlying >> DRIDrawables/dri3_drawables_loader_dri3_drawables and they lose all >> state wrt. pending bufferswaps, msc, sbc, ust. > > That's utterly, utterly, utterly broken. > >> Therefore one of these patches is either a good enough fix for the KDE >> hang problems atm. or a diagnosis of the problem as a starting point for >> brighter people to deal with the root cause ;-) > > I'll see what I can come up with. I'm not sure there's a great fix for > this that doesn't involve a few more roundtrips at MakeCurrent time, > since we can lose drawables asynchronously, but such is life.
I had an idea, at least for SBC: In dri3_destroy_drawable, store the drawable's send_sbc value in a hash table (keyed on the XID) in struct dri3_screen. Then in dri3_create_drawable, if there's an entry for the drawable's XID in the hash table, initialize send_sbc and recv_sbc to that. If nobody beats me to it, I'll try this tomorrow. -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev