Surface: fix copy back dirty region

Copyback dirty region logic does copyback,
even when its not necessary causing 2ms delay.
Fix the logic to copy back only what is necessary.

(cherry picked from commit 9dc653a0fe16e70469a1a55f55da1a47c30d4d95)

Change-Id: I52de68258ac9f87d704ee5401f93417805fa6773
binder: add compat symbol

Required for older blobs

Change-Id: Ib18d2513570382432d49f302ab041230650372f2
Merge "Surface: fix copy back dirty region" into android-4.4
binder: add another compat symbol

- Extend https://gerrit.omnirom.org/#/c/2324/
- Some old blobs, mainly LGE libs need this

Change-Id: Ia0370fecff24348aefa17aa7de2609535323e9b0
Merge branch 'android-4.4' of https://github.com/omnirom/android_frameworks_native into android-4.4
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
gui: allow disabling fence sync

Change-Id: I049c4a43d73fbbec482909219adc9738c97cab82
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.

This change is done to reduce the composition time for 8x55

Change-Id: I89ab1d60b23eef55442a9fd338b2a05b3304ce61
native: Add dock battery support

Dock battery patchset chain:
base: http://review.cyanogenmod.org/#/c/55349/
native: http://review.cyanogenmod.org/#/c/55028/
healthd: http://review.cyanogenmod.org/#/c/55029/
settings: http://review.cyanogenmod.org/#/c/55212/
tf700t: http://review.cyanogenmod.org/#/c/55030/

Video (battery styles): https://www.dropbox.com/s/a7dp3glb7lv1zcg/dock_sdcard01.mp4
Screenshots:
 * No dock: https://www.dropbox.com/s/2yvngdaqok32xiz/dock_sdcard01.png?m=
 * No charging: https://www.dropbox.com/s/ezghtgoedei17oj/dock_sdcard02.png?m=
 * Docked no charging: https://www.dropbox.com/s/7fasc05fw5ylfxi/dock_sdcard03.png?m=
 * Docked charging: https://www.dropbox.com/s/x37vrhxzd075f7p/dock_sdcard04.png?m=

Change-Id: I5f1431736cd6d6d2f6c593881323d3efb5db6b3f
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
add support for buffer_size

Change-Id: I09146cc08ea7ba51cc85a3adac40fb8cfa4ae321
BatteryService: Restore the original parcel order

Append the dock extensions to the end of the parcel to preserve
compatibility with the original parcel format.

Change-Id: Ib4fa8473fcab9882d41bd9f9617af163154290ab