Fixed sample video corrupted in MediaCodec mode.

Change-Id: Ibe11a83199f3db1ba6266a1a9e11c7fc24ceb554
related-to-bug: 6732061
merge in jb-release history after reset to jb-dev
Merge remote-tracking branch 'upstream/jellybean' into jellybean-cm
native: use standard cm qcom ifdef

Change-Id: I35d7ba187a46af840253ec5b5c93df888546ce65
SurfaceFlinger: update sourceTransform in hwc_layer_t

set the sourceTransform in hwc_layer_t to the bufferOrientation,
which will be used for setting the orientation on external display

CRs-fixed: 387357
Change-Id: I7ae6a818001eb41a9209dea166dc9232de182fe5
(cherry picked from commit 608db1fa7aa4dee3fc0359bd5686a74e2dfc9d40)
frameworks/native: SF: Adapt vertices to GL co-ordinates

Adapt co-ordinates in drawWormhole() from display co-ordinate system to
GL co-ordinate system.

Change-Id: Id25a9e63c38ceb242f6d67eaca9e88cb95aead42
CRs-Fixed:382824
Merge remote-tracking branch 'upstream/jellybean' into jellybean-cm
SurfaceFlinger: Removal of NO_RGBX_8888 flag for OMAP3

Removing this will allow color format of surface to be set for RGBX8888
that can improve performance for 32 bit framebuffer.

Tested on Nook Color with CM10
TI's commit can be found here:
review.omapzoom.org/#/c/21374/3

This will also remove the need to have BOARD_NO_RGBX_8888 := true
in the BoardConfig.mk

Change-Id: Ibc6e56c992a6433bc8688d88471d4feb9084278c
libgui: Add support to update buffer geometry.

Add native window properties NATIVE_WINDOW_UPDATE_BUFFERS_GEOMETRY
to the perform function of SurfaceTextureClient and SurfaceTexture
to update the width, height and format of the buffer dynamically
from the client before queue buffer call.

Change-Id: I62447fcf523b507d534085cd0835f55a978c4ead
Fix gralloc private flag for video playback

Change-Id: I5247adffd528fbabbe57de56e1ac1e5ae74662af
i9300: Clean up a bit usage flag hack

Change-Id: I355375e5d65381b4a256dbf934dacf6b2b935b98
frameworks/native: Add support for copybit in Surfaceflinger.

  - Use qcomuiclearRegion to punch hole in FB if using
    copybit composition
  - Skip GPU drawing if layers are flagged for copybit
  - Consider copybit composition while counting for
    layers updating FB

Change-Id: Ieb2937d276a5018916961b43850898066a15c17e
Merge "i9300: Clean up a bit usage flag hack" into jellybean
Merge remote-tracking branch 'cyan/jellybean' into jellybean-cm
surfaceflinger: Fix ifdeffing

 * Fix bad ifdeffing from QC BSP code.

Change-Id: Ibd188c16fc6e95ee70dd13381db5406449c33c4d
Merge branch 'jb-release' of https://android.googlesource.com/platform/frameworks/native into aosp
exynos: Apply format usage flag hack to YUV420P

This is needed for planar format video in
addition to semiplanar.  Also, update the flag
to be more representative of what it REALLY does,
which is merely to add GRALLOC_USAGE_HW_FIMC1.

This fixes Netflix on Note 10.1 so it no
longer needs Developer Options hacks.

Change-Id: I31df87c252779e66a056b79b1f48779024ec0f30
Merge remote branch 'cyan/jellybean' into jellybean-cm
Fix shutdown sequence to avoid SIGSEGV when running am command

When the app_process is shutting down the main thread will close the
binder fd while pool threads are executing an ioctl (in
IPCThreadState::stopProcess called by AppRuntime::onStarted in
app_main.c).

The binder driver will then return all pending calls in ioctl
without any error and with a command. One of the threads gets a
BR_SPAWN_LOOPER which will create a new thread (the other thread
gets a BR_NOOP). This new thread then calls
vm->AttachCurrentThread. Usually this results in a log entry with
"AndroidRuntime: NOTE: attach of thread 'Binder Thread #3' failed",
but sometimes it also causes a SIGSEGV. This depends on the timing
between the new thread an the main thread that calls DestroyJavaVM
(in AndroidRuntime::start).

If IPCThreadState.cpp is compiled with "#define LOG_NDEBUG 0" the
pool thread will loop and hit the
ALOG_ASSERT(mProcess->mDriverFD >= 0) in
IPCThreadState::talkWithDriver.

Crashes like this has been seen when running the am command and
other commands that use the app_process.

This fix makes sure that any command that is received when the driver
fd is closed are ignored and IPCThreadState::talkWithDriver instead
returns an error which will cause the pool thread to exit and detach
itself from the vm. A check to avoid calling ioctl to a fd with -1
was also added in IPCThreadState::threadDestructor.

Another solution might be to change the binder driver so that it
returns an error when the fd is closed (or atleast not a
BR_SPAWN_LOOPER command). It might also be possible to call exit(0)
which is done when System.exit(0) is called from java.

Change-Id: I3d1f0ff64896c44be2a5994b3a90f7a06d27f429
Fix error trap in SurfaceTexture Client

There was an issue in Surface::lock where failure to lock a surface
resulted in two bad things happening:
- success was returned to the caller (it was apparently locked).
- an uninitialised pointer was returned as the buffer.

Change-Id: I8b0df81400e0fa0542a8bb993d76923ac96b686e