(TEMP) hwc: external: Enable default mirroring on hwc1.1

Related to bug: 7124159

UI Mirror works with tearing because sync operates at primary vsync.  Need
kernel patch to wait on external post.

Change-Id: I77116ef40ae25a2207feb5ca3cd9065ef0da6e4a
Signed-off-by: Iliyan Malchev <malchev@google.com>
diff --git a/libhwcomposer/hwc_video.cpp b/libhwcomposer/hwc_video.cpp
index 3aa7e7a..170c29e 100644
--- a/libhwcomposer/hwc_video.cpp
+++ b/libhwcomposer/hwc_video.cpp
@@ -65,9 +65,11 @@
     switch(dpy) {
         case HWC_DISPLAY_PRIMARY:
             if(ctx->listStats[dpy].yuvCount == 1) {
-                newState = ovutils::OV_2D_VIDEO_ON_PANEL;
+                newState = isExternalActive(ctx) ?
+                    ovutils::OV_2D_VIDEO_ON_PANEL_TV : ovutils::OV_2D_VIDEO_ON_PANEL;
                 if(isSkipLayer(yuvLayer) && !isSecureBuffer(hnd)) {
-                    newState = ovutils::OV_CLOSED;
+                    newState = isExternalActive(ctx) ?
+                        ovutils::OV_2D_VIDEO_ON_TV : ovutils::OV_CLOSED;
                 }
             }
             break;
@@ -237,6 +239,13 @@
                 case ovutils::OV_2D_VIDEO_ON_PANEL:
                     ret &= configPrimVid(ctx, yuvLayer);
                     break;
+                case ovutils::OV_2D_VIDEO_ON_PANEL_TV:
+                    ret &= configPrimVid(ctx, yuvLayer);
+                    ret &= configExtVid(ctx, yuvLayer);
+                    break;
+                case ovutils::OV_2D_VIDEO_ON_TV:
+                    ret &= configExtVid(ctx, yuvLayer);
+                    break;
                 default:
                     return false;
             }
@@ -281,6 +290,24 @@
                         ret = false;
                     }
                     break;
+                case ovutils::OV_2D_VIDEO_ON_PANEL_TV:
+                    if (!ov.queueBuffer(hnd->fd, hnd->offset, ovutils::OV_PIPE0)) {
+                        ALOGE("%s: queueBuffer failed for primary", __FUNCTION__);
+                        ret = false;
+                    }
+                    // Play external
+                    if (!ov.queueBuffer(hnd->fd, hnd->offset, ovutils::OV_PIPE1)) {
+                        ALOGE("%s: queueBuffer failed for external", __FUNCTION__);
+                        ret = false;
+                    }
+                    break;
+                case ovutils::OV_2D_VIDEO_ON_TV:
+                    // Play external
+                    if (!ov.queueBuffer(hnd->fd, hnd->offset, ovutils::OV_PIPE1)) {
+                        ALOGE("%s: queueBuffer failed for external", __FUNCTION__);
+                        ret = false;
+                    }
+                    break;
                 default:
                     ret = false;
                     break;