Merge "hwc/overlay: Prevent pipes from switching mixers"
diff --git a/libhwcomposer/hwc_fbupdate.cpp b/libhwcomposer/hwc_fbupdate.cpp
index 86e3e66..7ba2ddc 100644
--- a/libhwcomposer/hwc_fbupdate.cpp
+++ b/libhwcomposer/hwc_fbupdate.cpp
@@ -286,15 +286,6 @@
 
         hwc_rect_t sourceCrop = layer->sourceCrop;
         hwc_rect_t displayFrame = layer->displayFrame;
-        // Do not use getNonWormholeRegion() function to calculate the
-        // sourceCrop during animation on external display.
-        if(ctx->listStats[mDpy].isDisplayAnimating && mDpy) {
-            sourceCrop = layer->displayFrame;
-            displayFrame = sourceCrop;
-        } else if(extOnlyLayerIndex == -1) {
-            getNonWormholeRegion(list, sourceCrop);
-            displayFrame = sourceCrop;
-        }
 
         const float xres = ctx->dpyAttr[mDpy].xres;
         //Default even split for all displays with high res
diff --git a/liboverlay/overlayMdssRot.cpp b/liboverlay/overlayMdssRot.cpp
index b8a2417..95f22c6 100644
--- a/liboverlay/overlayMdssRot.cpp
+++ b/liboverlay/overlayMdssRot.cpp
@@ -256,7 +256,7 @@
             mRotInfo.src.format); //mdss src and dst formats are same.
 
     if (mRotInfo.flags & ovutils::OV_MDSS_MDP_BWC_EN) {
-        opBufSize = calcCompressedBufSize();
+        opBufSize = calcCompressedBufSize(destWhf);
     } else {
         opBufSize = Rotator::calcOutputBufSize(destWhf);
     }
@@ -273,10 +273,10 @@
 }
 
 // Calculate the compressed o/p buffer size for BWC
-uint32_t MdssRot::calcCompressedBufSize() {
+uint32_t MdssRot::calcCompressedBufSize(const ovutils::Whf& destWhf) {
     uint32_t bufSize = 0;
-    int aWidth = ovutils::align(mRotInfo.src_rect.w, 64);
-    int aHeight = ovutils::align(mRotInfo.src_rect.h, 4);
+    int aWidth = ovutils::align(destWhf.w, 64);
+    int aHeight = ovutils::align(destWhf.h, 4);
     int rau_cnt = aWidth/64;
     int stride0 = (64 * 4 * rau_cnt) + rau_cnt/8;
     int stride1 = ((64 * 2 * rau_cnt) + rau_cnt/8) * 2;
diff --git a/liboverlay/overlayRotator.h b/liboverlay/overlayRotator.h
index 7f90160..a600732 100644
--- a/liboverlay/overlayRotator.h
+++ b/liboverlay/overlayRotator.h
@@ -205,7 +205,7 @@
      * knowing the o/p format depending on whether fastYuv is enabled or not */
     uint32_t calcOutputBufSize();
     // Calculate the compressed o/p buffer size for BWC
-    uint32_t calcCompressedBufSize();
+    uint32_t calcCompressedBufSize(const utils::Whf& destWhf);
 
     /* MdssRot info structure */
     mdp_overlay   mRotInfo;