hwc: vds: Add support for black frame generation on PWR suspend

If VDS is connected, do not clear WB object as it will end up
detaching IOMMU. We need to keep the WB session active in order
to send a black frame to WFD sink on power suspend.

For AD use case, we will keep the WB object active.

Change-Id: Ic6db255676ca0baafd468887fc3f88eafc581cea
gralloc: Set default value for implementation defined formats

For implementation defined formats which go via HWC, set the
default value to RGBA8888

Change-Id: I7f8c46bc47746dcf1c4a03438b8f93d7bab78bb1
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: Add support to query max. supported WriteBack width

Adds a query to provide maximum supported WriteBack width.

Change-Id: I2f3f2ca1f7783394bd05e860e846dab504dbe071
hwc: hwc_sync - populate correct fences for BLIT

Previously, the acquire and release fences for BLIT
composition were populated using same logic as Overlay,
but BLIT composition consists of separate BLIT step
before screen refresh, and app buffers are no longer
required after BLIT. So holding the buffers for both
the steps is unnecessary and impacts performance.

This change adds condition for BLIT in fence population
logic in hwc_sync and populates the right fences for the
App Buffers and Display Refresh during BLIT composition.

Change-Id: I9998a7052c0375acb32a174bdf0469d2a88f79e8
hwc: Reset FB Z order to -1 instead of 0

In Video-only mode FB Z-order of 0 was being used, incorrectly,
because the value was reset to 0 and wasn't changed subsequently.

Reset to -1 to prevent this. Any MDP comp strategy that needs to use
FB should set it's Z order appropriately.

If cache based mode has no MDP comp layers, fail so that other
strategies can be used, rather than succeeding with FB Z as 0, which
will at most allow GPU comp to be used.

Change-Id: Ifdae2cd5f8d8ff0e10447b1fed6ee1671260f311
h/q/d: Add missing ASTC format

Adds support for Khronos format COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR

Change-Id: I2ca2c548cbcca0c56f28d2158cb5a0d01a326f0f
Merge "hwc: vds: Add support for black frame generation on PWR suspend"
Merge "gralloc: Set default value for implementation defined formats"
Merge "hwc: vds: Configure WB as secure if output buf. handle is secure"
Merge "hwc: vds: Display HAL changes for VDS based solution"
Invoke a padding round in certain use-cases.

* In some use-cases, it is possible that there are
no AppBuffer layers on the external/virtual layer-list
during which all the pipes will be allocated to the
primary. When layers do comeup on external/virtual
layer-list, subsequent overlay sets fail.

* This change ensures that in such cases, we invoke a
padding round on all the displays to free up the
hw resources which can be used in subsequent cycles.

Change-Id: Ifac0b8f51a8719eb55b11010d05b8d11352db054
hwc: mdpcomp: Remove pipe estimation blocks

Pipe estimation was necessary when the unavailability from overlay
led to GPU fallback.
With the new design, hwc uses the next best strategy, so failure
to grab a pipe from overlay is ok.

Change-Id: Id20d2e6fd24aeb5af3ab84ec9dd8c52f6bbbef8b
Merge "hwc: hwc_sync - populate correct fences for BLIT"
Merge "hwc: Reset FB Z order to -1 instead of 0"
Merge "h/q/d: Add missing ASTC format"
libqservice: Use correct typecast in QService

Change typecasting from status_t to android::status_t as it requires
the caller to be in android namespace.

Change-Id: Ib5f21874bc691fe1bd5cb7a34d7a2de54a8cbe44
Merge "hwc: Add support to query max. supported WriteBack width"
Merge "libqservice: Use correct typecast in QService"