hwc: Handle WFD Pause/Resume usecase

During Pause event, set external pending state, there by
allowing frames to fall back to FB, closing all MDP pipes.
Resume event should be considered as a connect event.

Change-Id: I536ab9df7145bbb9081edd01168d3dcbc332f07e
CRs-Fixed: 452380
gralloc: Override gralloc calculated size only if bufferSize is greater.

bufferSize set using native window set buffer size will override gralloc
calculated size only if bufferSize is greater.
Fix for 720P, 1080P HD content playback is not working on 7x27A due to
buffer size mismatch between requested size by frameworks and allocated
size by gralloc for HAL_PIXEL_FORMAT_YCrCb_420_SP and
HAL_PIXEL_FORMAT_YCrCb_420_SP format

Change-Id: I16d04e406ab8f1f35e0e0a70e19d99a019adc5ef
CRs-Fixed: 451783
hwc/overlay: Video on 4k2k external, 4k2k rotation.

-Add support for Video via overlay on 4k2k external panel.
-Add support for rotating videos on 4k2k panels. We use
pre-rotation in hwc to rotate a video into a single buffer,
irrespective of panel size. Then this buffer is fed to MDP.
Rotator objects are managed by the new RotMgr.
-Cleaup mdpcomp and overlay.

Change-Id: Ifb08534747e8e18b6c58dd8a3e1a9947409100f1
qdutils: Retrieve MDP revision and pipes information from driver.

Userspace can retrieve MDP revision number and number of different
types of MDP pipes (RGB,VG,DMA) information from driver. Add target
specific flag as previous MDP versions do not provide this support.

- Make use of this information while maintaining PipeBook.
- Move PipeBook related functions from overlay utils to PipeBook.

Change-Id: I46578bb27e515c4b9525d90b6619c11d7749914f
hwc: Processing of HDMI connection request when WFD is active

  when HDMI is connected during active WFD session, teardown
  WFD and process HDMI connection request.

CRs-Fixed: 442226
Change-Id: I4b22ff9f1ab3175bab47babdaf040cb2289ebe4d
hwc: Use correct z-order in video overlay

Set z-order of video layer to 0 and framebuffer to 1 in case
of video overlay composition so that the blending takes effect.
Also set is_fg OFF for framebuffer.

Change-Id: I05f930074d265d690f29a1003b7c28077df89bbf
CRs-fixed: 458180
hwc: qclient: Subscribe to mediaplayer death later.

Subscribing to mediaplayer death on bootup delays
display startup because it depends on mediaplayer startup.
Defer until later.

CRs-fixed: 463863
Change-Id: I5a5fc392b88fd06f51521f9e4c06feb52a5af7c6
hwc/ov: Fix MDP orientation flags and values.

--Fix MDP_SOURCE_ROTATED_90 removal.
Since mdp flags are updated fresh each round,
this flag should not be removed if there is no 90.
If pre-rotation is used, this flag is set by hwc and removed here.
(Affects anything having a 90 component in transform)

--Provide MDP adjusted transform to prerotation calcs.
Clients on Android don't switch flips if 90 component is present,
but expect the output to be that way. (camera)
We do it in HAL and then calculate final crop for MDP.
(Affects anything using 90 + Just 1 flip i.e camera)

--Pass 0 transform to MDP even for flips, since we
prerotate if there is 90 with flips or use MDP to flip via flags,
so no need to flip transform calcs.
(Affects anything using just flips).

Change-Id: I115a82ee4558794db0b6b641710494b9007d6f54
gralloc: Stride information fix

The perform enum for the stride is defined in gralloc_priv so it
is OK to keep the case outside.

Change-Id: Id31556f76c2a2ae93a15a2e2dc4169b07360e4e6
display: Remove framebuffer HAL usage

This patch removes the usage of the framebuffer HAL which is
deprecated in JB MR1 onwards. The code is left for compatibility
such as conformance tests but it is unused for normal display
usage.

Change-Id: If98133bdaa759cdc41d4503ff695b225ee43cb6f
hwc: Add support for clearing with c2d

When blending translucent layers or transitioning with c2d,
sometimes the frame is blended with stale framebuffer content.
Clear the frame with C2D fill surface before drawing.

CRs-fixed: 462461
Change-Id: I1dca477fe88d77f4f0fa4846b155404f348e911d
hwc: Fix alpha downscale check for mdp composition

hwc: Fix alpha downscale check for mdp composition

Do not allow mdp composition when any layer format has alpha channel
and needs scaling as the VG pipes are not supporting alpha downscaling.

In few scenarios, at the beginning/ending of animations Surface Flinger
passes few frames with flag HWC_BLENDING_NONE though it has Alpha.
When such layer passed to VG piple and if needs scaling , it results in
flicker. Hence, just checking for HWC_BLENDING_NONE is not enough.

Change-Id: I70fdfe4547df6fe7b2771ed8042f43aa4e07a71d
CRs-fixed: 462508
libhwcomposer: add dynamic thresold support for copybit.

copybit blit may not be effective if data for composition
is high. Add configurable threshold support beyond which
we can avoid copybit blit. set default threshold value to
2 times of fb resolution.

CRs-fixed: 462450

Change-Id: I0ee77ea1d761dc370d82ade1724caefbecfa01f5
fix derp

Change-Id: Ie2fb634d94aea57e509f2395af045671e0a78bc2
Signed-off-by: bmc08gt <bmc08gt.teamb00sted@gmail.com>