Revert "remove support for HWC < 1.0"

This partially reverts commit 30bcc61431d8e3bef779472dd52a7b156dcaba09
and updates to the current API. Tested on 0.1 blobs from Tegra2/3
and OMAP3/4

Change-Id: I43cee8852b266d68d1edefbe7ac988b9dbcf7227

Conflicts:
	services/surfaceflinger/DisplayHardware/HWComposer.cpp
surfaceflinger: Update support for hwc < 1.0

Add android::HWCLayerVersion0 implementations of the new methods

Change-Id: Ic199c9b4262049b74632a57ad2b2cdf462a05b43
DisplayDevice: Backwards compatibility with old EGL

From 4.1 to 4.2, the display subsystem was reworked to
use SurfaceTextureClient/BufferQueue instead of
FramebufferNativeWindow for the framebuffer itself.

Unfortunately, some legacy EGL libraries make assumptions
that any framebuffer device will be FramebufferNativeWindow.

These EGL libraries will fail when used in 4.2 as if the
framebuffer is not FramebufferNativeWindow, they will
try to dequeue more than one buffer at a time, which
will cause a hang of the graphics subsystem.

This allows use of FramebufferNativeWindow to keep
legacy EGL implementations happy.  Confirmed EGL
implementations that need this include but are
not limited to:

Set BOARD_EGL_NEEDS_LEGACY_FB to use

Tegra2/3 ICS EGL
Mali400 ICS EGL (Allwinner A10)
Mali400 Jellybean (4.1) EGL (Samsung Exynos4)

Original implementation by OndraOrg of XDA:
http://forum.xda-developers.com/showpost.php?p=34469675&postcount=19

Change-Id: I74005cf6753b3c9bfb4c1e32fb641f5167787917

Conflicts:
	services/surfaceflinger/DisplayDevice.cpp
hax: Split the exynos4/tegra legacy code paths

They hang up at different places, and require different fixes.
Tested on t3 and e4

Change-Id: I46257a7e9e6b6e093a5cb92eaaaef4bdd0435a12

Conflicts:
	services/surfaceflinger/DisplayDevice.cpp

Conflicts:
	libs/gui/Android.mk
	libs/gui/Surface.cpp
	services/surfaceflinger/DisplayDevice.cpp
Added overloaded setCrop for HWCLayerVersion0
Fix for surfaceflinger