hwc: pass nv12 surfaces to gc320

Rebased from p-ics-mr1:
e2479b9 hwc: pass nv12 surfaces to gc320

Change-Id: I3f161273aa40da2ced869b7b60f2e9fe76cac3bf
Signed-off-by: Craig Stout <craig.stout@ti.com>
hwc: fix and simplify the idle timeout logic

Fixes the following issue : when non-blended layers are composited
via overlays and blended layers are composited via FB, the idle timeout
does not yield invalidation and re-composition of the layers via SGX
resulting in the increased power consumption when the UI is idle.

The change simplifies the idle timeout logic as follows : SGX only
composition is forced after the idle timeout.

Rebased from p-ics-mr1:
4573812 hwc: fix and simplify the idle timeout logic

Change-Id: I37216892536a6900b5fb58c0e6ac616ef3f3ef72
Signed-off-by: Dima Svetlov <svetlov@ti.com>
hwc: Support HDMI as primary display

This patch disables mirroring/docking logic when HDMI display
is used as primary instead of LCD panel.

Based on patch from Mark Tyler.

Rebased from p-ics-mr1:
9dd8ccd Support HDMI as primary display

Change-Id: Idd239a562bfc486e128b268fa31ced53412bba3a
Signed-off-by: Mykola Ostrovskyy <mykola@ti.com>
Signed-off-by: Muralidhar Dixit <murali.dixit@ti.com>
Signed-off-by: Tony Lofthouse <a0741364@ti.com>
hwc: Add support for FB scaling and cloning

Patch contains following features
1)Large frame buffer support:
     Transformation matrix for LCD and HDMI added
     to ensure correct composition and renderring
     of all UI layers
     Added support for overlay distrubution based
     on FB size and target display
2)Default HDMI display support
     Support for default HDMI display selection.
     Added HDMI best mode selection on HPD

Rebased from p-ics-mr1:
96ad001 hwc: Add support for FB scaling and cloning

Change-Id: Ia6f06d5e149656c4d79ac2d3983211a253bb3969
Signed-off-by: Lajos Molnar <molnar@ti.com>
Signed-off-by: Muralidhar Dixit <murali.dixit@ti.com>
Signed-off-by: Dandawate Saket <dsaket@ti.com>
hwc: rgz: support layers with the HWC_HINT_CLEAR_FB hint

Allow the regionizer to ignore (and clear if needed) a region
with a layer requesting to clear the framebuffer with a hint.
This mimics what SurfaceFlinger does when the HWC requests to
clear a layer area with transparent pixels.

Rebased from p-ics-mr1:
3c9a753 hwc: rgz: support layers with the HWC_HINT_CLEAR_FB hint

Change-Id: If61a4f50d0315eb23119d7b97b0f2cb5f994806f
Signed-off-by: Gustavo Diaz Prado <a0273371@ti.com>
hwc: regionizer: Batch flags fixes

+ Removed BVBATCH_DST since the destination parameters (buffdesc
  and geometry) are not changing while performing blending within
  a batch.
+ Removed BVBATCH_SRC2RECT_SIZE, the rectangle size never changes
  while constructing blits within a horizontal subregion.
+ Added BVBATCH_SRC1RECT_ORIGIN, it's highly possible the src1 origin
  changes from a previous blit within the batch, a good example is the
  volume pop blended on top of the widget and wallpaper layers in the
  Android homescreen.

This change doesn't address batch flags while scaling, those will
be revisited later when the GC driver supports it.

Rebased from p-ics-mr1 (also cleaned up commit msg):
93b69ce hwc: regionizer: Batch flags fixes

Change-Id: I9b85dce832b391e347aab93800e0b22e67072227
Signed-off-by: Gustavo Diaz Prado <a0273371@ti.com>
hwc: regionizer: Add asynchronous blits support

Regionizer adds the BVFLAG_ASYNC to all the blits, except for the
last one which is made synchronous. The last blit acts like a
fence to let the previous asynchronous blits to finish first.

Support in the GC driver must be present for this feature to work
properly.

Rebased from p-ics-mr1:
822ec12 hwc: regionizer: Add asynchronous blits support

Change-Id: Iec32de51e7d0b95d1b780e60ed4848e8daf7977f
Signed-off-by: Gustavo Diaz Prado <a0273371@ti.com>
hwc: regionizer: Give support for rotation with Bltsville

Enables the regionizer to support rotation with Bltsville.
This patch doesn't enable horizontal/vertical flips yet.

Rebased from p-ics-mr1:
bd6d0b5 hwc: regionizer: Give support for rotation with Bltsville

Change-Id: I595debea076727ef2c442d7544c1e355aef04808
Signed-off-by: Gustavo Diaz Prado <a0273371@ti.com>
Signed-off-by: Tony Lofthouse <a0741364@ti.com>
hwc: rgz: Disable NV12 rotation support for the regionizer

There is a bug when rotating NV12 buffers with the GC driver,
disable this for now until it is fixed.

Rebased from p-ics-mr1:
7c46d80 hwc: rgz: Disable NV12 rotation support for the regionizer

Change-Id: Ia3add3266bd308fec34cb2b9140146d1da07f7ec
Signed-off-by: Gustavo Diaz Prado <a0273371@ti.com>
hwc: rgz: Workaround for hdmi hotplug crash with 2D blitter enabled

When the hdmi cable is connected a hotplug event is triggered, this
forces the DSS to exhaust the pipes available in most situations
so the 2D blitter is used to handle some layers.

When the cable is connected/disconnected it's highly possible a
geometry change doesn't happen right away (or it may not happen)
leading the region data to be invalid and not recalculated for an
instant, this ends up in sending to the blitter incorrect src
rectangle origins and sizes, most of the time this leads to L3
errors making the system unstable and unable to recover.

Rebased from p-ics-mr1:
104249c hwc: rgz: Workaround for hdmi hotplug crash with 2D blitter enabled

Change-Id: Ie1675d0a0dd03e69fac80dd51cee006fcd6f8791
Signed-off-by: Gustavo Diaz Prado <a0273371@ti.com>
hwc: rgz: Fix dirty region not working when blitting only one layer

The dirty region handling doesn't work properly when only one
layer is being blitted. The problem was the screen dirty state was
only set to zero when one layer reaches the dirty count to zero. In
case only one layer was being blitted the dirty region handling
is never triggered making the empty areas to be cleared on every
frame even if it was not needed.

This patch removes the screen dirty flag and instead introduces
a dirty count for the background and layers with the clear fb hint
as well, since we don't care about the handle, the dirty count
is decreased on every frame, in this way the dirty region handling
sees the background and layers with the clear fb hint as any other
layer.

Rebased from p-ics-mr1:
11e5f7e hwc: rgz: Fix dirty region not working when blitting only one layer

Change-Id: Ifbb111ce7738cd097e74ac01e2c48f3994857416
Signed-off-by: Gustavo Diaz Prado <a0273371@ti.com>

Conflicts:

	hwc/rgz_2d.c

Signed-off-by: Tony Lofthouse <a0741364@ti.com>
hwc: publicly define omap specific usage flags

Rebased from p-ics-mr1:
8323a55 hwc: publicly define omap specific usage flags

Change-Id: I3bd14ca2d88192299de731c49eba15a90084b3fe
Signed-off-by: Tony Lofthouse <a0741364@ti.com>
fix merge