SurfaceFlinger: Set the buffer size in the GraphicBufferAlloc

When setting the buffer size, store the required size, and allocate
the buffer of the required size in GraphicBufferAlloc, instead of
SurfaceTexture. We do this because SurfaceTexture does not always
run in the server process space. GraphicBufferAlloc always runs in the
server process.

Change-Id: I53661d8a9a27f9974837f2ed2fe13facf8dd8d9c
SurfaceTexture: Avoid binding texture if format not supported in GPU HW

Certain formats may not be supported in GPU HW. For them, avoid binding
textures. When the textures created from surface flinger, they may not
be needed if we are not using GPU composition.

Change-Id: I3eda6aa419dcef3d19f844d620d4c89236a6a714
Fix 'Avoid Binding Texture' logic in SurfaceTexture & SurfaceFlinger

Change-Id: I32de5ddb77e339b3749379804233c0772d29c983
frameworks/base: Add cpu governor service

Increase sampling rate when the display turns off and set it
back to the original value when it turns back on. This helps
reduce power consumption for use cases such as MP3 playback with
the display turned off.
frameworks/base: Vote to turn off io_is_busy during recording.

When recording starts, vote to turn off io_is_busy. After
recording stops, take out that vote so that io_is_busy can
go to its original value. Doing this saves power by reducing
the amount of time for which the CPU runs at high frequencies
when encoded data is being written to the SD card - a process
that causes io_wait times to shoot up. With io_is_busy turned off,
these wait times will not be considered as CPU busy time and so
the ondemand governor will not unnecessarily bump up the clock rate.
The votes are handled by the CpuGovernorService. Also move the
dynamic sampling rate and vote processor classes out of the
CpuGovernorService to improve modularity.
frameworks/base: Remove dangling reference to dynamic memory manager

This removes instantiation of dynamic memory manager, which
should not be included in the cpu governor patchsets.

Change-Id: Id9a22084e767f1cacce7e00e6d2228a3684dbde4
binder: add support for Ion

Add classes to allocate from the Ion memory manager.
binder: Get rid of old flag

MAP_LOCKED_MAP_POPULATE is an outdated flag that is not used
anymore. Get rid of this flag in MemoryHeapIon
DisplayHardware: Set MDP composition flag correctly

Change-Id: Id0c7172fe8578f3eb26bbe10a448a96fee1d72cd
Remove opaque check in GLRenderer when preparing dirty region.

Since preserved swap is enabled, we need to clear the color buffer
when the scissor rect is prepared for a new process. This prevents
garbage to be present from the previous process in the color buffer

Change-Id: I72b7154c52affecfd6bf50889062b1769042d5d9
CRs-Fixed: 320345
libs/rs: Fix parameter swap in rsAllocation

This change swaps index and size parameter in rsAllocation calls as
Google's comment suggests

Change-Id: Id14ba3de342c8b0ec27fb8b62f3993d8f7e21e46
CRs-Fixed: 320824
libRS: release last surface reference when shutting down GL

CRs-fixed: 329203
Change-Id: I42f9f652912367ef7ed8a007dd330b66c0167abb
Temporary commit for working qcom OMX decoding

Testing for H/W video decoding support.

Added QCOM-specific bits to cmds-stagefright.

We now have full 1080p hardware video acceleration!

frameworks/base/nuplayer: Fixes to enable HTTP live streaming

- Enable QCOM specifc color formats in ACodec
- Do not skip lines without /n, in M3U Parser
- Stop scanning sources until reset is handled in NuPlayer.

Conflicts:

	media/libstagefright/ACodec.cpp

frameworks/base/NuPlayer: Handle Seek from NuPlayer

- Seek was handled by the source by queuing discontinuity events
  individually for each stream.With this approach renderer will
  continue till discontinuity events are handled for each stream
- With the new approach seek is handled by the player -
  - get the new seek time from source
  - flush the source TS segments in LiveDataSource, access units
    in TS Parser, decoders and renderer
  - notify current position to driver
  - LiveSession will not queue a discontinuity for seek.
- Add a mutex lock for connect & disconnect ChromiumHTTPDataSource
- Handle flush in ACodec - Idle to Executing & Loaded to Idle states

Conflicts:

	media/libmediaplayerservice/nuplayer/NuPlayer.cpp

frameworks/base/nuplayer: Support for dynamic port reconfig in HTTP Live

- BW switch is detected by the decoder by a port reconfig event
  instead of a discontinuity event
- Handle port reconfig dyanamically in ACodec
  Steps are - Flush - Get all buffers back - Disable - Enable
- Handle PID change in TS Parser - Set PID based on stream type

libstagefright: return proper color format on target basis.

 Video preferred Color format is different for different targets.
Add a method to choose the preferred format for each target.

Conflicts:

	media/libstagefright/ACodec.cpp

httplive/ACodec: Enable smooth streaming

- Use property to enable - hls.enable.smooth.streaming
- Set component in smooth streaming mode by doing a setParameter
  with OMX extension for SS
- Handle Port Reconfig Info event from component
- Whenever resolution changes do update buffer geometry on
  native window

Conflicts:

	media/libstagefright/ACodec.cpp

Conflicts:

	media/libstagefright/OMXCodec.cpp

Change-Id: Ia1c4f0d0ee9e3877eb4808a1524101bbd049434b
libstagefright: Fixed video thumbnail generation for QCOM devices.

StagefrightMetadataRetriever was looking for the wrong property to identify
Qualcomm devices. Changed from ro.product.device to ro.board.platform.

Since we use proprietary libmm-color-convertor.so from HTC Pyramid,
colorconvertor was also looking for the wrong symbol via dlsym.
update header location to match CyanogenMod vendor/qcom path scheme

Change-Id: Ia5120c4e23d35d27e3431e32308003fcbc8a6f67
clean up code where QCOM_HARDWARE and SAMSUNG_CODEC ifdefs meet

Change-Id: Ie0157e6816b573cba72dae0f89f312848ba09ae5
add Sc2k's framework hack to enable HTC bluetooth libs to work

Change-Id: Ic45cd5c916bfe9efac9a483ea7faa2638e04aef8
Electron Beam Animation (1/2 Frameworks)

Change-Id: Ia6e67983008eca505cead7cd4cb196627f5e2f77
remove accidental vim swapfile

Change-Id: I7132118fbe18da869a4dbc5d0f3bcb0b29b845d4
libstagefright: remove decrypt handle

Decrypt context will be created directly in decoder so remove the code
that was used to copy the decrypt context pointer from parser.

Change-Id: I1c5d3a588bf3e573f0f04426d6991008fe8b7bbe

Conflicts:

	media/libstagefright/OMXCodec.cpp