hwc: Do not compose RGB layers for virtual displays

This is a temporary workaround to unblock HWC 1.3

b/8316155 - Implement HWComposer 1.3 w/ virtual display support
Change-Id: Ie877ec459916fb6c05ef9781e41900b661f4f489
Signed-off-by: Iliyan Malchev <malchev@google.com>
diff --git a/msm8974/libhwcomposer/hwc_mdpcomp.cpp b/msm8974/libhwcomposer/hwc_mdpcomp.cpp
index 53096cc..4e96991 100644
--- a/msm8974/libhwcomposer/hwc_mdpcomp.cpp
+++ b/msm8974/libhwcomposer/hwc_mdpcomp.cpp
@@ -435,6 +435,14 @@
         return false;
     }
 
+    /* XXX: There is some flicker currently seen with partial
+     * MDP composition on the virtual display.
+     * Disable UI MDP comp on virtual until it is fixed*/
+
+    if(mDpy > HWC_DISPLAY_EXTERNAL) {
+        return false;
+    }
+
     const int numAppLayers = ctx->listStats[mDpy].numAppLayers;
     for(int i = 0; i < numAppLayers; i++) {
         hwc_layer_1_t* layer = &list->hwLayers[i];
@@ -516,6 +524,14 @@
         return false;
     }
 
+    /* XXX: There is some flicker currently seen with partial
+     * MDP composition on the virtual display.
+     * Disable UI MDP comp on virtual until it is fixed*/
+
+    if(mDpy > HWC_DISPLAY_EXTERNAL) {
+        return false;
+    }
+
     if(mdpCount > (sMaxPipesPerMixer - 1)) { // -1 since FB is used
         ALOGD_IF(isDebug(), "%s: Exceeds MAX_PIPES_PER_MIXER",__FUNCTION__);
         return false;