Invoke a padding round in certain use-cases.

* In some use-cases, it is possible that there are
no AppBuffer layers on the external/virtual layer-list
during which all the pipes will be allocated to the
primary. When layers do comeup on external/virtual
layer-list, subsequent overlay sets fail.

* This change ensures that in such cases, we invoke a
padding round on all the displays to free up the
hw resources which can be used in subsequent cycles.

Change-Id: Ifac0b8f51a8719eb55b11010d05b8d11352db054
hwc: Reset FB Z order to -1 instead of 0

In Video-only mode FB Z-order of 0 was being used, incorrectly,
because the value was reset to 0 and wasn't changed subsequently.

Reset to -1 to prevent this. Any MDP comp strategy that needs to use
FB should set it's Z order appropriately.

If cache based mode has no MDP comp layers, fail so that other
strategies can be used, rather than succeeding with FB Z as 0, which
will at most allow GPU comp to be used.

Change-Id: Ifdae2cd5f8d8ff0e10447b1fed6ee1671260f311
HWC: Use proper typecast to avoid scaling issues

Multiplying double with integer may scale up/down original value.

Change-Id: I2aa002a434d287df69d34de7e4fea3d56bcfbfaa
hwc: hwc_sync - populate correct fences for BLIT

Previously, the acquire and release fences for BLIT
composition were populated using same logic as Overlay,
but BLIT composition consists of separate BLIT step
before screen refresh, and app buffers are no longer
required after BLIT. So holding the buffers for both
the steps is unnecessary and impacts performance.

This change adds condition for BLIT in fence population
logic in hwc_sync and populates the right fences for the
App Buffers and Display Refresh during BLIT composition.

Change-Id: I9998a7052c0375acb32a174bdf0469d2a88f79e8
Merge branch 'cm-11.0' into kk_mkt