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)
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
Merge "Define HDMI_AS_PRIMARY flag based on TARGET_USE_HDMI_AS_PRIMARY" into ics_chocolate
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
Merge branch 'ics_chocolate' of git://codeaurora.org/platform/hardware/qcom/display
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: I78f92f8d13b00cd2cf6b2a75218b93139670e6da
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: I6a6359fa47423e0087157eb88b241376db1aa061
libhwcomposer: Fix MDP composition for negative coordinates

This change fixes destination rect calculation for negative coordinates

Change-Id: Ic906ef66784c88178ff557118f8609833df5cf01
libqcomui : Compose UI in S3D format

The new class QCBaseLayer has been added. It implementsthe composition
of S3D UI when 3D video is playing. HWC adds hints to UIlayers for
composing them in S3D format when running S3D video.
Compose them in requested format.

(cherry picked from commit 080e303a70f89a1b0601a45c0815042addb7ac63)

Change-Id: I1d33a1419914b8e06618acd335f89808dc692742
libhwcomposer: Disable FB fetch if there is only one video layer.

If we have a single layer for composition which goes via the overlay,
we can disable disable the framebuffer fetch thereby saving power.

CRs-Fixed: 338777
(cherry picked from commit c40d887d714d14182e867e5eb7942160b3feb197)

Change-Id: I361f5d8a60fb478a675b47163b7524c79e66624a
Merge "libhwcomposer: Disable FB fetch if there is only one video layer." into ics_chocolate
Merge branch 'ics_chocolate' of git://codeaurora.org/platform/hardware/qcom/display
Merge branch 'ics_chocolate_rb1' into ics_chocolate
hardware/qcom/display: External-only display.

Add support for external-only display. Layer buffers
marked with GRALLOC_USAGE_EXTERNAL_ONLY will be
displayed on external panel only, if available.

In addition if the layer buffer also has the flag
GRALLOC_USAGE_EXTERNAL_BLOCK then only that layer
will be displayed on external (During suspend).

When this mode is on, the default mirror mode for
external is stopped.

Conflicts:

	libhwcomposer/hwcomposer.cpp

Change-Id: I8ea2920384c5b68311ee3fe00707d01ab6568b52
Merge "hardware/qcom/display: External-only display." into ics_chocolate
libhwcomposer: Don't return an error if the list is NULL

- a NULL list parameter or a numHwLayers of zero indicates that the
entire composition will be handled by SurfaceFlinger with OpenGL ES.
- a NULL list parameter or a numHwLayers of zero indicates that the
entire composition has been handled by SurfaceFlinger with OpenGL ES.
In this case, (*set)() behaves just like eglSwapBuffers().
- dpy, sur, and list are set to NULL to indicate that the screen is
turning off. This happens WITHOUT prepare() being called first.

(cherry picked from commit 5047cf7b17c8546f33c432d67b3510a540a74391)

CRs-fixed: 336520

Conflicts:

	libhwcomposer/hwcomposer.cpp

Change-Id: I1eaa4b2360aea164ce389a9803bc1630b8fdf01c
Merge branch 'ics_chocolate' of git://codeaurora.org/platform/hardware/qcom/display