Bug 75797 - EGL application crashes with BadDrawable at SwapBuffers
Summary: EGL application crashes with BadDrawable at SwapBuffers
Status: RESOLVED DUPLICATE of bug 74005
Alias: None
Product: Mesa
Classification: Unclassified
Component: EGL (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-05 14:22 UTC by Giovanni Campagna
Modified: 2014-04-12 01:08 UTC (History)
4 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Test case (3.67 KB, text/plain)
2014-03-05 14:22 UTC, Giovanni Campagna
Details
Proposed fix (1.06 KB, patch)
2014-03-07 01:04 UTC, Kristian Høgsberg
Details | Splinter Review

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.