hwcomposer : Fix copybit render buffer fence usage.

Fixing array size to hold fence fd to count of render
buffers used in copybit, and use it to store
fence of corresponding render buffer at the index.

Change-Id: Ic5e7f264c2a81ded2a0f61ef138e59a093b0023a

Conflicts:
	libhwcomposer/hwc_copybit.cpp
libhwcomposer: Fence FD Count not handled for CACHED layer

- Fence FD count should not be incremented for CACHED layer

Change-Id: Ie6670bd44d2ff3ee180ee8413bf81154ee122c43
Donot compose layers if external is in pause state

* Donot compose external/virtual layer-list when
when external/virtual is in pause state.
* Marking the layers for GPU composition when external/virtual
is in pause state would update FB_TARGET layer which inturn would
affect partial mdpcomp after resume.

Change-Id: Id2806bd7156085c00158a31dff3c3dc4c2b61146
Merge "Donot compose layers if external is in pause state"
Merge "libhwcomposer: Fence FD Count not handled for CACHED layer"
Merge "hwcomposer : Fix copybit render buffer fence usage."
Merge branch 'kk_2.7_rb1.17' of git://codeaurora.org/platform/hardware/qcom/display into cm-11.0
HWC: Fix for use int reference in function call

To use the integer reference, declared integer
variable to get value directly in that variable.

Change-Id: I1fd1a45580be99dd95ccbc3495e28455a4c7de23
hwcomposer : Fix rotator fence for FB pre rotation.

Add framebuffer to rotator map data structure if
rotator is used for pre rotating framebuffer.

Change-Id: I496656c22b289b0bb0bf8c49056384a7fad3ac7d
CRs-fixed: 569696

Conflicts:
	libhwcomposer/hwc_fbupdate.cpp
hwc: Add deduction operation to Rect utils

Seperate out rectangle deduction from the layer cropping. Update
layer sourceCrop and displayFrame after deducting the rect value.
This makes the function generic enough to be used by other
modules

Change-Id: I587ac951357af823a1bf5e06c15ff47ac6a9c2a0
hwc: Crop source rect for the optimized destination

If a layer destination can be optimized, its source rect
needs to be cropped for the optimized destination rect.

Change-Id: If9a9891200d9cea52b58b253299b4007197cd9e5
fix fd leak in memtrack.msm8960

Close smaps_fd when exiting function.

Bug: 11007903
Change-Id: I4a9fcd1e84aae195d229e5dd11f99ccb9f6f5006
display: Properly handle NO_IOMMU case

 * Enable it by default for msm8660 too.

Change-Id: Icbd5de1e7f020285ff6101c34286ca8863b11040
libhwcomposer: Log and dump app layers of screen frames

Log a frame-by-frame succession of HWComposer layers' data and write
their buffers, if any, into raw or png files based on system property
values.

Change-Id: Icceccf5fff5ab4d78dbc6c28c11210b8837ddfd9
display: Clean up binder interface

The current binder implementation is inflexible when it comes to
adding new input/output parameters. It also needs a lot of
boilerplate code written when adding a simple enable/disable type
command.

Instead, let clients specify the parcels they want to pass and
unparcel them at the end points only.
Please note that it is assumed that all commands coming in
need the same permission checks. If this is no longer the case,
some commands need to be split out on the receiver end in
IQService.cpp.
This change also simplifies the code end clients need to write.
They should be able to include QServiceUtils and call a single
function to set the binder up and make the call.

Change-Id: I4db66f2427ecf16d7a6264462ae85815217a16b1
qdutils: Add display config to qdutils

This API is meant for system level users that need to get/set
various display attributes that are normally not available via
the regular Android framework channels.
Initially the APIs exposed are to check HDMI status, get display
attributes and set HSIC data.
Only physically connected displays are supported for now.

Change-Id: Ia783ce2ab0c4599a54c992171e01e2f0504550dc
hwc: Calculate viewframe from layers display frame information.

Calculate view frame of  each display from the displayframe of all
the application layers.

Change-Id: I9ba4076b7b4419bd3559417fad28b4e1de6acff3
hwc: Add binder interface to get the visibleRegion

- This binder interface can be used by clients to know the
  active visible region for a display(pri/ext/virt)
- When external orientation is used, return the destFrame of
  the FrameBuffer layer, as its the viewFrame

Change-Id: I7cfd149c76c16b9a3031103c89b1932d44bcbecd
hwc: Reset layer-to-rotator map and fences on configuration failure

When a rotator or mdp configuration for a display fails, reset the
layer-to-rotator mappings for that display and reset the release
fences for the rotator objects used for that display.

Note: The rotator itself is offline and not tied to any mixer. It is
from the mappings that we deduce which rotator object was used for
layers of which display. Also we don't delete rotator objects held
for a specific display, since during stability runs, failures could
repeat each round and we end up allocating and deallocating memory
unnecessarily. The rotator objects will be deleted automatically
when not required anymore.

Change-Id: I9a67f02574be30be3b96b3575f60530cb1c89e10
hwc: mdpcomp: Make all pipes available if a frame fails

Make all pipes in overlay available, if programming a frame (list)
fails. The failure could be due to commit failure, in which case the
overlay itself will make pipes available.

The failure can also be owing to lack of pipes, since we don't allow
switching pipes across mixers any more. This is particularly a problem
for split-panels. This fix addresses this latter case.

Change-Id: Ieac7ae7d03e5b9a93c7245fa160c8933593c2e09