libqdutils: Add synchronization to idle invalidator

Protect invalidator data from accessing multiple threads
asynchronously. Composition thread and idle invalidator
threads could access at same time. Add locking to protect
invalidator class  member variables.

Change-Id: I568ec367958c88f70f7aa4e6917abd53830adfd3
hwc: Don't lock eventControl for vsync events

Locking here can lead to a delay in vsync disable/enable
where prepare/set is not yet completed. The HWC spec says that
eventControl needs to take effect immediately.
This lock was earlier present when we waited for SF to unblank
primary at startup and the vsync control ioctls could fail.
This is no longer necessary as we unblank primary on startup now.

Change-Id: I2bf18ae9235f8dd428a495a9a23af7f00f34ff1d
overlay: Add writeback support

Add explicit writeback display type, writeback ioctls, memory mgmt,
writeback class, writeback obj manager class to overlay.

Change-Id: I171e60cea5ed8f6649859e3eb189df37b39962f1
hwc: Refactor of allowing virtual displays to HWC

  1. Since SF doesnt invoke blank for virtual display,
     handle pipe clean up as part of Primary display
     blank.
  2. Support virtual display to query display attributes.

This refactor is done to address Framework reboot issue.

Change-Id: I266a87228193fd85252a22242b66dd4af5f3033f
hwcomposer: Fix a crash with MDP composition.

Reset the current frame data before returning from MDP
composition prepare to avoid accessing previous frame data
in MDP composition draw phase. Avoid the number of app layers
going beyond the layer count limit in MDP composition.

Change-Id: I2a3035ad5cb1731060b9359ccdbe9fe0c07e843c
CRs-fixed: 510683
overlay: Fix crash due to small debug buffer size

The debug buffer size is insufficient for newer targets with multiple
pipes. The code causing crash is enabled only if the PIPE_DEBUG macro
is enabled during local debugging.

We now increase the buffer size and also put some string operations under
the macro check for efficiency.

Change-Id: I4ad418d314fd8c7d374ccfdb0943dde44d968922
copybit: Add support for HAL_PIXEL_FORMAT_YCbCr_420_SP_VENUS format.

Currently framework is not returning the correct MDP format
corresponding to HAL_PIXEL_FORMAT_YCbCr_420_SP_VENUS format.
Modifying the right format to be returned.

Change-Id: I1862dea6daf6cc90e25492af7bf2e7f3bf6328ec
gralloc: Default to an error value for mapFrameBuffer

We do further operations in fb_device_open based on the result of
mapFrameBuffer. However, if mapFrameBuffer is never done, we
could end up with a random crash when using the info values in
fb_device_open. Defaulting to an error value avoids this.

Change-Id: I1e51f814611a3f2eb73f36d75e14d8725ca98474
hwc: Add support for mpq8092 platform

Add support for mpq8092 platform to hwc

Change-Id: Ic1811052eb4701cb20fdaa24be42689b0d4ac61e
copybit: Pass in proper acquire fence count to blit call

The counter that was incremented when an acquire fence was provided
was not the counter that was passed into the blit call. Due to
blit requests being processed in order that it is submitted, it is
not need to pass in previous release fence as acquire fence for
next blit request.

Change-Id: Ic259af24b33e5e69440d481c92788107ff639bed
Merge "overlay: Add writeback support"
copybit: Ensure that copybit is not generating alpha values

When image was being up scaled beyond 4 times and intermediate
buffer is used, alpha value would be 0 in intermediate buffer.
This would then be blitted onto final buffer that contained alpha
value. Since fg had alpha value of 0 entire image would be blended
out.

Change-Id: I6daf03e93719212ee597c218655ae8692ae79e72
hwc: Use gpu composition when there is rotation

Mdp3 has a hw issue where it cannot handle rotation and blending,
when roi height or width is not divisible by 16. When roi is not
divisible by 16 mdp3 would read memory that it is beyond the
image. This leads to page faults, which further leads to poor
performance.

Change-Id: I2cd1b77c21c407503399630cdb702b575aa4e64e
Merge "hwc: Don't lock eventControl for vsync events"
Merge "overlay: Fix crash due to small debug buffer size"
Merge "gralloc: Default to an error value for mapFrameBuffer"
Merge "hwc: Add support for mpq8092 platform"
Merge "libqdutils: Add synchronization to idle invalidator"
Merge "hwcomposer: Fix a crash with MDP composition."
hwcomposer: Fix a deadlock with debug enabled.

If debug property for MDP composition is enabled,
we call dump function from composition thread.
Make sure we are not holding the MDP composition
lock before calling dump function as this also tries
to acquire the same lock and causes a dead lock.

Change-Id: I05e5fd58be096f1ab683d796cc1beb4972c2168f