Reset the FrameNumber for dropped frame in async mode

In Async, reset the framenumber of frames dropped by the BufferQueue.
This allows the client to dequeue and use this frame before the other
queued frames which may be with the MDP.

CRs-fixed: 448606

Change-Id: Icaabf77b55a7275dc98ba1fdfba89508feb92145
Check fence is not NULL before dereferencing it

If the fence obtained in dequeueBuffer is NULL, don't dereference it.
This will avoid a crash in surfaceflinger.

CRs-fixed: 516300
Change-Id: I3054dc37087103f3addae7884bb03460484a1eec
Surface: Initialize variable and add a defensive check.

Initialize buf variable and make sure to check for return
value of dequeueBuffer() before sending to the client.

Change-Id: I0569f2d45825fab0e5d0f38fc91a07990f57c7ab
fix valgrind ioctl warning.

Initialize local variable to avoid syscall ioctl warning.

Change-Id: I33a90917856018a8527305bb362948ef03bd734c
Origin-Change-Id: I022ebce40b3774a815639a5af34bc7aeb2489936
Signed-off-by: Jin Wei <wei.a.jin@intel.com>
Signed-off-by: Jian Luo <jian.luo@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 62797
[Binder] memory init to avoid valgrind warnings

To avoid a valgrind warning, it is necessary to initialize the
allocated memory in Parcel.cpp This initialization should
avoid also an unpredictable behaviour because 0 is more
appropriate value that a random value from heap.
The issue has been found by valgrind when testing of mediaserver.

Change-Id: I2eb3e3ec7933553256054119019f6ccea6e17fea
Author: Andrei V. FOMITCHEV <andreix.fomitchev@intel.com>
Signed-off-by: Andrei V. FOMITCHEV <andreix.fomitchev@intel.com>
Signed-off-by: Jin Wei <wei.a.jin@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 61459
Graphics:Add error check when create GraphicBuffer

Change-Id: Ib0ca59bf1dfe4ae0266c29c91c1dbe3d02c0904e
Author: Lingyun Zhu <lingyun.zhu@intel.com>
Signed-off-by: Lingyun Zhu <lingyun.zhu@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 50141
Add libpng include path

 Forward compatibility change

Change-Id: Iae792715d9a9aea34f53cd6383981371835c4a31
Remove incompatible ashmem.h

Dmitry Antipov noticed there is some inconsistent ioctl definitions
for ashmem in the frameworks/native/include/utils/ashmem.h file.

Specifically, that file defines:

 #define ASHMEM_PIN              _IO(__ASHMEMIOC, 7)
 #define ASHMEM_UNPIN            _IO(__ASHMEMIOC, 8)
 #define ASHMEM_ISPINNED         _IO(__ASHMEMIOC, 9)

Instead of what the kernel, bionic (and apparently everywhere else)
uses:
 #define ASHMEM_PIN     _IOW(__ASHMEMIOC, 7, struct ashmem_pin)
 #define ASHMEM_UNPIN   _IOW(__ASHMEMIOC, 8, struct ashmem_pin)
 #define ASHMEM_GET_PIN_STATUS	_IO(__ASHMEMIOC, 9)

The problematic file doesn't seem to have much git history,
and seems to be a historic leftover. So after checking with
the Android Kernel Team, it was suggested that removing this
file is the right approach.

Change-Id: I6da9989856b74deed2e1bd28d3d7f9f9c70b85a0
Signed-off-by: John Stultz <john.stultz@linaro.org>
Fix some aliasing violations
surfaceflinger: Handle screen timeout on hw without vsync

timeout currently at 1 second waiting for vsync. With
this change timeout happens at 16ms.

Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Fix OpenGL stub exception handling.

Bug: https://code.google.com/p/android/issues/detail?id=60390
Change-Id: I2bdc22c5fe75f5e41ffb9dd9259ae92cf8a12917
Fix AMotionEvent_getHistorical* to take const AInputEvent* motion_event

See b.android.com/55873

Change-Id: I92c549e1a595662d4df8fa0e47675ccb2b8814fd