hwc: Perform MDP downscaling for WFD/HDMI Scenario

  On WFD/HDMI connection, if the configured resolution is less than
  Primary Resolution, Display HAL does the following:

  1. sends hpd notification to SF with primary resolution.
  2. configures MDP pipes with configured Resolution.

  This is done to improve UI quality as MDP has better downscale
  filter options compared to GPU.

Change-Id: I33570c13016a35ed6c5d22d4c34dfe75b2c605a1
display: Add BufferMirrorMode support for External

- In Buffer mirror mode, the output on the external should be rotated
  based on the primary orientation.
- this is used for the side sync feature.
- buffermirrormode has higher precedence over external orientation
- Add binder interface to enable/disable buffermirror mode

Change-Id: Ibea0af9627d69b4d42453adc868b113d82613437
hwc: Cleanup patch for SideSync and WFD/HDMI downscale feature

    Move block of code corresponds to SideSync and WFD/HDMI downscale
    feature to a seperate function.

Change-Id: Ib07cec61abf3a7226bc4dd2ebb9f313519114fd4
display: Add support for interleaved YUY2 and YUYV format.

Add support for interleaved HAL_PIXEL_FORMAT_YCbCr_422_I and
HAL_PIXEL_FORMAT_YCrCb_422_I format in display HAL.

Change-Id: Ib87d9bf481c20bf6a92293dd04746719b1d928c1
hwc:Donot invoke commit when wfd is in pause state

Donot invoke commit when wfd is in pause state
in hwc_set_virtual

Change-Id: I7202237e33b1b5de11f3bb1fdece4a897d3e6434
hwc: Call commit after unset of pipes

Call commit after unset of pipes as part of handling uevents

Change-Id: Ie140bb230a53a67389288191f7907f21215df059
Merge "hwc: Perform MDP downscaling for WFD/HDMI Scenario"
Merge "display: Add BufferMirrorMode support for External"
Merge "hwc: Cleanup patch for SideSync and WFD/HDMI downscale feature"
Merge "hwc: Call commit after unset of pipes"
HWC: Check for proper MDP version to enable C2D comp

- Allow C2D composition when MDP composition fails only
  for 8960 Non Pro Device

Change-Id: I0a0f714ea10f77a09ce8aa5b5964e644d8256a38
Merge "hwc:Donot invoke commit when wfd is in pause state"
Merge "HWC: Check for proper MDP version to enable C2D comp"
hwc: Set display as active only after unblanking it

* For HDMI and non-Hybrid WFD solution, on receiving
online event, display hal sends hotplug connect to SF.
* In case of such displays, set them as active only
after receiving an unblank call.
* For Hybrid WFD solution, since display hal will not
be receiving unblank call from SF, set it as active
as part of processing online event itself.

Change-Id: I319f1576cba954da2024680568c37fedb1eb5d43
Merge "hwc: Set display as active only after unblanking it"
hwc: Upgrade partial MDP composition

For secondary displays instead of using video-only composition we
now use full and partial MDP composition. This is however restricted
to 2 pipes owing to SMP and B/W limitations.

RGB layers with transform are now handled by partial MDP comp for
both displays. Layer cache and batching have been upgraded to take
care of this condition.

For example if primary is rotated and has a non-hw-accelerated volume
bar pop-up, earlier we would just fall to GLES, now we try to do
partial MDP comp.
Or if secondary has layers with transform (because there is no
pre-rotation for secondary), but non-updating and there is video
playback, we should be able to use layer cache, rather than drawing
with GPU always.

Also a layer not updating and a layer composed to FB are 2 separate
concepts. This patch now treats both differently.

Change-Id: I7eb43ba817f1081f317fefa99fa0c507344060e9

Conflicts:
	libhwcomposer/hwc_mdpcomp.cpp
	libhwcomposer/hwc_mdpcomp.h

CRs-fixed: 514448
Merge "hwc: Upgrade partial MDP composition"
Merge "display: Add support for interleaved YUY2 and YUYV format."
hwc: Include more cases in partial MDP composition and fix bug.

Fixing bug in partial mdp composition due to layer caching when
UI layer with 90 rotation is present in layer list.

Layer not updating and a layer composed to FB are same now.

When MDP cannot support a layer, we send the whole list of layers to
GPU. If such layers are not updating they can be cached on FB while
allowing the rest to take the MDP route.

Example # 1: Volume bar on video in 90 rotated mode. Since volume bar
is not h/w accelerated, there is no prerotation and we invoke the GPU
for redraws each round. With this change we won't because of caching.

Example # 2: If prerotation is applied to layers on primary, the
secondary layers would show a transform and the whole list is redrawn
with GPU. Now we could make use of caching.

This change also imposes a 1 layer limit on secondary, but now allows
full and partial MDP comp, thus benefiting secondary-only content.

Change-Id: I7eb43ba817f1081f317fefa99fa0c507344060e8

Conflicts:
	libhwcomposer/hwc_mdpcomp.cpp
	libhwcomposer/hwc_mdpcomp.h
Merge "hwc: Include more cases in partial MDP composition and fix bug."