surfacetexture: 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

use BOARD_ADRENO_DECIDE_TEXTURE_TARGET := true in Boardconfig

v2: fix for BufferRejecter added in JB

Ported from CM9.
https://github.com/CyanogenMod/android_frameworks_base/commit/82876a4d5f62cbbeb86c5ee8406f8864f201d061
https://github.com/CyanogenMod/android_frameworks_base/commit/417d89259effb373c0c3a411b7a7d1f7f75b2eb2
https://github.com/CyanogenMod/android_frameworks_base/commit/2961a0f0d63285caed48ea1d2573db347ffeb5ab

Also thanks to erikcas:
https://github.com/Jellaxy/android_frameworks_native/commit/1fb8eba0a8de3852555db48c25a9c0de65f2a75d

Change-Id: I775e3a67df9f2aa0b6352634b863590503716d0d

Signed-off-by: Peter Gregus <pete.gregus@gmail.com>
frameworks/native: surfaceflinger: Do not wait for vsync for MDP Composition

SurfaceFlinger waits for next vsync cycle if a frame
is available from client. For MDP 3.0 targets, we wait
for vsync cycle in every composition step. If a frame
if available from client just after vsync, we would delay
it showing on display by one vsync cycle also making client
wait in DQ. As MDP composition waits for vsync, remove wait
for vsync in composition step when in MDP Composition.

Change-Id: If0054e8efc9fcfb8c621f45f130e054a799703c4
libs/gui: Update TRANSFORM HINT from BufferQueue

Read TRANFORM HINT value from Buffer Queue rather than STC.
STC's hint will be updated only when QueueBuffer is called.
So any query from client for hint in between two DequeueBuffer
call will read wrong value.

(cherry picked from commit 0618a92c24576e104043d139aaf92ecec2c0df88)

Change-Id: If3a244207e0584ee417deb36d357fe0ab7c1a96d
SF/HWC: Disable Vsync for copybit layer only

(cherry picked from commit a546a9970674730e734fbf2fd59982c746b73667)

Change-Id: I09a71927e55c95c790e92ed9bce88447d59be267
surfaceflinger: Add all display connections to connection list.

1. Revert "surfaceflinger: Remove deadlock condition."
   This reverts commit 3924ab90a956b15610f45e229e051756c94ba1b8.
2. Add all display event connections to connection list to avoid
   deadlock condition.

Conflicts:

	services/surfaceflinger/EventThread.cpp

Change-Id: Ia65e217a5130572d0724d3c4fd9f2e962c0ffb50
(cherry picked from commit 5aec1edc1f4fa0562d379b5c85a1c9de943b7087)
CRs-Fixed: 421346
ST_ERICSSON: Adding suport for native pixel formats

- Add support for ST-Ericsson native pixel formats and conversion to
    and from these formats.

adapted from http://review.cyanogenmod.org/#/c/29600/

Change-Id: I8eb6dec59fc0c862590641e7fed7742a3491a155
FM Radio: Add support for FM Radio in Android

moved permissions to frameworks/native

Change-Id: I27ded70f7bc116a1b1c9cff2383c4899afe746ec