[Mesa-dev] gallium st incorrect drawable <-> context bindings.
Jose Fonseca
jfonseca at vmware.com
Tue May 24 03:22:56 PDT 2011
----- Original Message -----
> Hi,
>
> I'm not sure when this use of drawable <-> context bindings started,
> but
> the below commit uses an invalid assumption to fix a problem the root
> cause of which is also an invalid assumption.
>
> It's incorrect to associate a drawable with a context.
> A drawable may have multiple contexts bound to it, and attempts to
> associate a drawable with a single context will fail miserably in a
> multithreading environment.
This is true for WGL too, although there's some work to be done there too.
> This means that the fix below should be reverted, and
> drawable->driContextPriv should never have been used in the first
> place.
> It should nave no users whatsoever except old dri1 code using it as a
> possible swapbuffer context, but even that usage is undesired.
>
> Furthermore, the st interface that uses a specific context to notify
> about drawable invalidation is also incorrect. There should be no
> context associated with that.
I assume you're talking about
st_context_notify_invalid_framebuffer . The point of that function is to notify one context that the drawable changed. But it should notify all of them.
I think right way to fix one-drawable-multiple-contexts is to use a generation number on the drawable, which is incremented whenever the drawable is resized, and then contexts compare it with the last value they saw before. Would this fit your needs?
Jose
More information about the mesa-dev
mailing list