Don't use fence sync for qcom legacy

Signed-off-by: Michael Bestas <mikeioannina@gmail.com>

Change-Id: Ifecc7af579bfde9d0a7daaaf528ea0773ce6ceb2

Conflicts:
	libs/gui/Android.mk
surfaceflinger: enable EGL_NEEDS_FNW for qcom legacy

Signed-off-by: Michael Bestas <mikeioannina@gmail.com>

Change-Id: Ia6df94e8380062d646e29f293e5dc768e8a138e7
Unbreak libgui

Change I2c0f05d1f70b96ad801971f23f6f9cf4e0fa7167 broke libgui for a
bunch of pre-4.1 blobs by changing the surfaceclient API, so bring
it back

Change-Id: I1f6ce3b886539d0e972bbe41116192bf162be968

Conflicts:
	include/gui/SurfaceComposerClient.h
	libs/gui/SurfaceComposerClient.cpp
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
make TARGET_QCOM_DISPLAY_VARIANT more parametric

Change-Id: I36bba3ba96e174b443d800fd79957a1f428899df
Select texture target based on pixel format

Adreno is not optimized for GL_TEXTURE_EXTERNAL_OES, making GPU
utilization (and power), high with GL_TEXTURE_EXTERNAL_OES for
RGB formats.

Change texture target from GL_EXTERNAL_TEXTURE_OES to dynamically
select between GL_EXTERNAL_TEXTURE_OES, and GL_TEXTURE_2D based
on the pixel format.

CM9 original author: Neti Ravi Kumar
CM9-Change-Id: I89ab1d60b23eef55442a9fd338b2a05b3304ce61

Change-Id: I9ea82f3fd1d9caea22d4b1da843f2dedb2daf51b

Signed-off-by: Daz Jones <yuki@thebronasium.com>

Conflicts:

	libs/gui/Android.mk
Native: Prefer 16bpp surface formats

Adds a property to use RGB565 surface formats for the opaque
surface default, enabled by default.
separate mHeap-based screenshot from BOARD_EGL_NEEDS_LEGACY_FB

No need for the Exynos/Tegra legacy fb implementation on legacy
qcom. Add a separate flag for mHeap-based screenshot in case of
future extensions. Enable mHeap-based screenshot for legacy qcom
dislay.

Change-Id: I35ff015555f19a5ba2857ad3d765d02eb6b9acde

Conflicts:

	libs/gui/Android.mk
Merge remote-tracking branch 'upstream/jb4.3' into slim-4.3

Conflicts:
	libs/gui/Android.mk
	services/surfaceflinger/Android.mk
	services/surfaceflinger/SurfaceFlinger.cpp