graphics: Add directives for compatibility with older EGL blobs (2/2)

Port from CM9.
Original author Ricardo Cerqueira
https://github.com/cyanogenmod/android_frameworks_base/commit/fc496c0607d0d2863ff9587019e890ab806ea49d

Change-Id: If30f10f1d4b26547d1219e2ba05f6a831b8fbff8

Conflicts:

	libs/ui/GraphicBufferAllocator.cpp
surfaceflinger: Retain support for legacy graphics (1/4)

This fixes errors when booting. If triple buffering is enabled
on a 2.6.35 kernel with an irregular or old graphics system
(such as an MSM7x27 phone) then it will give errors about
surfaceflinger not finding the file or directory and hence
enters a nonstop bootloop in which it tries again and again to
find and open the gralloc, hwcomposer and copybit libraries.

To use this fix, insert the following lines in your BoardConfig.mk:
COMMON_GLOBAL_CFLAGS += -DUSES_LEGACY_GRAPHICS
BOARD_USES_LEGACY_GRAPHICS := true

Change-Id: I50ed9ad7e785ef009e63b099c25928685f7ccd73
Merge remote-tracking branch 'cm/jellybean' into jb-dev
Merge remote-tracking branch 'cm/jellybean' into jb-dev
surfaceflinger: Show layers using copybit in dumpsys

Change-Id: I13b6e5d77546885d45e25fed92b86456c714855e
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

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
Merge remote-tracking branch 'cm/jellybean' into jb-dev