SurfaceFlinger: Invalidate HWC Geometry on buffer validity change

HWC layer's flags and properties need to be updated whenever the
properties of the layer change. This change adds support to update
the flag when layer's buffer validity changes.

CRs-Fixed: 334664

Change-Id: Ia785f58c8d89ebd18867c78d93f1733c82694435
(cherry picked from commit 242fc135f91e6967d0a37f6de78e6090643fa35d)
SurfaceFlinger: Handle WFD and HDMI concurrency

- changes to handle wifi display and HDMI concurrency
- rename enableHDMIOutput to enableExternalDisplay
- remove action safe related functions(not used anymore)

Change-Id: Ib7d9aa4472a4419c395728fec07f7f9827198bbf
libhwui: Correct transform used for drawing text-shadow.

The model-view transform used for text-shadow in drawText() should
be in sync with the transform used for main text draw.

CRs-Fixed: 342161

Change-Id: I6bb36691c84809aaede65ad5fc1c4a1e90f1ecfc
(cherry picked from commit d4c8be8416c6c3064e43ed80ebacb2a177be3019)
Revert "Select texture target based on pixel format"

Automatic revert was not possible.

Graphics team completed the optimizations for GL_TEXTURE_EXTERNAL,
and this change is no longer required in frameworks.

Change-Id: I8330d19e686b450d3fb6ca2d96c0615f16c0906b
CRs-fixed: 328074, 345078, 344565
SurfaceFlinger: Return the current transform value when queried

When an application queries the transform hint,
SurfaceTexture returns the value based on the previous
queueBuffer function. When query() is called before any
queueBuffer() calls, it doesn't return the current transform.
Make sure to get the current transform from a layer
whenever query() is called.

(cherry picked from commit d9668f53f8c41c16588531183f3ec8d6780b234d)

Change-Id: I635481ccd7d22148d2b7ab92f4e8c0c63ef7e715
Handling EGL_BAD_ALLOC egl error as return from swap

Some GL apps are not closing properly espacially while
forcefully closed.Cause unnessary swap command from
GLSurfaceView and returing EGL_BAD_ALLOC as error that is
not handling in GL thread and leads to uncaught exception

CRs-fixed: 335039
(cherry picked from commit 46cc8d1f506fabd04e3e192511ab715a22ff92ea)

Change-Id: I92d08b6328a0055687ad99b9413a97ec7025e0cd
HDMIDaemon: Store actionsafe width and height as a system property

(cherry picked from commit 9b6f55560bf5066ea4ba9670d2d009f2b6c36e3b)

Change-Id: I63c213c2f203e63c8047f597e33d06026085c0c8
media: stagefright: add msm8960 target support

Change-Id: I3967381264342895692c9fb67a68c41f01c9776b
Merge remote-tracking branch 'github/ics' into ics_chocolate_M8260AAABQNLZA30150
SurfaceTexture: returning the current transform value

Change-Id: I2975057f47b219ef1ebe73cb8ef85048dc22c784
frameworks/base: surfaceflinger: Enable dither if needed

SF is checking if dithering is required but not enabling it.
Enable for layer drawing and  also for screenshot for 16bpp
framebuffer only.

CRs-fixed: 333721
(cherry picked from commit 85c02ed97b4a1d0cc343a452959570b379928d59)

Change-Id: I599fe5b9683db208c8b32a1d3d395d5203f78fd3
Surfaceflinger: Add Src orientation for the layer

hwcl->transform contains the final transform, add source transform
to it, so that the source transform can be used for setting correct
orientation for Secondary display.

Change-Id: I9dd6ab9495991b01211711f55b9380a3a53cf0f0
CRs-fixed: 341691, 330719, 342199, 344308
(cherry picked from commit ec2226ef4e8c9bbf5d255d26f9677d7e36fc6ea2)
framework/base: Wait for EFS sync to complete

Wait for radio sync to complete before continuing with system
shutdown

CRs-Fixed: 349502
(cherry picked from commit c236978e95bee6957a8636d094d3b703c5cc22df)

Change-Id: I57d078f21d282b6a0ee86c8b9b1ac8bb6af9c1ab
Revert "SurfaceFlinger: Handle WFD and HDMI concurrency"

This reverts commit 68ac37dc87668d00a0b79f8dc99dea8ad2f18be0.
MemoryHeapBase: ifdef for gingerbread compatibility

Allow to "revert" by a board config flag the offset member addon
see commit f24c4cd0f20 (aosp change id Ie618fb5c0718e)

This change is required to use overlay based proprietary camera libs
coming from gingerbread and froyo builds.

This change also requires a global cflag named BINDER_COMPAT
because a lot of modules use the MemoryHeap includes

Add this in your BoardConfig.mk :
COMMON_GLOBAL_CFLAGS += -DBINDER_COMPAT

Change-Id: Ib0370fbf4c4770f8141607a8fc393639ffbdc8e2
SurfaceFlinger: Handle WFD and HDMI concurrency.

- changes to handle wifi display and HDMI concurrency
- rename enableHDMIOutput to enableExternalDisplay
- remove action safe related functions(not used anymore)

Change-Id: I15feb1309c2964de3deb968c334eb09e742afb6c
frameworks/base: fix delay in HDMI update

SF threadloop now checks for dirtyregion and returns
if it is empty. Mark dirtyregion as nonempty so that
threadloop actually executes when required

Change-Id: I00e132433922509468b258c33279c819b3294d73
CRs-fixed: 327432
frameworks/base: capping live wallpapper fps

CRs-Fixed: 343813
(cherry picked from commit a3343a04940bcd31d1a9992336ab178777fd0ff9)

Change-Id: I46b805f8cf74995a744eb6c9e0cd0d593d3af3b9
Fix a couple of nasty heap corruption bugs.

- When replacing the buffer pointer with another one, the allocated
  length wasn't updated. As the TI encoder relies of those being matched
up (it e.g. does a memset(pBuffer, 0, nAllocLen) at certain places), this
could lead to random memory being overwritten (or to a segfault when
reaching the end of the mapping)
- When replacing the buffer, the old buffer wasn't saved and restored
  before calling freeBuffer. This led to a different address passed to
free() than was returned by malloc(), could lead to all kinds of weird,
undefined behaviour.
Browser sets up the min freq while scrolling

CRs-Fixed: 341058

Change-Id: Iee9067113819fe2bfc28740b919f5cd44cc2a5bd