hwc: Skip dropped layers in video only composition

No need to draw dropped layers while doing video only composition
since they are lying outside updating ROI.

Change-Id: I7bef731538e39a5b16f17314ad31f0c4e7f2b618
hwc: Set DMA state at the start of composition

* Set DMA state at the start of the composition cycle
based on the following.

Set it to LINE_MODE if the number of active rotator
sessions are 0.

Set it to BLOCK_MODE if
** A yuv-layer for any display-device requires rotation
** (or) mExtOrientation is set
** (or) mBufferMirrorMode is set

* Separate out the reset helper function into more
modular ones

Change-Id: I6a22ac4379565cd1fd2d875a7a417f4ed3ee0f1e
hwc: Clear overlay and layer-rot map from caller

Clear overlay and layer-rot map from the top level caller of
composition, rather than from the place of actual intermediate
failure. This makes sure, even in cases of GPU comp failure,
overlay and layer-rot maps are cleared and eventually pipes unset.

Change-Id: Ibf1152a0e8ca66d87bcc6b87009c4b09e451099d
hwc: Do not re-program H/W, if the frame geometry has not changed

There is no need to re-program the H/W, if the frame geometry of all
active displays, has not changed. It will help to improve performance
by avoiding re-configuration of HAL and driver, if it is not needed.

Change-Id: Ie01dce33be89afc7308a8103128d27b4b9fb5c4b
hwc: Use layer dirty rect to calculate frame's updating ROI

Use layer dirty rect instead of display frame to calculate frame's ROI.

Change-Id: If5fe93da7815efdf9b44ed683a4d80b397921cf1
h/q/d: Read minimum width and height values of the panel ROI

Read minimum width and height restrictions on ROI of a panel
through sysfs node.

Change-Id: I0e4c35cdcaee06e77955725565cfbed2f0fd91e9
hwc: Don't validate dropped layers for MDP support

Ignore dropped layers while checking MDP support for layers
when trying for full MDP composition.

Change-Id: Ia11594173759e9dcc321d72ef425615281c35b7c
Revert "hwc: Do not re-program H/W, if the frame geometry has not changed"

This reverts commit 5e268fcf56e7f5bd0fc524d50c0a97c9e34010a1.

Reason: Breaking cache based composition strategy and partial
update feature.

Change-Id: I0c881c8e2bc6be2a0b3dc0d5e7d22a388179f8d8
h/q/d: Dump ovinfo only on pipe config errors

Dump ovinfo only when validateandSet fails due to invalid pipe
configs. Failure due to insufficient resource is common and
dumping ovinfo for such cases wont provide much information.

Change-Id: I9e102cf633bb394603ea2484d80017e4b906b49a
hwc: Display view frame needs to be set before using it.

The display view frame needs to be set before calling trimLayer api
because it uses view frame to find the scissor for display, which is
used to clip crop for out-of-bounds display frame sent by framework.
If mViewFrame is not set, scissor will be empty rect, which leads to
wrong source crop calculation.

Change-Id: I52ad4eb9037d34aff24c30fe65e3793684445264
gralloc: Fix RGB888 marked as VIDEO

RGB888 layers were marked as VIDEO and treated as YUV along the path.
If RGB888 is ever required to be a video format we need to make sure
to have other differentiation mechanisms between a UI RGB888 and a
Video RGB888 if any special handling is necessary.

Change-Id: I94c74ac10d589e20dd600db0d1e32645613b1b21
overlay: Remove defines of log2f

Was a relic from earlier builds

Change-Id: Icf640a48f35c4caf6e7cbafa527260b040900096
overlay: Support for returning pipe based on capability

Add support for returning pipes based on capabilities.
getPipe() API takes in pipe specifications like format class,
scaling, display, mixer, fb and decides what pipe to return.
The nextPipe() API is now just a private helper.

Change-Id: I0ab809662c0ad6297e19a44f39264ee929944d13
qdutils: correct error checking of MetaData's handle mapping

In term of Linux manual, mmap() returns MAP_FAILED in case of
error, so current checking against NULL is not valid.

Change-Id: Iee6920b6478843a0c1cd62bdbe3e4b652a39c583
hwc: Set MDSS_MDP_DUAL_PIPE on both pipes

Set MDSS_MDP_DUAL_PIPE on both left and right pipes so libscalar
can detect the pipe pair.

Change-Id: I2c77238de1c7f81d4e17f516680a63462482910e
HWC/Copybit :: Add swap rect feature in HAL for MDP3

We brings all swap rect level checks in HAL from surfaceflinger
for MDP3.
swap rect kicks in case of
1 Only one layer is updating.
2 No overlaypping layers.
3.Both src and dst has same value.(no scaling)
4.No video layer

Change-Id: I881958994e80b53d4969beaaf51518b727a8de78
hwc/overlay: Correct pipe priority comparison

MDP driver assigns pipe priority in inverse order. Lower the
number, higher the priority. HWC shall swap pipes if right
pipe is assigned lower number than left pipe.

Change-Id: I328623d9f53ad3ae79f7e73b10116231a7c50582
overlay: Align width to 4 multiple in case of 90 degree rotation.

To support interlaced content with 90 degree rotation
width has to be aligned to 4 multiple.

Change-Id: Idaae06f1aa80490ae1b37e148c6d862dc26bebca
CRs-Fixed: 637264
Display and wfd synchronization during teardown

* Provide a binder interface call for wfd module
to inform display about the start/stop/pause/resume
of wfd session.

* This is needed for wfd-hdmi synchronization in
case of v4l2 wfd solution. If hdmi is plugged
in during v4l2 wfd session, display-hal waits in
uevent thread for wfd teardown notification from
wfd module, before going ahead with configuring
external display.

* For VDS WFD solution, display-hal waits in uevent
thread for wfd-teardown to be signalled from
the composition thread.

Change-Id: I9514cb5bc7ff81de0b5dd4cdf66d8286a64ba094
overlay: Pipe preference for 8x16.

Do not differentiate between app layers and FB layer.
As 8x16 doesn't support DMA multiplexing, the pipe preference
order will be RGB, DMA then VG for both primary and external.

Change-Id: I844b12b0eb452b50b64426cff965c0be120d5ee9