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
gralloc: Clean kernel allocated pmem buffers after memset

(cherry picked from commit 2eaaaa47ed638d210c344d8dd14c2690cd7e5a99)

Change-Id: I4acfb25b048eda0b179dcad78a3fe1da9a2c1a7a
Merge "gralloc: Add function to calculate buffer dimensions." into ics_chocolate
Display: fix LOCAL_MODULE_TAGS for display HALs.

(cherry picked from commit c4a5fc6fb4aabf6b90f030808611729f63dd3116)

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

(cherry picked from commit 7945ee46591ceba584b1b2167e5f750d3489d69c)

Change-Id: Ie71a8745e8810ade310103fdfed7db03cd170980
qcom/display: fixes for the external overlay channel

- During video playback, when the external display is connected,
  start the overlay channel on the right framebuffer.
- set the correct position for the new external display channel
- fix minor bug in the function getAspectRatioPosition for external
  display

CRs-fixed: 336674
(cherry picked from commit 6afc95ee1197718332461c8f0ddf9cf5f94cc7aa)

Change-Id: Ifa30dfea349c2a0f133790ab2dc91527d53152f8
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
libhwcomposer: Fix dynamic composition.

Layer orientation can be ignored since displayFrame always represents the
destination region in framebuffer orientation.

(cherry picked from commit f6ab48d14d32ba805fc25597533de14dae1c4e2b)

Change-Id: I0f9217e81a953a63cf9ea4ef9ddab25a1c67184e
liboverlay: Redirect Post Processing library header

The post processing library header has been included in the target output
now; thus, liboverlay should use the new location in the 'out' directory.

Change-Id: I53fad5503456fbb821c7eb8fb0092f6a762f4c3a
(cherry picked from commit b338d9e7a9c182a654de1a86418f5b1f27e7f308)
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
Define HDMI_AS_PRIMARY flag based on TARGET_USE_HDMI_AS_PRIMARY

S3D code is being conditionally compiled with HDMI_AS_PRIMARY.
So it is necessary to enable this flag, if board file indicates
HDMI as primary display

(cherry picked from commit dfc3782b8f23a6aadec9fd7501807778b0d3c542)

Change-Id: I3f6f84d76a3f7f5a3f83aa5ec31012b13b16431b
Revert "Bypass: Turn off only after FB content is displayed."

This reverts commit f2dbabe786a12e7e9ae15328550b5ba581c5492e.

This change is not needed any more because we are caching the MDP pipe
contents when closing the channel. So no need to wait for postFB finish.

Change-Id: Ia6f01c33953762cb7a97e0b2b795d9afeb60d2d9
(cherry picked from commit 441f1824593bb12a97508b426b597a16b35091e6)
libhwcomposer: Add support for 3 layer bypass

This change allows 3 or less layer use cases to get bypassed completely via MDP pipes.
If more than 3 layers, all of them gets composited on FB.

Intended FB fallback cases:
  1) 4 or more layers
  2) Any MDP pipe is in use
  3) Any layer needs rotation
  4) Any layer is allocated from non-pmem

Change-Id: Ieb2b30b8ab9893fd68c7fc61ec889ac9a01cb7dd
(cherry picked from commit 001ffcfef1d63948926b1be67c4977d13ae1b159)

Conflicts:

	libhwcomposer/hwcomposer.cpp
libhwcomposer: Fix MDP composition for negative coordinates

This change fixes destination rect calculation for negative coordinates

Change-Id: I0174ae3b9643f74d60d559e84bc36bd9ec1d0caa
(cherry picked from commit 3620e365fe9ffcc8d3ec21691707d46e11bdb9ae)