mdssRotator:For Venus, rotator buffer size depends on rotated w/h

Due to alignment requirements on venus format, rotator buffer size
calculation needs to be performed according to destination buffer
dimensions. Due to these alignments, the buffer can be different
when width and height are swapped due to 90 degree rotation.

Change-Id: I8eb0f1ece22946e6c3b2106623c3457e6871fd9c
diff --git a/liboverlay/overlayMdssRot.cpp b/liboverlay/overlayMdssRot.cpp
index cb3c48f..60d63a2 100644
--- a/liboverlay/overlayMdssRot.cpp
+++ b/liboverlay/overlayMdssRot.cpp
@@ -119,6 +119,7 @@
 
 bool MdssRot::commit() {
     doTransform();
+    setBufSize(mRotInfo.src.format);
     mRotInfo.flags |= MDSS_MDP_ROT_ONLY;
     if(!overlay::mdp_wrapper::setOverlay(mFd.getFD(), mRotInfo)) {
         ALOGE("MdssRot commit failed!");
@@ -248,4 +249,10 @@
     ALOGE("== Dump MdssRot end ==");
 }
 
+void MdssRot::setBufSize(int format) {
+    if (format == MDP_Y_CBCR_H2V2_VENUS) {
+        mBufSize = VENUS_BUFFER_SIZE(COLOR_FMT_NV12, mRotInfo.dst_rect.w,
+                                     mRotInfo.dst_rect.h);
+    }
+}
 } // namespace overlay