Bug 75797

Summary: EGL application crashes with BadDrawable at SwapBuffers
Product: Mesa Reporter: Giovanni Campagna <scampa.giovanni>
Component: EGLAssignee: mesa-dev
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: medium CC: chadversary, jstpierre, mchqwerty, scampa.giovanni
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Test case
Proposed fix

Description Giovanni Campagna 2014-03-05 14:22:55 UTC
Created attachment 95167 [details]
Test case

If you create two X windows, make one EGL context current to the first one and then to the second one, then clear and swap the second one, you will get an X error at swap buffers time.

After debugging, I found that the glClear is optimized away because the gl_framebuffer has Width and Height == 0, despite the glViewport call that invalidated the drawable. Thus intel_prepare_render() is never reached (the viewport is already initialized in the second MakeCurrent call) and we never query X for the DRI2 buffers for the second window.

X logs include
[107772.804] (EE) intel(0): [DRI2] DRI2SwapBuffers: drawable has no back or front?


Test case attached. This is 100% reproducible here.

Mesa is befbda56a246f77797bdf13fc005353441db2879, from Feb 22, master branch.
Driver is i965 DRI, on a GM45 card.
Comment 1 Kristian Høgsberg 2014-03-07 01:04:29 UTC
Created attachment 95275 [details] [review]
Proposed fix

I think we should just remove the optimization since a 0x0 size always indicate that we haven't fetched buffers yet.
Comment 2 Armin K 2014-03-25 18:51:48 UTC
Is this patch submitted to mesa-dev list?
Comment 3 Giovanni Campagna 2014-04-12 00:34:17 UTC
(In reply to comment #2)
> Is this patch submitted to mesa-dev list?

Or maybe just merged?
Comment 4 Kristian Høgsberg 2014-04-12 01:08:03 UTC

*** This bug has been marked as a duplicate of bug 74005 ***

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.