hwc: Allow for yuv content to go through ppp on 8x10

8x10 has overlay but it also allows for composition to go through
copybit.

Change-Id: I086aab118b03c1cbc7fa0dbc080ceb906310deab
diff --git a/libcopybit/copybit.cpp b/libcopybit/copybit.cpp
index 43b90d1..e641f2e 100644
--- a/libcopybit/copybit.cpp
+++ b/libcopybit/copybit.cpp
@@ -125,6 +125,7 @@
         case HAL_PIXEL_FORMAT_YCbCr_422_SP:  return MDP_Y_CRCB_H2V1;
         case HAL_PIXEL_FORMAT_YCbCr_420_SP:  return MDP_Y_CRCB_H2V2;
         case HAL_PIXEL_FORMAT_YCrCb_420_SP_ADRENO: return MDP_Y_CBCR_H2V2_ADRENO;
+        case HAL_PIXEL_FORMAT_YCbCr_420_SP_VENUS: return MDP_Y_CBCR_H2V2_ADRENO;
         case HAL_PIXEL_FORMAT_NV12_ENCODEABLE: return MDP_Y_CBCR_H2V2;
     }
     return -1;
diff --git a/libhwcomposer/hwc_copybit.cpp b/libhwcomposer/hwc_copybit.cpp
index 8cdf467..160e6da 100644
--- a/libhwcomposer/hwc_copybit.cpp
+++ b/libhwcomposer/hwc_copybit.cpp
@@ -72,7 +72,7 @@
 
 bool CopyBit::canUseCopybitForYUV(hwc_context_t *ctx) {
     // return true for non-overlay targets
-    if(ctx->mMDP.hasOverlay) {
+    if(ctx->mMDP.hasOverlay && ctx->mMDP.version >= qdutils::MDP_V4_0) {
        return false;
     }
     return true;
@@ -84,14 +84,6 @@
     int compositionType = qdutils::QCCompositionType::
                                     getInstance().getCompositionType();
 
-    if ((compositionType & qdutils::COMPOSITION_TYPE_C2D) ||
-        (compositionType & qdutils::COMPOSITION_TYPE_DYN)) {
-         if(ctx->listStats[dpy].yuvCount) {
-             //Overlay up & running. Dont use COPYBIT for RGB layers.
-             return false;
-         }
-    }
-
     if (compositionType & qdutils::COMPOSITION_TYPE_DYN) {
         // DYN Composition:
         // use copybit, if (TotalRGBRenderArea < threashold * FB Area)
@@ -181,6 +173,9 @@
         }
     }
 
+    // We cannot mix copybit layer with layers marked to be drawn on FB
+    if (!useCopybitForYUV && ctx->listStats[dpy].yuvCount)
+        return true;
 
     // numAppLayers-1, as we iterate till 0th layer index
     for (int i = ctx->listStats[dpy].numAppLayers-1; i >= 0 ; i--) {
@@ -197,6 +192,7 @@
             mCopyBitDraw = false;
             //There is no need to reset layer properties here as we return in
             //draw if mCopyBitDraw is false
+            break;
         }
     }
     return true;