hwc: Fix deadlock due to async signal handler.

If an async signal handler tries to acquire a lock,
which the "active thread" already holds, we hit a deadlock.

--Remove signal handler.
--Create a separate thread for invalidating drawing after
  a specific timeout.

Flow:
Draw thread asks invalidator thread to sleep on an MDP comp update.
On invalidator thread wakeup, if there were no MDP comp draw updates,
it triggers a forcible draw using c2d / gpu + close MDP comp channels.

CRs-fixed: 365753
(cherry picked from commit 14fe810804ac16b36d56c39eb402ad08658c5e62)

Change-Id: I61bd325e4d92fd5d6ea8e9e13b8aa8c0139880b5
LibOverlay: Set fg flag for Secondary Display

Enable fb_en for VG2 overlay if DISABLE_FRAMEBUFFER_FETCH is set.

CRs-fixed: 352855, 355921
(cherry picked from commit 27a4dd525c84139c4c3a8724d13c6989b6b34d0e)

Change-Id: Ib76f2cbdac84eae7f422be410dda023b89d87a2d
Merge "LibOverlay: Set fg flag for Secondary Display" into ics
framebuffer: add alternative RGBA offset for SEMC 7x30

Change-Id: I3b4458ccb1439e51c56dcb242473bd3cb4601e39
Revert "hwc: Fix deadlock due to async signal handler."

This reverts commit 18f69fc3eb9530bec940de3ae7edc71c41ba7ec8.
Revert "libhwcomposer: Make fb width 32 aligned."

This reverts commit 59fede11246cbb1c837a567d276d108c1abaccca.
Revert "libqcomui: Allocate idleTimer dynamically and arm it to expire once"

This reverts commit 61ecc6edd8c9893816765929ad2302301b910a41.
Revert "libhwcomposer: Remove dimension Align checks for copybit"

This reverts commit 3f0d831c9e4e81ec3989b145be96e9c5d9f98a60.
Revert "display: Readd yield in HDMI state change"

This reverts commit e929e2928582dd3ca3977aece57e14200b964009.
Revert "framebuffer: Remove extraneous update on HDMI"

This reverts commit c11ecacc6f05815e4fad4e7b9a5b53c748924f47.
Revert "HWComposer: Set the transform value correctly"

This reverts commit ab0a62f94f9f6c6fd30291383d327e79926966b4.
Revert "hwcomposer: Add workaround for cropped layers during bypass"

This reverts commit 537ed59de42bf370d8c1ca27e3ba8658475d75b2.
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
framebuffer: Remove extraneous update on HDMI

HDMI should be updated only in conjunction with primary.
Which means on a resume from suspend (which is treated as
cable connect in HALs) we need not draw ahead of primary.

A good way (already existing) is to call invalidate() on SF
on cable connect so that primary is updated and only then HDMI,
by a trigger from disp_loop thread.

Change-Id: I7d5268b2f0e27adb04aade757c36483cdfc1333e
CRs-fixed: 335763

Conflicts:

	libgralloc/framebuffer.cpp
	libhwcomposer/hwcomposer.cpp
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
libqcomui: Allocate idleTimer dynamically and arm it to expire once

This change:
    1) Allocates idletimer object dynamically in HWC to explicitly
       initalize its members
    2) Modifies idleTimer arming logic to expire only once after given
       timer delay

CRs-Fixed: 365305

(cherry picked from commit 3091112c6af4ef75e911d59e73029a72704c0f11)

Change-Id: I28f1ffbbbe8dc70d4ae6065866f77ff91bfe3cf9
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
hwc: Fix deadlock due to async signal handler.

If an async signal handler tries to acquire a lock,
which the "active thread" already holds, we hit a deadlock.

--Remove signal handler.
--Create a separate thread for invalidating drawing after
  a specific timeout.

Flow:
Draw thread asks invalidator thread to sleep on an MDP comp update.
On invalidator thread wakeup, if there were no MDP comp draw updates,
it triggers a forcible draw using c2d / gpu + close MDP comp channels.

CRs-fixed: 365753
(cherry picked from commit 14fe810804ac16b36d56c39eb402ad08658c5e62)

Change-Id: I61bd325e4d92fd5d6ea8e9e13b8aa8c0139880b5
Framebuffer : Pass actual display buffer size

When opening the HDMI mirroring channel, use actual display size.

Change-Id: Ib3a6563de50844575d01df828c8ccedf06c58dc1
libhwcomposer: force secure buffers to MDP.

For secure buffers even if display coordinates are out of
screen bounds, calculate right clip coordinates and push it
to MDP as GPU can not render secire buffers.

CRs-fixed: 363835
(cherry picked from commit f0ba936c52da7ff80ba014d3af4b6aa1d40b61f5)

Conflicts:

	libhwcomposer/hwcomposer.cpp

Change-Id: I40c94f167bcb44788e4a674bbc38ea4a939c5710
(cherry picked from commit f0ba936c52da7ff80ba014d3af4b6aa1d40b61f5)