hwc: Add debug logging for fps

This is indicative of how many frames are posted to the display
by SurfaceFlinger. Set debug.gr.calcfps to 1 and restart the
framework to enable.

Change-Id: Ic503c14380fd7d8a5b062aa5da0d61bfc3991cb2
CRs-Fixed: 462010
libgralloc: Set the Adreno raster mode as "unknown"

Set the raster mode as "unknown" when calling libadreno_utils to
compute the surface stride. This allows libadreno_utils to decide
the best stride to pick up based on the specific GPU.

Change-Id: Id88f5887168564398492ab03d160ddd0ce5e083a
hwc: clean up overlay on external display blank

- On suspend, SurfaceFlinger calls hwc_blank on primary and
  external separately, inbetween these calls there might be a
  update, which leads to acquiring overlay pipes for external
  which will not be cleared and results in showing up stale
  frame on external display
- This change clears all the overlay pipes used on every blank

Change-Id: I44d62b7d0fcd992cf8a26bb0c21df77952bc1381
CRs-fixed: 464070

Conflicts:

	libhwcomposer/hwc.cpp

Conflicts:
	libhwcomposer/hwc.cpp
hwc: Reduce blank/unblank logspam

This is logged in the kernel and if there are excessive delays,
logged in the PowerManager.

Bug:8485194
Change-Id: Ia83b186ccae1fb6de59f200faf28346f84d832b6
hwc: Configure pipe for FB even if we exceed max layers

Even if we exceed max supported layers, configure pipe for FB
Because FB contents are always displayed using hwc

Also some minor code fixes

Change-Id: I740ab7e908c916373b1d87facd831e09098ce753

Conflicts:
	libhwcomposer/hwc.cpp
hwc: Ensure borderfill pipe is setup only after unblank

MDP operations should not be done in blank mode. Ensure that the
borderfill pipe is configured in prepare which happens after
unblank.

Change-Id: I97e75ab732015e0f02d12a24af37e4ed86b6b090

Conflicts:
	libhwcomposer/hwc_mdpcomp.cpp
	libhwcomposer/hwc_utils.h
libcopybit: changes from cm-10.2 qcom/display

Change-Id: I3673b0769417bebfe4106dc2702e6cc4adc7ceeb
gralloc: Mark buffers used by HWC

Some clients need to distinguish between buffers going to HWC
for composition and other regular buffers.

Change-Id: Ia05a765afe2f8bd223f3e47edd0fb746d6ade531
overlay: MdssRot: Clear orientation values in setTransform.

We cleared the values after MSMFB_OVERLAY_SET, which could cause dumpsys
to not show them.
Clear the values in setTransfrom, before applying incoming values.

Change-Id: Icf2244a0ea7f2cae5d8f1b8c5e2f4cbecbe3ce3f
hwc: Allow MDP composition for Secure playback

    Allow MDP composition for Secure playback.
    Handle non-secure scenarios like
      1. When secure mode is enabled, if HWC receive a non-secure video
         layer, fallback to GPU.
      2. When non-secure mode is enabled, if HWC receive a secure video
         layer, fallback to GPU.

Change-Id: I7fba414e4dfbe9a87de3ce1e5e07f601bbccd5bd

Conflicts:
	libhwcomposer/hwc_mdpcomp.cpp
hwc: Add support for plane alpha

HWC 1.2 API passes down the plane alpha and the blending
operation to apply. Pass this information to the MDP.

Change-Id: Ie191b7414b7100a951a33c02291d8f5b7dab7645

Conflicts:
	libhwcomposer/hwc_utils.cpp
hwc: Stub virtual display implementation

Close any fences we receive for virtual displays.

Change-Id: I1a039f560d9d6c9d2b41ddbad2007d1da9113abe
hwc: Conditional checks for B-Family

Rotator sync support and plane alpha are not yet implemented
for B-Family targets

Change-Id: Ic21c2f13ab92c1b995b1a492463bf066ae15852d
hwc: provide retire fence for virtual displays

The frame retire fence is also used as the outbuf release fence. HWC
has to provide a fence that won't signal until the virtual display
consumer (e.g. video encoder) can safely read from the buffer. Since
HWC doesn't read or write the buffer currently, it now just passes the
outbuf acquire fence back out as the release fence, so the consumer
will wait for GLES compositing to finish.

Bug: 8316155
Change-Id: I55868ac8ad0ec7eba8218820c960281a5711b8e1
gralloc: Add support for "RAW" and "BLOB" formats

The allocation is done as specified in system/graphics.h
Raw formats are 16 bit and aligned to 32 bytes, blob formats have
a height of 1 and the size of the buffer is equal to the width.

Change-Id: If762a34dde3b78f138689ced1077c9529020ebf0
gralloc: fix gralloc module

Explicitly setting reserved (in C++) breaks future extensions of the
module format.  Removed these explicit settings for future
compatibility.

Change-Id: Ia7fa1e1ff73114a6eacb5b228e81ef1c30c32f43

Conflicts:
	libgralloc/gralloc.cpp
gralloc: Add missing break statement

Change-Id: I5ac1b5d504a0d6d026c3cf8f73c5be99426f7e0f
Signed-off-by: Ed Tam <etam@google.com>
hwc: Use HAL tag along with graphics for trace

Bug:8733227
Change-Id: If1b1c9be17977b69146bbdd7f46a182e9d8ab879
hwc: Add DMA pipe support in MDP composition.

This change adds support to MDP composition to use DMA pipes when
layer scaling is not needed. Also makes sure not to invoke
MDP rotator when DMA pipes are configured since MDP rotator will
expect both the DMA pipes to available for performing rotation.
In such cases, we let the first frame of rotated video frame to
fall back to FB.

Change-Id: I3c3697dd2713ce9b86ba1e23192ec5841abd25ec

Conflicts:
	libhwcomposer/hwc_mdpcomp.cpp
	libhwcomposer/hwc_utils.h
hwc: Implement mixed mode composition.

With this change we are moving  MDP composition from all-or-nothing
implementation to mixed mode implementation where layers can
partially be composited through MDP and while rest of the layers are
composed / cached in framebuffer.

        - Mixed mode design is based on layer caching
        - Mixed mode path is configured only when non-bypassing
          layers are cached.
        - Never allow mixed mode when FB needs to be  udpated.
        - If we cannot bypass all MDP comp marked layers, bail
          out completely.

Change-Id: I8cafc35e5bf349fa72572936a5724aee65d056df
Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
Signed-off-by: Iliyan Malchev <malchev@google.com>

Conflicts:
	libhwcomposer/hwc.cpp
	libhwcomposer/hwc_video.cpp