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.
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.
Fix 'Avoid Binding Texture' logic in SurfaceTexture & SurfaceFlinger

CRs-fixed: 335449
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.
DynamicMemoryManagerService: Add DMM functionality.

Call Power API's to switch unstable memory between Active/Disabled states.
DynamicMemoryManagerService: Use Wakelock to Prevent Suspend.

Use Wakelock to prevent Suspend from being attempted during PageMigration.
DMM Service: Offline Memory only if DMM is enabled.

Add a check to see if DMM is enabled before the request to turn off unstable
memory.
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
Fix file references in comments

Extremely low hanging fruit, but change the refs in the comments to
point at the correct file. This may help someone else having to go
look for the correct file.

Change-Id: I60f9adea1b37c49265b37199278182873844385e
SurfaceFlinger: Fix surfaceflinger crash when showing screen update

With selecting 'show screen update' option under Setting/Developer
options, there's crash in getYUVBufferCount() in Hwcomposer.cpp.
This occurs because the handles of hwc_layer_list have invalid
values that are passed from HWComposer:createWorkList().
Initialized hwc_layer_list after it is allocated.
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
libs/rs: Fix parameter swap in rsAllocation

This change swaps index and size parameter in rsAllocation calls as
Google's comment suggests
libRS: release last surface reference when shutting down GL
framework/base: Change to enable mm-parser.

- mm-parser related enums are added in framework
- adding ExtendedExtractor module to plug-in mm-parser with framework
- adding MIME type that are supported by mm-parser

Patchset 1: Add QCOM_HARDWARE ifdefs.

Change-Id: I06b330275605a84668c6690570805892eb2b17d0
Signed-off-by: Evan McClain <aeroevan@gmail.com>
framework/base: Add customized parameters for camera features.

Patchset 1: Add QCOM_HARDWARE ifdefs.
Patchset 2: Don't need to ifdef snprintf over sprintf.

Change-Id: Id39c71976823ad18627f1e14d1b5e2fd0597c82e
Signed-off-by: Evan McClain <aeroevan@gmail.com>
stagefright: Additional types for Colorconvertor

- Define structure and enums to be used by stagefright
  to interact with mm-color-convertor library

Patchset 1: Add QCOM_HARDWARE ifdefs.

Change-Id: If2a01e3255b8e108f4559e016f31e6195976476a
Signed-off-by: Evan McClain <aeroevan@gmail.com>
f/b: missing qcom ifdef