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

Conflicts:
	liboverlay/overlayUtils.cpp
	liboverlay/overlayUtils.h
overlay: Use correct downscale for rotator.

Downscale is calculated based on area of dst and src.
Apply sqrt of downscale to each dimension.

Change-Id: I9def4ea5073e0e49a05103505a6b6f5013f0d579
liboverlay: round off rotator downscale factor to nearest integer.

This reduces the MDP clock and bandwidth requirements and
avoids falling back to GPU composition.

CRs-fixed: 457295

Change-Id: I4408ee0485248987342df63669f1a6894ea0dd73
hwc: Sync for rotator

Implement sync for rotator.
If a buffer is rotated, it can be used by producer soon after
rotation (and it wont have to wait until vsync).

Mdp waits for the rotator buffer's release fence to signal
to start display.

Hwc waits for previous access to rotator buffer by MDP to finish
before using it.

Change-Id: I5664806a17c44d58af62a2825ce454089fcd31cf

Conflicts:
	libhwcomposer/hwc_utils.cpp
hwc: In MDPcomp, set isFg flag for the first layer

Set isFg flag for the layer with zorder 0 for proper blending
to happen in Mdp composition.

Change-Id: Ibcb158f2049aa8713267feec93f299866fe74d52
CRs-Fixed: 481497
liboverlay : unset basepipe on overlay intialization.

On display framework intialization or restart when we are unsetting
stale MDP pipes connected to mixer, free base pipe too. Base pipe
gets allocated before composition once on start or restart of framework.

Change-Id: Ie73915031ffbcf03b6cadf2c526c76be79d582be
CRs-fixed: 483142
libhwcomposer: align rotator source buffers for tile format.

for tile format make the rotator source buffers aligned to 64 X 32.
This avoids rotator hang during source fetch.

Change-Id: I9e42788cc6f538b155c073028ce41bf48e1d9349
CRs-fixed: 473297
hwc: Fallback to GPU if source image width or height is less than 2

There is h/w limitation when MDP_OP_SCALE_RGB_ENHANCED bit and
MDP4_OP_SCALEX_EN or MDP_OP_SCALEY_EN bit is set.
The minimum block size is 2x2. MDP will hang if the source RGB image
height or width is equal to 1. Hence fallback to GPU in such cases.

Change-Id: I7333b097fd26bfb888865de9c39d1664bc87acca
CRs-fixed: 477581