hwc: Disable mixed mode composition for secure videos

Also make sure layer cache is used correctly when
we're not using MDP composition

Bug: 7643563
Change-Id: I4dcd70c2da128b2dcbe0b72dc14031983649719d
Signed-off-by: Iliyan Malchev <malchev@google.com>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
diff --git a/libhwcomposer/hwc.cpp b/libhwcomposer/hwc.cpp
index 4baf986..20ac9a5 100644
--- a/libhwcomposer/hwc.cpp
+++ b/libhwcomposer/hwc.cpp
@@ -123,11 +123,11 @@
         hwc_layer_1_t *fbLayer = &list->hwLayers[last];
         if(fbLayer->handle) {
             setListStats(ctx, list, HWC_DISPLAY_PRIMARY);
-            ctx->mLayerCache->updateLayerCache(list);
             reset_layer_prop(ctx, HWC_DISPLAY_PRIMARY);
             if(!MDPComp::configure(ctx, list)) {
                 VideoOverlay::prepare(ctx, list, HWC_DISPLAY_PRIMARY);
                 FBUpdate::prepare(ctx, fbLayer, HWC_DISPLAY_PRIMARY);
+                ctx->mLayerCache->updateLayerCache(list);
             }
         }
     }