display: Use a new flag for content protection

The GRALLOC_USAGE_PROTECTED flag that was used
earlier for content protection is also used for
some other use cases such as disabling of
screen captures. Define this new flag that
is explicitly used for allocating secured
buffers for DRM.

Change-Id: Ia33f79fa0dea7f2f16dd320f267203e6173af48e
CRs-fixed: 348454
(cherry picked from commit 440a996f13be732895524412762793f109681c11)
hardware/qcom/display: Add events for secure session setup

Change-Id: I0c0b5b7ae70d7ea8b341285479cd92750e1f6274

Conflicts:

	libgralloc/framebuffer.cpp
	libqcomui/qcom_ui.h
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
display: Readd yield in HDMI state change

 * Fix display freeze on HDMI disconnect

Change-Id: Ieeed2bbca973698fdadee7bfd915ec03c9cdde28
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
Overlay: Close channels on s3d format change

Fix 3d to 2d video switch, make sure params are cleared and pipes closed.
Fix other 3D regressions coming out of external connect-disconnect.

CRs-fixed: 349421
(cherry picked from commit 2ec3805e293d4e84e80e3de41b8fb6587849456e)

Change-Id: Ie6ba0aca2acf580081bcd6d293ddecef4143c6b3
Merge "Overlay: Close channels on s3d format change" into ics
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
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.