liboverlay: Check for target specific flag for older platforms.

Venus color format is not supported on older platforms so add
check for target specific flag.

Change-Id: Id215f3a609ed4ebfff7b26bbbd05b727dc374694
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: 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
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: 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.cpp
	libhwcomposer/hwc_mdpcomp.cpp
	libhwcomposer/hwc_utils.h
gralloc: Enable framebuffer memory mapping.

Enable mapping from framebuffer if debug.gralloc.map_fb_memory
is set to 1. This is useful for bringup.

Change-Id: I3c860148729c5f5c98d84bf17e6633285b4b0af1

Conflicts:
	libgralloc/framebuffer.cpp
	libgralloc/gpu.cpp
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: 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: Fallback to GPU if source image width or height is less than 2

There is h/w limitation when MDP_OP_SCALE_RGB_ENHANCED bit and
MDP4_OP_SCALEX_EN or MDP_OP_SCALEY_EN bit is set.
The minimum block size is 2x2. MDP will hang if the source RGB image
height or width is equal to 1. Hence fallback to GPU in such cases.

Bug: 8744080
Change-Id: I7333b097fd26bfb888865de9c39d1664bc87acca
CRs-fixed: 477581
Acked-by: Sravan Kumar D.V.N <sravank1@codeaurora.org>
hwc: Check for mdp max downscale.

Check for MDP's max downscale limit before using MDP for composition.
MDP 4 can downscale in each direction upto a factor of 8.

Bug: 8744080
Change-Id: Ib9f640a6b1db3ba6244eb665a060f624425b4841

Conflicts:
	libhwcomposer/hwc_video.cpp
Revert "hwc: Check for mdp max downscale."

Reverting this temporarily, since the wrong version of the initial patch got
merged.  A subsequent commit will reinstate this change.

This reverts commit afd8f9718bdcef7097dd630137f8ae274e9b72ca.

Change-Id: I3ebbae4d69c53d75516dcd8b0080109d0a3e5786
Signed-off-by: Iliyan Malchev <malchev@google.com>