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
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
HWComposer: Set the transform value correctly

When using the bypass, read only last 4 bits of
the transfrom value regarding the change of
transform value in Layer::setGeometry().

(cherry picked from commit 7689940bec6440b78418cb15a9888312ab96ea04)

Change-Id: Ida5781e3e92929b8024947a41e5521f83164a4f7
libhwcomposer: Remove dimension Align checks for copybit

gralloc is already taking care of source buffer width alignment
based on the color format.Alignment should be based on source format,
But not dependent on FB format.

CRs-fixed: 344311 355814
(cherry picked from commit 8c8edc440288def7017eb12d93391cb785196f55)

Change-Id: Id83f926068d65896b6c7bb93dd086aa9d8c3b406
liboverlay: free rotator memory in a new function

- move freeing roator memory to a new function
- In queueBuffer, updateDataChannel, if memory allocation
  fails for the rotator, free the previous allocated memory

CRs-fixed: 353156

(cherry picked from commit 97de5b6dc39a8706ba90f4e8b191b18418cb0191)

Change-Id: Icc774b67678426ea7ba43520b1186ea148ce1281
libhwcomposer: Make fb width 32 aligned.

GPU need 32 aligned FB, and FB driver also expect the same.
It is mandatory for non-32 aligned FB resolutions like QHD panel.

CRs-fixed: 355814
(cherry picked from commit 2febae47ebd2bab247c7eeabb89bdf24438fe7db)

Change-Id: If82315bdf4ec2e7692d8b140efbb13f717dd34d1
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)
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
hardware/qcom/display: Add events for secure session setup

Change-Id: I0c0b5b7ae70d7ea8b341285479cd92750e1f6274

Conflicts:

	libgralloc/framebuffer.cpp
	libqcomui/qcom_ui.h