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: 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
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: Stub virtual display implementation

Close any fences we receive for virtual displays.

Change-Id: I1a039f560d9d6c9d2b41ddbad2007d1da9113abe
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: 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: 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
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>
gralloc: Mark buffers used by HW Texture

Consumer of gralloc buffers need to distinguish between buffers
with different usage flags, such as HW_TEXTURE vs VIDEO_ENCODER.

Change-Id: Idc330390c184ea942c096b84d29afe7705c06e4d
gralloc: Set correct private gralloc format for video buffers

For IMPLEMENTATION_DEFINED pixel format, if the usage flag is
HW_VIDEO_ENCODER, the private gralloc format should be
HAL_PIXEL_FORMAT_NV12_ENCODEABLE.

Change-Id: I61e8aabe124179e8bebda5d50ad1d8681060b99a
hwc: Disable fake vsync

Disable fall back to fake vsync even when the vsync timestamp is
invalid.

Related-to-bug: 8804359
Change-Id: Ia8fba19ce1bd0635985c6414bbcbd97b76054ebf
Signed-off-by: Iliyan Malchev <malchev@google.com>
hwc: Make sure vsync is enabled after unblank

Make sure the unblank call is completed before vsync is enabled.

Related-to-bug: 8804359
Change-Id: I18e4c3e6c3942cd325e85d99859135562748b0c4
Signed-off-by: Iliyan Malchev <malchev@google.com>
hwc: Do not close fd when vsync read fails

Related-to-bug: 8804359
Change-Id: I7495c03910a57c2e2090fac6d7ba203de556a0b1
Signed-off-by: Iliyan Malchev <malchev@google.com>