overlay: Reset allocation on all pipes, if commit fails.

If commit fails on a pipe, overlay hal needs to reset allocation
on all pipes for the given display. As MDP Comp fails, it falls
back to video and PipeBook logic does not pick-up those pipes on
which commit was successful. Driver sets new pipes and un-stages
previously set pipes (with same z-order). Pipe clean-up happens
and then in next round, PipeBook logic picks-up previous pipes
hence userspcae and driver remain out of sync.

Change-Id: I963fbdf89f346184688c5bcac2824606a5f7a0f2
libcopybit: Remove usage of C2D_NO_BILINEAR_BIT

Remove usage of C2D_NO_BILINEAR_BIT in the config mask.
This enables using the BILINEAR filter for scaling and
improves the image quality

Change-Id: Ic9b61fe3ed5b16e63971fe542928640a13d92764
CRs-fixed: 453925
libcopybit: Use blending parameters passed by HWC

Instead of assuming the premultiplied alpha based on the color
format, use the blending parameter passed by the HWC.

Change-Id: Ib494644b6f9c4bf13d8ea28327ccc2058a52aae8
CRs-fixed: 466732
Merge "overlay: Reset allocation on all pipes, if commit fails."
Merge "libcopybit: Remove usage of C2D_NO_BILINEAR_BIT"
Merge "libcopybit: Use blending parameters passed by HWC"
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

Conflicts:
	libhwcomposer/hwc_utils.cpp
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/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

Conflicts:
	liboverlay/overlayUtils.h

Conflicts:
	liboverlay/overlayUtils.h
hwc: fix dst calculations for right mixer

The calculations made for the right mixer was not correct,
fixed it for both FBUpdate and video usecases

Change-Id: Iff2c296321bce14b776731528fff6f1d255d829a
libhwcomposer: actionsafe support for video layer

actionsafe support for video layer

Change-Id: Ia40c3e2bb21f808ec127df3edb10e484b82cec3f
CRs-fixed: 481442
hwc: Add support for EXT_ONLY Layers

- Define GRALLOC_USAGE_PRIVATE_INTERNAL_ONLY flag in
  gralloc to display content only on primary.
- If there are any EXTERNAL_ONLY layers present in the list,
  mark them as HWC_OVERLAY such that SF does not compose
  and in hwc_set post that layer to Ext display.

Change-Id: Ic5db3bfa88295167d23d1fb2be7640c9fc772054

Conflicts:
	libgralloc/gralloc_priv.h
	libhwcomposer/hwc.cpp
	libhwcomposer/hwc_utils.cpp
display: Add support orientation control on ext display

- Added binder interface for android.display.IQService
  to set external orientation
- Values can be HAL_TRANSFORM_ROT_90, HAL_TRANSFORM_ROT_270
- According to the value set, the FB_TARGET for External will
  be rotated and positioned as per aspect ratio on Ext
- For YUV(video layer) it just calculates the position, as the
  rotation should be the source orientation
- This feature is supported only for low resolution panel.

Change-Id: I3d532ee0cb8dca3c37869537b55cd8044fd9047e

Change-Id: If6084031793251cca16b926bd82f5dccf76468a1

Conflicts:
	libhwcomposer/hwc_fbupdate.cpp
	libhwcomposer/hwc_qclient.cpp
	libhwcomposer/hwc_qclient.h
	libhwcomposer/hwc_utils.cpp
	libqservice/IQService.cpp
	libqservice/IQService.h
	libqservice/QService.cpp
	libqservice/QService.h
Merge "hwc/overlay: Video on 4k2k external, 4k2k rotation."
Merge "hwc: Use correct z-order in video overlay"
Merge "hwc/ov: Fix MDP orientation flags and values."
Merge "hwc: fix dst calculations for right mixer"
Merge "libhwcomposer: actionsafe support for video layer"
Merge "hwc: Add support for EXT_ONLY Layers"
Merge "display: Add support orientation control on ext display"