liboverlay: Setup the overlay and rotator if the geometry has changed.

Setup both the overlay and rotator for every geometry change event.
The mNoRot flag decides if the rotator needs to be setup for that
particular channel. SetTranform takes care of enabling/disabling the
rotator and correcting the params when the rotation changes.

CRs-fixed: 336037 336346
(cherry picked from commit 84c7068f405189542658529cc43a3d54b49b11ca)

Change-Id: I4c4c747bf365c50c48037c657c653d4903ec7e76
gralloc: Add function to calculate buffer dimensions.

This function can be used from other components
to get the aligned dimensions and size of the buffer
given the width, height and color format.

Change-Id: I8d7532a262194f3883bf0f5166e806e0971392e2
display: Use temporary buffer for internal conversion

(cherry picked from commit 7945ee46591ceba584b1b2167e5f750d3489d69c)

Change-Id: Ie71a8745e8810ade310103fdfed7db03cd170980
Display/copybit:Fix YV12 multiple conversion issue

Use a temporary buffer to replace inplace conversion

CRs-fixed: 333784
(cherry picked from commit 927542660e4c6106f8062c79bd6461c7fef55b4a)

Change-Id: I044bdaa31faea98552e35267bb78318317d68866
libcopybit: Fix the software conversion from YV12.

Fix the software conversion from YV12 to YUV_420_SP
by reading the chroma based on chroma padding involved.

CRs-fixed: 333784
(cherry picked from commit b22b6b191644e3ef618d122d30cef4bb9f87019d)

Change-Id: Ie84c1cbb2635a6197c5a907dac1e720c29a66e6c
libhwcomposer: Fix temporary stretch in copybit

-Check only for 90 or 270 degrees rotation and interchange
width and height if rotation is one of them.
-make scaling computations in float

CRs-fixed: 337370
(cherry picked from commit 460d7b96c06aa33d61b38d146f76887a49cd8057)

Change-Id: I30255e3926917896223dba7306df60ff7cfa14e2
 libcopybit : Fix calculation of copybit source rect for blit

 - Fix the copybit source rect calculation for 180 and 270
 degrees rotation. Calculate blit rects  based on the source crop.

 CRs-fixed: 337366

(cherry picked from commit 06aa97757bd7023234d3852801e05e077aaa1d2f)

Change-Id: Iba2e230acd84271fc5649e06918824752aa90670
libcopybit: Add support for Yamato format in MDP userspace.

Video decoder and MDP support Yamato(YCbCr_420_SP_ADRENO).
Add support from userspace to use it.

(cherry picked from commit 53578e5bddf86628ffa9814fe036de62e06584cc)

Change-Id: If068952b92c098529c3a144a3e6360f534979c36
libhwcomposer: Avoid overlay specific code for non-overlay targets

(cherry picked from commit baeb7668e20e4513fd6d7e6e211555a3c17195b8)

Change-Id: I2a6f49d364aa4fac11ec950bf7fc88ecff7afdbb
libqcomui: Add null check for incoming buffer

Add null check for incoming buffer in updateBufferS3DFormat function.
return invalid value if buffer is NULL

Change-Id: I97c535ae7291ee12648a92bff843c0c500bce4df
(cherry picked from commit e009dff7644d9b0663f3939e48ad1e955b1f76b5)

Conflicts:

	libqcomui/qcom_ui.cpp
libqcomui: Select texture target based on pixel format

Do not choose GL_EXTERNAL_TEXTURE_OES for all formats, instead,
select between GL_EXTERNAL_TEXTURE_OES, and GL_TEXTURE_2D based
on the pixel format.

This change is done to reduce composition times.

CRs-fixed: 328074
(cherry picked from commit 4cfa30aa54ca589dfc3e9b0fbaac7eaeed2bbf2a)

Change-Id: I23d38a1b1fc40bafb17eabbdf35ae5f8f4876a97
QCommUI/HWComposer: Allow application to set 3D format

This change allows the application to set the S3D format for the surface.
With this change application would be specifying 3D format and that would
be handled by hwcomposer would handle it appropriately.

Change-Id: I6b7b33712ab85b8a94231bd65a19709b3c2cd606

Conflicts:

	libqcomui/qcom_ui.cpp
libhwcomposer: Fix MDP composition for negative coordinates

This change fixes destination rect calculation for negative coordinates

Change-Id: Ic906ef66784c88178ff557118f8609833df5cf01
liboverlay: fix mdp and rotator color formats

MDP color formats have been changed to match the actual input format.
Also rotator will now provide the dst format instead of maintaining
local mapping.

CRs-fixed: 339114,337040
(cherry picked from commit f8c2fe0c78d27f9292e5bb9948db11c72446dc55)

Change-Id: Ic76a4fd96c5aa4c82d6dbdef650752934d761ac0
hwcomposer: Close MDP pipe on invalid gralloc handle

Unused bypass pipes need to be closed after unlocking their
buffer handles.This change makes sure the pipes are closed even
if client releases the buffers(invalid buffer handle) before
this function gets called.

CRs-Fixed: 344765
(cherry picked from commit d8761a761f7d2eddcec12841f4d9afd4261ee79e)

Change-Id: I449d0dce4ec458e19446fcc26316a3794a15f909