hwc: Use rotator for resolution change for all display

Rotator need to be used when resolution change happens for
primary or external display to avoid flicker or page fault.

Change-Id: If4b584c7afb7d2265b1efd7c320ac76ade199b74
hwc: send layer with non-contiguous buffers to GPU

when layer containing non-contiguous buffers are send to MDP,
flickers are observed

Conflicts:
	libhwcomposer/hwc_mdpcomp.cpp

CRs-Fixed: 624456
Change-Id: I4bcea959bd4849028368316aae39d1b0b17fa5b3
hwc: Do not use C2D composition for plane alpha

When C2D is used for plane alpha and immediately falls to GPU
   results in flicker for difference in composition

Change-Id: I2ae43c6ed22c829e952a0a4edee7f83c24645172
hwc: hwc_sync - populate correct fences for BLIT

Previously, the acquire and release fences for BLIT
composition were populated using same logic as Overlay,
but BLIT composition consists of separate BLIT step
before screen refresh, and app buffers are no longer
required after BLIT. So holding the buffers for both
the steps is unnecessary and impacts performance.

This change adds condition for BLIT in fence population
logic in hwc_sync and populates the right fences for the
App Buffers and Display Refresh during BLIT composition.

Change-Id: I9998a7052c0375acb32a174bdf0469d2a88f79e8
hwc: Correct Display Commit sequence during WFD-HDMI interaction.

When WFD is active and HDMI is plugged in, the pipes allocated
to WFD(mixer 2) are unset. Call Overlay-commit on mixer 2 to
unstage the pipes correctly. This also makes sure that a secure
WFD session is teared down correctly.

Change-Id: I7531339148e400727549decbde72096f2a7dd798
hwc: Reset previous width and height

If the current YUV count is 0 previous width and height
needs to be reset.

If FLIP is required then do not use rotator for resolution change.

Change-Id: I601cee2eddcf304b9c94d3def19d603c04b18ceb
libhwcomposer: Don't reset cached layer handle on MDP comp

Layer handle values will always be stored irrespective of the
composition type. Layer caching will choose a layer for FB
composition if it's handle has not changed.

Change-Id: Ied42d6ecafe48a9240aacc2d172b7d81b0d42a5d
Don't force GPU composite for older devices

Older devices (8960) don't take this very well in programs like
Netflix. Modeled on 94b8632b85e2b6588a1b3260d1f4e48462501d4b

Change-Id: Ie716bbfb6f6560d8f9f52b7b72ca0b04d1bad6b8
liboverlay: do not return error if fb num >= 2 doesn't exist (writeback).

Some devices doesn't have writeback support, but needs HDMI (fb1)
This will allow them not to break HDMI support.
This is a cleaner implementation as it won't change handling on
8660 devices having writeback (if those exists).

Change-Id: I6c09759dfa4f2b1734f85012cab4eb4f350820ea
hwc: Blank and unblank primary on first boot

Change-Id: I246858f216d58e2e96a1faf1afac60372f3ddcab
overlay: Allocate from MM heap as a fallback

 * Not all devices support IOMMU yet, so use the MM heap as a fallback.

Change-Id: I9d9f3dffb92f5b4bf45422df0f66a40611943202
hwcomposer: Use RGB_BORDERFILL only on MDP 4.2 and higher.

MDP 4.0 does not support RGB_BORDERFILL and causes the display to fail
initializing.

Patch Set 2: Actually set MDP_RGB format if not BORDERFILL.

Change-Id: Ib2007221c4dc78fd17ced97c0a0d28896c877b80
gralloc : Don't fallback to system heap for framebuffer allocations

MDP can not handle buffers from system heap, so try camera heap
first, before falling back completely to system heap

Change-Id: I7e2ab0094be5d1075be1ca93295cf54b84101835
display: Cover NO_IOMMU for msm7x30 too

Change-Id: Ic68672f386a06fd0ac9fd1f18eec3188415a8642