bootanim: Don't cache textures if they're expected to use a lot of VRAM

bootanimation cached all the textures generated until the animation
was completed.
For Hi-res animations with lots of frames (like the new CM9 anim on
xhdpi devices), this implied using large amounts of video RAM, more
than most devices actually have available, causing the animation to
stall (and in some cases, gralloc to lock up); so if an animation is
expected to use a lot of RAM (rough estimation based on frame size
and number of frames), disable cache entirely and generate the textures
on demand

Change-Id: I157e5cdde2aab1d82d980d77cbedd9f127c83a1d
profiles: Fix "disabled" lock screen mode

Without this fix, it's impossible to select the "Disabled" lock screen
mode.

Change-Id: I214f52093d78631f799a604394e838a4b329494a
Merge "bootanim: Don't cache textures if they're expected to use a lot of VRAM" into ics
libagl: Allow use of copybit to accelerate 2D rendering

This improves performance on devices that uses copybit.
Enable with TARGET_LIBAGL_USE_GRALLOC_COPYBITS := true

Forward ported from Gingerbread

Change-Id: I271fd87ccca4b6574d1b018a00f41b673d0f4211
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
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
DisplayHardware: Set MDP composition flag correctly

Change-Id: Id0c7172fe8578f3eb26bbe10a448a96fee1d72cd
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
Electron Beam Animation (1/2 Frameworks)

Change-Id: Ia6e67983008eca505cead7cd4cb196627f5e2f77
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
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
clean up code where QCOM_HARDWARE and SAMSUNG_CODEC ifdefs meet

Change-Id: Ie0157e6816b573cba72dae0f89f312848ba09ae5
update header location to match CyanogenMod vendor/qcom path scheme

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

Change-Id: Ic45cd5c916bfe9efac9a483ea7faa2638e04aef8
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.
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