OSDN Git Service

Fix 3Dmark crash - preserve more host connections
authorLingfeng Yang <lfy@google.com>
Fri, 24 Jun 2016 02:06:28 +0000 (19:06 -0700)
committerYahan Zhou <yahan@google.com>
Mon, 27 Jun 2016 21:48:22 +0000 (21:48 +0000)
commit2b4dedd9696259619d417b5bba30e1800cd290cd
treed900979514c0bc090799d67fef686aeae9db0f12
parent366ded4c74e3c4c473526dcb1425506729cddb5b
Fix 3Dmark crash - preserve more host connections

The CL

https://googleplex-android-review.git.corp.google.com/#/c/1131769/

for killing host connections was too aggressive.

It incorrectly assumed that if eglInitialize was not called in the
current thread, it'd be treated as a gralloc-only connection.

It's perfectly possible to create a new thread,
not call eglInitialize, and call eglCreateContext instead,
which is within proper usage since after there is supposed
to be only one display per process.

This situation resulted in 3DMark crashing, because once the
connection is killed on a thread that is not actually gralloc-only,
all the state goes away and segfault is just a matter of time.

This CL makes it so that eglCreateContext / eglMakeCurrent
mark the connection as not gralloc only, preventing the
connection from being erroneously killed.

The behavior where no extra render threads are created
when opening recents is still preserved.

(Cherry-pick from ebff5363850076de2623b6f6a0ff035ea3e823d5)
Change-Id: I20a204aefca91e5ac8f6b097d9fcd799f6b02583
system/egl/egl.cpp