Dave Airlie wrote:
>> So glXMakeCurrent says
>>
>> GLXBadCurrentWindow is generated if there are pending GL  commands  for
>>       the  previous  context  and the current drawable is a window that is no
>>       longer valid.
>>
>> This appears to be true, we don't seem to have cleared all the pending
>> GL commands
>> before, so we get this error.
>>
>> Adding a glFinish into the glean test exit path, gets it past this,
>> but I've no idea if this is correct.
>>
>> I then hit a GLXBadContext soon afterwards which suggest something
>> more is going wrong.
>>
>> Probably need someone with some knowledge of GLX to tell me more.
> 
> Okay attached two patches (one is a resend of some previous work - its
> in radeon-rewrite).
> 
> With these in mesa and a glFinish in the tbinding.cpp glean no longer
> dies in the
> makeCurrent test case.
> 
> However Brian you had a comment in dri_util.c about not unbinding
> things properly
> due to swapbuffers on an unbound window, can you put a glean test
> together for that?

Hmmm, that comment is from a long time ago and I don't remember the 
details.

I'm not sure glean's infrastructure will support testing swapbuffers 
on an unbound window.  I don't have time right now to dig into it. 
One of the mesa/progs/xdemos/* examples might be hacked to test that.


> so we can test it properly, as the hack that was in place seems to not
> be the best idea.
> Holding a pointer to a drawable object with no reference on it is
> definitely a path to
> accessing freed memory.
> 
> The other open question is whether the glFinish in the glean test case
> is actually necessary,
> from reading the glXMakeCurrent manpage is appears it might be, or something
> else needs to make sure outstanding GL commands on the context are
> flushed before
> the window is destroyed.

Do you have a patch for glean?  Off-hand, I don't think adding a 
glFinish() would contradict the intention of the makeCurrent test - so 
the change sounds OK to me.

Otherwise, your patches look OK to me.  Thanks!

-Brian

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to