liboverlay: Close BF pipe though floating pipe close fails

* Close borderfill pipe eventhough closing of floatingpipe
fails.
* On startup if borderfill pipe is connected, use the
index corresponding to that rather than requesting a new pipe.

Change-Id: I4b52a897733845f00cb315219635ae8b6a45b9fd
display/libhwcomposer: Fix memory leak in MDP Comp.

This changes fixes a memory leak by freeing up pipe alloc
structure everytime before parsing the current frame.

Change-Id: I23edefca71ec0209291be24ee9d629b4a80f0a25
CRs-Fixed: 456594
Merge "display/libhwcomposer: Fix memory leak in MDP Comp."
hardware/qcom/display: Remove glfinish call

There is no need to do a glFinish on every composition complete.
glFinish needs to be called for composition cycles where GPU and
copybit are both used for composition. This is because the GPU and
copybit operate on the same framebuffer.

Change-Id: Ie742a34db26475af02fa9a6862e66f370aecdb22
Merge "hardware/qcom/display: Remove glfinish call"
liboverlay: Do not use rotator if not required

* Do not use rotator if rotation and downscaling
are not required. This helps us in saving a couple
of milliseconds in hwc_set.
* Added setRotatorUsed api in rotator and
overlayCtrlData to separate out setting use of
rotator from setTransform api.
* Added getDownscalefactor api in overlayCtrlData to
separate out calculating downscale factor from
doDownscale api.

Change-Id: I90258507af53ff9800d93ff144dff0f9d802f6dc
CRs-Fixed: 469551
 libhwcomposer: set overlay state to FB when  secure config is still in progress.

(cherry picked from commit cb46fcf324ff17afb65d2c109a6d65e6323c5a28)

Change-Id: I1276674534c84c2771dc625f411b2ffefa8279d7
CRs-Fixed: 469551
hwcomposer: Handle non-secure video layer during Secure Mode configuration

  1. When secure mode is enabled, if HWC receive a non-secure video layer,
     fallback to GPU.
  2. When non-secure mode is enabled, if HWC receive a secure video layer,
     fallback to GPU

Change-Id: I4d1e6772149ffe210f129f89fc2b113471e06515
CRs-Fixed: 469551
hwcomposer: keep secure content in an overlay when below skip layer

Secure content can not be displayed unless in an overlay.  Since
getLayerStats marks all layers under the skip layer for framebuffer
composition, when there is a skip layer on top of protected content,
the protected content disappears since surfaceflinger doesn't draw
protected layers.

(cherry picked from commit 02d55d650226b07323ea902cb985f91d33271780)

Change-Id: I762fb7feae99a0e381577b854a898b3a58fdb074
CRs-Fixed: 469551
Merge "liboverlay: Do not use rotator if not required"
Merge "hwcomposer: Handle non-secure video layer during Secure Mode configuration"
Merge " libhwcomposer: set overlay state to FB when  secure config is still in progress."
Merge "hwcomposer: keep secure content in an overlay when below skip layer"
libhwcomposer: Request for RGB pipe if downscale is required and alpha channel present

In mdp composition, request for RGB pipe if downscale is needed
and there is alpha channel present in the layer format.

Change-Id: I6899ff4c7f277ee916e19c344002be41683e3ad0
CRs-Fixed: 470644
liboverlay: Set mdp src format as rotator output format.

* Set mdp source format as rotator output format
rather than determine it from a fixed mapping of
input/output formats.

* This is needed since for the same input format
to rotator, fastyuv mode if enabled may result in
a different output format than the one if the mode
is not enabled.

Change-Id: Ia80cd55238fa9a33685b7820367af2c01fee2ca5
CRs-Fixed: 473945
Process offline event once external config is done

Act on processing offline event once the external
display configuration is done. This is to avoid
race conditions introduced in processing b2b
online/offline events.

Change-Id: Ie395c3f4a9c1dd014c17688bcb0b39f160001915
Merge "Process offline event once external config is done"
Merge "libhwcomposer: Request for RGB pipe if downscale is required and alpha channel present"
Merge "liboverlay: Set mdp src format as rotator output format."
Merge "liboverlay: Close BF pipe though floating pipe close fails"