[Mesa-dev] [PATCH v2] egl/dri2: try to bind old context if bindContext failed
Emil Velikov
emil.l.velikov at gmail.com
Mon Feb 11 14:33:25 UTC 2019
Hi all,
Haven't looked it this has landed or not.
On Tue, 5 Feb 2019 at 16:41, Eric Engestrom <eric.engestrom at intel.com> wrote:
>
> On Friday, 2019-02-01 13:36:27 +0000, Luigi Santivetti wrote:
> > Before this change, if bindContext() failed then dri2_make_current() would
> > rebind the old EGL context and surfaces and return EGL_BAD_MATCH. However,
> > it wouldn't rebind the DRI context and surfaces, thus leaving it in an
> > inconsistent and unrecoverable state.
> >
> > After this change, dri2_make_current() tries to bind the old DRI context
> > and surfaces when bindContext() failed. If unable to do so, it leaves EGL
> > and the DRI driver in a consistent state, it reports an error and returns
> > EGL_BAD_MATCH.
>
> Admittedly I don't understand everything in this function, but your
> patch looks reasonable.
> Acked-by: Eric Engestrom <eric.engestrom at intel.com>
>
> I ran it through our CI and no regression was spotted, so there's
> that :)
>
> If Emil doesn't raise any concern by the end of the week, I'll push
> your patch.
>
My biggest concern, which is unrelated to this patch. As Eric's alluded:
As-is the function is fairly confusing and convoluted, hence why I did
not really get to looking at the patch earlier.
I've tried to untangle it with
675719817e7bf7c5b9da22c02252aca77a41338d, although it did not cover
all cases.
No doubt Luigi spend some time trying to get this right, yet making it
is even harder to follow.
Can we try simplifying things up?
-Emil
More information about the mesa-dev
mailing list