overlay: Fix rotator output buffer size.

Fix rotator output buffer size for mdp and mdss rotators.
Output size is based on rotated width & height.
Output format can be different than source format.
It could be same if using mdss rot or using fastyuv mode in mdp rot.
Deprecate the static mapping of rotator input and output formats.
Driver will be responsible for correctly populating the dest format that its
wishes to use.

Change-Id: I17352d6d460cac24eb97083aed38668929c66807
diff --git a/liboverlay/overlayRotator.cpp b/liboverlay/overlayRotator.cpp
index 956ea2b..90a1e7a 100644
--- a/liboverlay/overlayRotator.cpp
+++ b/liboverlay/overlayRotator.cpp
@@ -20,6 +20,7 @@
 #include "overlayRotator.h"
 #include "overlayUtils.h"
 #include "mdp_version.h"
+#include "gr.h"
 
 namespace ovutils = overlay::utils;
 
@@ -39,6 +40,15 @@
     }
 }
 
+uint32_t Rotator::calcOutputBufSize(const utils::Whf& destWhf) {
+    //dummy aligned w & h.
+    int alW = 0, alH = 0;
+    int halFormat = ovutils::getHALFormat(destWhf.format);
+    //A call into gralloc/memalloc
+    return getBufferSizeAndDimensions(
+            destWhf.w, destWhf.h, halFormat, alW, alH);
+}
+
 int Rotator::getRotatorHwType() {
     int mdpVersion = qdutils::MDPVersion::getInstance().getMDPVersion();
     if (mdpVersion == qdutils::MDSS_V5)