libgui: Bring back support for mHeap-based screenshots

Older graphics libraries throw a hissy fit when trying to lock
buffers for Surface-based screenshots, on at least Tegra2/3 and
Exynos4 hardware.

This patch depends on the BOARD_USE_MHEAP_SCREENSHOT board flag
and requires the ro.bq.gpu_to_cpu_unsupported property set to 1
in order to work.

Change-Id: I7db955e2cdd120018e349c14290e975788e70ed3
Merge remote-tracking branch 'cm/cm-11.0' into HEAD

Conflicts:
	services/surfaceflinger/SurfaceFlinger.cpp

Change-Id: I66a4c90d3b33f697f31a15c06008093dc76cd9e7
Merge "libgui: Bring back support for mHeap-based screenshots" into cm-11.0
Merge remote-tracking branch 'cm/cm-11.0' into HEAD
surfaceflinger: don't handle EVENT_ORIENTATION when !HWC_DEVICE_API_VERSION_1_0

a184463 causes segfault on boot for the enrc2b (and probably others), this fixes it.

Change-Id: Ic4a7a05b44c8cc44a0d25c56def4acdf5b0939df
Fix boot animation rotation problem when ro.sf.hwrotation is set to 90 or 270

Change-Id: I7ad3c83e23ce38280818ec5283d173d50c889531
Merge remote-tracking branch 'cm/cm-11.0' into HEAD
surfaceflinger: Apply bugfixes to the correct hwc code paths

Changes I2deaf2ed101e8ea76708862a6bb67751b6078794 and
I1cb44389a05c9ec049d7f0d39c288feccb11a91c, both meant to deal
with corner-case layer states, were mistakenly merged into
the pre-1.0-hwc code paths. Move them to their intended locations

Change-Id: Idd6b3513cc36dda21b552eee97f9ea91793df18f
Merge remote-tracking branch 'cm/cm-11.0' into HEAD
libs: gui: surface: optionally pass the width instead of stride to screen shot client

Summary: * DIRTY hack for broked screenshot client for some devices (such as Sony msm8660 ones)

Test Plan: * None really, should be ifdef'd properly so no risk here

Differential Revision: http://review.codefirex.com/D207

Change-Id: If09c7575ff1de341f18ad63f49547819754187d2
Signed-off-by: DHOMD <DHO@dho.im>
PMem: fix c++11 narrowing for legacy PMem

The best fix for these narrowing
violations is to use static casting

Change-Id: I900b1ebb658fc9afbfbb4943faecce9d772285ac
Signed-off-by: DHOMD <DHO@dho.im>
Graphics:Add error check when create GraphicBuffer

Big thanks to steven676 who found this commit to fix
graphics issues on many devices

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
Merge "Fix boot animation rotation problem when ro.sf.hwrotation is set to 90 or 270" into cm-11.0
surfaceflinger: Consolidate display orientation compensation hooks

Dedupe rotation calculation code and make rotation a statically
available property in the DisplayDevice
Change-Id: Ic517ab0d2c05026cd6fa46d664aab7926be17b62
Merge remote-tracking branch 'cm/cm-11.0' into HEAD
SF: Avoid wormhole clear for BLIT calls

Do not call GPU clear from SF when composition
type is BLIT as it'll be taken care in HAL.

Change-Id: Ia613eb9b824c6484ecc8c8fa4ee883545d8541b8
Update HWUI config for xxhdpi/2GB devices

Change-Id: Ic9ba16b0360f2b755a1d23aa51eddc61beee2bac
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
Merge remote-tracking branch 'cm/cm-11.0' into HEAD
sf: Fix detection of 0.3 hwcomposer

The format was different, so look at the header bits too...

Change-Id: Ibc3d4c9f6bca74d6951041f92e2ecc6189e58c41