Merge "Fixed disconnect bug in SurfaceTexture"
EGL: add GPU frame completion tracing

This change adds a debug option to EGL to use an EGLSyncKHR each frame to
determine when the GPU finishes rendering the frame.

Change-Id: I09ce071db904b44f07ca814c586c291c8b59385a
Ensure that /data/anr/traces.txt is world-writable

The umask changed for init. We have to force /data/anr to be world
readble and /data/anr/traces.txt to be world writable so dalvik
processes can write to it.

Hopefully this is a short term change while we investigate tightening
up these permissions.

Bug: 6300296
Change-Id: Iacb4c9f1bc69d2ac679697f9cf9a52694f888489
dumpstate: don't follow symlinks when creating /data/anr/traces.txt

Make Android more robust against symlink attacks when /data/anr
is world-writable.

Bug: 5614000
Change-Id: I9a7e4c4ec9aa4300ac30a968db0dcd276f364ab6
Merge "Ensure that /data/anr/traces.txt is world-writable"
Ensure that /data/anr/traces.txt is world-writable

The umask changed for init. We have to force /data/anr to be world
readble and /data/anr/traces.txt to be world writable so dalvik
processes can write to it.

Hopefully this is a short term change while we investigate tightening
up these permissions.

Bug: 6300296
Change-Id: Iacb4c9f1bc69d2ac679697f9cf9a52694f888489
Fix SurfaceFlinger crash in HWC::eventControl

eventControl was not checking if there was a hwc before callingi
hwc->eventControl

Change-Id: I4d739fc9c0d47da131f4ffc5d50e274de156d012
Merge "Add a log tag"
Merge "dumpstate: don't follow symlinks when creating /data/anr/traces.txt"
Merge "EGL: add GPU frame completion tracing"
BufferQueue no longer hardcodes buffer counts

BufferQueue is now more flexible as it can be used
by SurfaceMediaSource in addition to SurfaceTexture.

Change-Id: I4222be8918d63372c44fcd412d9ad241c6a3eeb9
avoid turning vsync off/on at each frame

always keep vsync active for an extra frame before
deciding if it should be turned off.

Change-Id: I55b03265b7851b33a595e46a013f2ab55e66c964
VSYNC handling cleanup

Change-Id: I1376bf864c4e03c11fb6d1333a8b7cfdda08c9e4
merge in jb-release history after reset to master
start VSYNC thread when HWC doesn't handle it

Change-Id: I853a822ea9ec13870ae25af55a89ad9a8cc3936a
Merge "BufferQueue no longer hardcodes buffer counts"
Increment/decrement a counter around EGL calls

This is in preparation for a change that will hibernate the underlying
EGL when idle. Instead of a bare egl_display_t*, get_display() now
returns a egl_display_ptr, which acts like a smart pointer. The
"wakecount" counter managed by the smart pointer isn't used for
anything in this change. It will be used to make sure we don't
hibernate when any thread is in an EGL call, without having to hold a
mutex for the duration of the call.

Change-Id: Iee52f3549a51162efc3800e1195d3f76bba2f2ce
Hibernate the EGL implementation when idle

If the EGL implementation supports the EGL_IMG_hibernate_process
extension, use it to hibernate (and hopefully release memory or other
resources) when the process isn't actively using EGL or OpenGL ES. The
idleness heuristic used in this change is:

(a) Wake up when entering any EGL API call, and remain awake for the
    duration of the call.
(b) Do not hibernate when any window surface exists; this means the
    application is very likely in the foreground.
(c) Do not hibernate while any context is made current to a thread.
    The app may be using a client API without the EGL layer knowing,
    so it is not safe to hibernate.
(d) Only check these conditions and attempt to hibernate after a
    window surface is destroyed or a thread's context is detached. By
    not attempting to hibernate at the end of every EGL call, we avoid
    some transient wakeups/hibernate cycles when the app is mostly idle,
    or is starting to become active but hasn't created its window
    surface yet.

On a Galaxy Nexus, hibernating frees 1567 VM pages from the process.
Both hibernating and waking can take anywhere from 30ms to over 100ms
-- measurements have been very inconsistent.

Change-Id: Ib555f5d9d069aefccca06e8173a89625b5f32d7e
BufferQueue returns proper code on acquire

Also removed unnecessary debug messages from
SurfaceTextureClient.

Change-Id: I291897a44170142f9d42a007b008823fad4683e0
merge in jb-release history after reset to master