hwc: Avoid changing VG pipe color format dynamically

VG pipe can be allocated for both YUV as well as RGB layer.
Switching this color format dynamically can cause overlay set
failure due to smp allocation change. Avoid this condition by
storing the color format it is allocated for.

Change-Id: I84df03883bd050c80d49e2ab63a37905535fb670
overlay: Reset display and mixer tags for unallocated pipes

When clients request pipes and unused pipe-slots are returned (the
ones having DPY_UNUSED, MIXER_UNUSED), they are tagged with requested
display and mixer ids.

If the client releases such pipes without using them (i.e without a
successful driver commit) we need to reset display and mixer tags to
UNUSED, so subsequent requests for a different display/mixer succeed.

Change-Id: I26e9fc4da3c3919ee23b65e2053c762df6c4cf8c
hwc: Add secure display attribute

- External displays can be secure or non-secure based on HDCP
- Propogate this to the SF with the getDisplayConfig
- Non-virtual displays(pri and hdmi) are considered to be secure
- For WFD using V4L2 archiecture, read the HDCP status from the
  sysfs and update accordingly

Change-Id: I7ac273aeb845c4762dc0690c7b88841c911c044b
hwc: Deduce overlapping region from layers below PTOR layer

Use intersection of PTOR layer and the layers below it to
address usecases like
   * PTOR layer is not peripheral to the layers below it
   * Some layer/layers completely below PTOR layer

Change-Id: Ieb456a60df12cc2f5ad46fbbba2d99a16853278d
hwc: Common Display HAL to support VDS & V4L2 WFD solutions

1. Define classes for VDS and V4L2 based WFD solutions.
2. Overload the functionalities for VDS and V4L2 WFD solutions.
3. Instantiate VDS object or V4L2 object during hwc init based on the
   property persist.hwc.enable_vds set by the user.
4. VDS solution is not verified as it requires some dependent changes.

Change-Id: I74bf944d532da138c850d4ec0c20b4a881489efa
hwc: vds: Configure WB as secure if output buf. handle is secure

When we receive a buffer handle that is secure, we configure WB as
secure; otherwise we continue as normal.

Change-Id: I497e257352c103c5da7ac2dc3fd4d7fe0e0b3953
hwc: vds: Display HAL changes for VDS based solution

1.  Hard code the vsync for VDS during the first prepare call
    with valid VDS display. We align the vsync period to that
    of the primary display. Effectively, we produce at the at
    the primary refresh rate and do not worry about the consumer.

2.  Do not bail out on the first frame as it leads to showing empty
    buffer. This leads to failures for some test cases such as those
    run in CTS.

3.  We need an FB layer handle check to cater for this usecase:
        i. Video is playing in landscape on Primary
        ii. Launch ScreenRecord app
    In this scenario, the first VDS draw call will have HWC
    composition and VDS does not involve GPU to get eglSwapBuffer
    to get valid fb handle.

Change-Id: Idc7d989e244a83ad28ce730ecb12955bc249dc25
hwc: Extend pause/resume functionality to VDS displays

Add support to handle pause/resume for virtual displays connected
either using VDS approach

Change-Id: Iabd01c5597f2399ccc7f83712bda1a2c1103788d
Display and wfd synchronization during teardown

* Provide a binder interface call for wfd module
to inform display about the start/stop/pause/resume
of wfd session.

* This is needed for wfd-hdmi synchronization in
case of v4l2 wfd solution. If hdmi is plugged
in during v4l2 wfd session, display-hal waits in
uevent thread for wfd teardown notification from
wfd module, before going ahead with configuring
external display.

* For VDS WFD solution, display-hal waits in uevent
thread for wfd-teardown to be signalled from
the composition thread.

Change-Id: I9514cb5bc7ff81de0b5dd4cdf66d8286a64ba094
hwc: vds: Add support to dump layers, FB and WB output buffer

1. Add hook to dump the layers going to VDS based virtual display.

2. Furthermore, add utility function to dump the frame buffer and
   WB output buffer. This will be enabled via a system property

   debug.hwc.enable_vds_dump

   Once dumping is enabled, the dumps can be extracted from

   /data/vds.fb.FORMAT.XRESxYRES.raw
   /data/vds.wb.FORMAT.XRESxYRES.raw

   e.g. vds.fb.MDP_RGBA_8888.1152x1920.raw

Change-Id: I2435c5507961a52929411206892c005492d5c193