add GRALLOC_USAGE_PRIVATE_UNSYNCHRONIZED for explicit synchronization.

Change-Id: I3d78f0517f7eeafc58ec5b0edfc6a04901ad48b2
(cherry picked from commit 35229ceb772a4a3c0a9dbfcb42fdb45344a91b4e)
libgenlock: Remove the call to GENLOCK_IOC_RELEASE.

The GENLOCK_IOC_RELEASE ioctl is now deprecated. This was done because to
avoid race conditions where the handle was released before another client
tried to unlock it.

(cherry picked from commit d1514357422ce130d3e2776f984294a9efeea83e)

Change-Id: Iaf433a79dd0dad992cbf67180765718beec4eb1c
CRs-fixed: 333141
libQcomUI: update isGPUSupportedFormat

update isGPUSupportedFormat to include all the S3D formats and
interlaced content.

Change-Id: I737ae2f282092de97bd1f945fb66bc6e8e3dda49
qcom/display: add true mirroring support on HDMI

Change-Id: I7e884e5dde2a08048a28610eb88760fcdd24d558

CRs-fixed: 316397
Make SurfaceFlinger respect swapinterval property

A Google modification to eglCreateWindowSurface was
causing SurfaceFlinger to set its swap interval
value back to 1, regardless of the value set in the
debug.gr.swapinterval property.

This patch modifies the fb_setSwapInterval function
in gralloc to check the debug.gr.swapinterval
property and not change the swap interval if a value
is set there.

CRs-fixed: 329524
Change-Id: I80463c1209addbff227db7832dd0023e94eb06ac
libhwcomposer: Mark all layers below the SKIP layer for GPU composition.

If there is a SKIP layer present, the SKIP layers are first composited
using the GPU. If there any layer below the SKIP layer that performs
any operations on the FrameBuffer, it results in undesireable results
on the screen e.g. artifacts, since SurfaceFlinger draws the SKIP layers
before the HWComposer.

Change-Id: I198236673e2a0bd19a6087ff01049061547abb47
CRs-fixed: 327392
libgralloc: Store the correct fd when mapping the framebuffer.

Store the actual and not the dup'd fd when mapping the framebuffer.

Change-Id: Ibca65a8f4c4db374dc23e8fee216ec5c36a9c01c
display: Add support for protected heaps

Change-Id: Id5ade8a0f261db41dfaab19dbe3593c1042a8041
display: Standardize debug logging for all memory types

Change-Id: I96c93b8925ea9b3da8214823a7f821e0760aa82d
libhwcomposer: Fix dynamic composition for 2 overlapping layers

This change allows composition to fall back to c2d even if the second
layer overlaps the base full screen layer.

Change-Id: I4818344fe1d0c3bc748635d139446f9402a5b23a
CRs-Fixed: 326413
hwcomposer: Enable dithering if FB format is  RGB565

CRs-fixed: 329362

Change-Id: Icc6f9a1184725fd110430b2815b40789428d159e
qcomui: Let the client decide the reallocation size

Always set the size the client wants, even if the
gralloc calculated size is larger

Change-Id: I31231f36ed0752db350d4fe62f8b04c7a84c6155
Display/libhwcomposer:Add intermediate stretch for low resolution clips

Copybit module has a limited stretch to scale a clip.
Hence we need to do a intermediate stretch before going
to final stretch.

Change-Id: Iedcfd5407299a8e34758dc6cd7586c19889488ff
hardware/qcom/display: Add debug feature to display FPS for both bypass,fb

Change-Id: Ib4991200db9bc64c823c57ed1fba43f836142957
Copybit: Fix for source x and y calculation.

The x and y coordinates are derived properly from clip and dest rect with this fix.

- Even if rotation is involved, we need to start reading from the same point.
- Do scaling operation on the delta, and then add the source left and top values.
- If we scale the result of addition, we will not be reading source correctly.

CRs-fixed: 324782

Change-Id: I2876c6a8e48acbf03f80713338f9a17c57863aaa
libgralloc: fix libgralloc error codes

Several ioctl calls were returning -1 instead of -errno,
which may confuse upper layers, especially when the error
is -ENOMEM.  Also move some existing "err = -errno" calls
to the top of if statements so that errno cannot change
by libc calls in the error handling code.

Change-Id: I5bef433d21cfc2ce79cea45f425f0659c5dce305
Revert "Bypass: Turn off only after FB content is displayed."

This reverts commit f2dbabe786a12e7e9ae15328550b5ba581c5492e.

This change is not needed any more because we are caching the MDP pipe
contents when closing the channel. So no need to wait for postFB finish.

Change-Id: Ia6f01c33953762cb7a97e0b2b795d9afeb60d2d9
libhwcomposer: Add support for 3 layer bypass

This change allows 3 or less layer use cases to get bypassed completely via MDP pipes.
If more than 3 layers, all of them gets composited on FB.

Intended FB fallback cases:
  1) 4 or more layers
  2) Any MDP pipe is in use
  3) Any layer needs rotation
  4) Any layer is allocated from non-pmem

Change-Id: Ieb2b30b8ab9893fd68c7fc61ec889ac9a01cb7dd
gralloc: Set total pmem size correctly

Change-Id: I53fa3dc6e6809cb294384f8e8eee218629c09353
libhwcomposer: Unlock video layers below the SKIP_LAYER

If there is any video layer below the HWC_SKIP_LAYER, we compose that
video layer using the GPU. Unlock any previous video buffer that were
sent to the overlay.

CRs-fixed: 333974
Change-Id: I1937ca8b139f40453a3bccb0b490fd4d65fa1f52