overlay: Continue when one of the framebuffer fd's fail to open

Change-Id: I4b1f071ebcf04a189bab612dd0d3def1a660105c
gralloc: Add locking to alloc and free in ION

Change-Id: I16e24e3d366b15a458b19983827233a7bd27d9f7
(cherry picked from commit edad58e17deb0cb1d9ff4754fbac511eea8e4ecf)
qcomui: Add option for choosing texture target on old Adrenos

Commit 95cf6d64860185146c80517d46617bb5c5abebec removed a workaround for
old Adreno drivers which are not optimized for GL_TEXTURE_EXTERNAL_OES.
This causes performance issues for some platforms. Add a compile time
option to enable this.

Change-Id: I1933054f8d5c97dfa18bd1f029a4c90fa0cc4689
libhwcomposer: Set bypass transition flag before invalidate()

Set flag to ensure HWComposer::invalidate() does not draw with
bypass still enabled. Also, log comp bypass transition due to
idle-timeout.

Change-Id: I3343d092a92c9677d0b9d50ced094c96d229474a
(cherry picked from commit f27aebd66249d165c0a3342abf4064a5dc350a6d)
qcom/display: add perform function to fb/hwc HALS

- Add perform function to framebuffer and HWComposer HALS
- This will be used communicate custom events(external display,
  video overlay, orientation, etc.,) to HALS
- remove setActionsafe API(not used)

CRs-Fixed: 341947
(cherry picked from commit 31999628ddd4a6c0996e22e9fbf1f311d6efb160)

Change-Id: I221f2ab49770e8db7602bb1881ef9972567b7780
libgralloc: Add API's to synchronize framebuffer update.

This change introduces API's in gralloc to allow clients
to synchronize with framebuffer posts.

CRs-fixed: 348953

(cherry picked from commit f81de75b1adb78018c0bd54b7f27901ba467defd)

Conflicts:

	libgralloc/framebuffer.cpp
	libqcomui/qcom_ui.h

Change-Id: I98b6a2b3243f520138cb5d1c76493cdfa3af60b6
libhwcomposer: Wait for framebuffer post complete before releasing composition buffers on bypass failure.

When bypass fails, MDP keeps reading the last submitted buffers until
the next VSYNC i.e., until PAN_DISPLAY is called on framebuffer. So
the previous buffers can be released only after PAN_DISPLAY IOCTL
call returns.

CRs-fixed: 348953

(cherry picked from commit c3a7ed7db39609e8f4d7ce0d6a56e82303ddb7f1)

Conflicts:

	libhwcomposer/hwcomposer.cpp

Change-Id: I5fb5a9eb275006a3158a111aad1eafac79973095
display: Fix Overlay state transitions

Trigger overlay state change for S3D format changes.

Close both overlay channels only when transition to/from 3D display
happen.

The closeChannel resets the Overlay state variables. Any changes to
the state variables prior to closechannel are lost. Update state
variables after calling closeChannel.

Remove unused variables.

Change-Id: Ia5aa84d02df1e1874df93530cf3e55298ebc81e3
CRs-fixed: 342350 342987 347382 350326
(cherry picked from commit 6706fd708dace780751a4602d6125e089851789f)
Reset to initial state when Overlay startChannel() fails.

When Overlay startChannel fails due to some reason and overlay
channel is not yet up, state needs to be reset to initial value.

Change-Id: Iabc765f350bf999d8362f86a43b900ff7aed1bb3
CRs-Fixed: 354403
Implement single vsync for YUV + RGB content

-- For UI updates, mark the MDP pipe for single layer YUV to be NO_WAIT.
-- Remove premature unlocking of buffers, except error cases.
-- Unlock buffers only after a single Vsync (PAN or PLAY) and after pipe UNSET.

This ensures smooth transition from MDP to GPU and prevents tearing.

Change-Id: Icfcb770dae12d4a7e0ff96d04149b2eaf0c07121
CRs-fixed: 359140
hwcomposer: Add workaround for cropped layers during bypass

 * Some hardware cannot handle cropping during bypass, or reports
   invalid rects during orientation change. If the invalid rect is
   cropped, MDP gets into a weird broken state where layers turn
   transparent, display blinks, etc.
 * Also use the VG pipe for 2 layers instead of just 1 in this case, it
   eliminates flicker when unlocking the device.

Change-Id: Ia5cb1a368bcc8949ba224a8510f577450449f22e
libhwcomposer: Set bypass transition flag before invalidate()

Set flag to ensure HWComposer::invalidate() does not draw with
bypass still enabled. Also, log comp bypass transition due to
idle-timeout.

Change-Id: I3343d092a92c9677d0b9d50ced094c96d229474a
(cherry picked from commit f27aebd66249d165c0a3342abf4064a5dc350a6d)
Revert "Missing HDMI ifdef"

This reverts commit 9595cfafd20e6b8c42a61e5698d95d3528f93354.
Merge branch 'ics' of https://github.com/CyanogenMod/android_hardware_qcom_display into ics