Bug 31868 - EGL doesn't work with multiple surfaces
Summary: EGL doesn't work with multiple surfaces
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Other (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-23 10:34 UTC by Neil Roberts
Modified: 2010-11-24 03:48 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Hack to make the GLES2 tri demo use two windows (3.63 KB, patch)
2010-11-23 10:36 UTC, Neil Roberts
Details | Splinter Review

Description Neil Roberts 2010-11-23 10:34:27 UTC
It seems that if you call eglMakeCurrent to switch between two surfaces then Mesa gets very confused and decides that there is no context any more so nothing paints. Attached is a patch to mesa-demos to modify the 'tri' demo for EGL/GLES2 so that it draws to two windows.

I've bisected the problem as much as I can to a range of commits but within that range instead of just not painting the demo segfaults. I'm guessing this is a separate problem. The bisect then looks like this:

547e7619aac74ae13bdaa7fdf403a4ceb5212467 <--- first known bad commit
d1acb920163ab0f39ff2fc72b85fc7bf16c37262 <--- unknown, segfaults
                  .
                  .                       }
                  .                       } all in this range seem to segfault
                  .                       }
                  .
d19afc57fe49816f3f3290410e0124d326577be2 <--- unknown, segfaults
dc4f845c37a8446de19036e24fd397a0aa864c02 <--- last known good commit

547e7619 seems like a good candidate to be the culprit because it makes changes in the right area.

The bug breaks Clutter because Clutter relies on being able to switch between surfaces even if there is only one stage. It needs to create an initial invisible dummy window before creating any stage so that it can bind the context to something in order to query the features.
Comment 1 Neil Roberts 2010-11-23 10:36:06 UTC
Created attachment 40510 [details] [review]
Hack to make the GLES2 tri demo use two windows
Comment 2 Neil Roberts 2010-11-23 10:59:31 UTC
If I checkout 547e7619a (the first known bad commit) but revert d19afc57 (the first segfaulting commit) then it works. So I guess that means d19afc57 is the culprit but for some reason 547e7619a makes it stop painting anything instead of crashing.
Comment 3 Chia-I Wu 2010-11-23 22:08:14 UTC
Thanks for the detailed report.  I've committed 1f4c55128b7e4a to fix the tri demo.  Can you test again with clutter?
Comment 4 Neil Roberts 2010-11-24 03:48:06 UTC
Yup, that fixes Clutter nicely. Thanks for the quick response.


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.