libhwcomposer: Allow 2 YUV layer frames to use MDP composition

This change introduces the following changes:
- Frames having 2 yuv layer can be bypassed
- if not handled by MDP comp, video path will not
  handle any such frames and will be FB rendered

Change-Id: Id211dbc185608c482badbca00a2708fa6138a8e5
diff --git a/libhwcomposer/hwc_utils.cpp b/libhwcomposer/hwc_utils.cpp
index 7a3adbb..e1f413c 100644
--- a/libhwcomposer/hwc_utils.cpp
+++ b/libhwcomposer/hwc_utils.cpp
@@ -172,15 +172,17 @@
 
     ctx->listStats[dpy].numAppLayers = list->numHwLayers - 1;
     ctx->listStats[dpy].fbLayerIndex = list->numHwLayers - 1;
-    ctx->listStats[dpy].yuvCount = 0;
-    ctx->listStats[dpy].yuvIndex = -1;
     ctx->listStats[dpy].skipCount = 0;
     ctx->listStats[dpy].needsAlphaScale = false;
+    ctx->listStats[dpy].yuvCount = 0;
 
     for (size_t i = 0; i < list->numHwLayers; i++) {
         hwc_layer_1_t const* layer = &list->hwLayers[i];
         private_handle_t *hnd = (private_handle_t *)layer->handle;
 
+        //reset stored yuv index
+        ctx->listStats[dpy].yuvIndices[i] = -1;
+
         if(list->hwLayers[i].compositionType == HWC_FRAMEBUFFER_TARGET) {
             continue;
         //We disregard FB being skip for now! so the else if
@@ -192,8 +194,9 @@
             ctx->listStats[dpy].needsAlphaScale = isAlphaScaled(layer);
 
         if (UNLIKELY(isYuvBuffer(hnd))) {
-            ctx->listStats[dpy].yuvCount++;
-            ctx->listStats[dpy].yuvIndex = i;
+            int& yuvCount = ctx->listStats[dpy].yuvCount;
+            ctx->listStats[dpy].yuvIndices[yuvCount] = i;
+            yuvCount++;
         }
     }
 }