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
hwc: [8x26]Never allow primary get DMA pipe when external connect

For 8x26, if external display is connected, DMA pipe should never
be occupied by primary display. Otherwise, external display would
lack DMA pipe if switch to GPU composition.

This patch refines former commit: 9c1eb2be21a4952ee097d33

CRs-Fixed: 640934
Change-Id: Idc64b724cfacf9e8e22ca73e4e443e8d989e1212
hwc: featurize using QCOM_BSP

- Use QCOM_BSP for HWC_BLIT and GPUHint features
- These are not avaliable on all platforms

Change-Id: Ied0c60246093c868ac708f2f8897f08cec1e8878
libvirtual: Fix logic to detect DRC use case.

We detect DRC based on the resolution of the external display stored
in the HAL, and the dimensions of the framebuffer(fb2) after receiving
a RESUME event. If the stored resolution is greater than that of fb2
it means fb2 was reconfigured due to DRC. This is the only case in
which we trigger the DRC path (and the MDP downscale path thereafter).

For all other cases, the RESUME event is just treated as normal and
should not result in triggering the DRC path.

Change-Id: I2c8a854434f09a840938f00b88faa59c6cb57e7f
hwc: Add target specific checks in hwcomposer

* Mdss driver supports DMA-Multiplexing on wb interface
for certain targets. Add overlay get function to query
this info during pipe allocation for wb.

* UI Scaling on external is not supported on certain
targets due to the lack of availability of pipes with
scalars. Add overlay get function to query this info
to disable action-safe calcs, DRC and others which
require downscaling.

Change-Id: I1726caa4634f72d781561e797078648524ea2eef
gralloc: Report YUV plane info

The android_ycbcr structure in graphics.h is populated to give
the luma and chroma addresses. Use the same structure to give
this information to graphics via a gralloc perform call.

Change-Id: Ib42866a9ea90873886dcb60a1aac6cb375292642
HWC: Update DisplayFrame of all layers properly in Dynamic FB

Use change in HWC_GEOMETRY_CHANGED flag appropriately to avoid
redundant and unintentional overwrites of DisplayFrame values,
which may result fall back to GPU.

Change-Id: Ifb0f8dc5d356c965b6e80644f32392c460fb1ae7