hwc/overlay: Video on 4k2k external, 4k2k rotation.

-Add support for Video via overlay on 4k2k external panel.
-Add support for rotating videos on 4k2k panels. We use
pre-rotation in hwc to rotate a video into a single buffer,
irrespective of panel size. Then this buffer is fed to MDP.
Rotator objects are managed by the new RotMgr.
-Cleaup mdpcomp and overlay.

Change-Id: Ifb08534747e8e18b6c58dd8a3e1a9947409100f1
diff --git a/liboverlay/overlayCtrlData.h b/liboverlay/overlayCtrlData.h
index c9a4949..5395834 100644
--- a/liboverlay/overlayCtrlData.h
+++ b/liboverlay/overlayCtrlData.h
@@ -58,15 +58,13 @@
     bool close();
 
     /* set source using whf, orient and wait flag */
-    bool setSource(const utils::PipeArgs& args);
+    void setSource(const utils::PipeArgs& args);
     /* set crop info and pass it down to mdp */
-    bool setCrop(const utils::Dim& d);
+    void setCrop(const utils::Dim& d);
     /* set orientation */
-    bool setTransform(const utils::eTransform& p);
-    /* set whether rotator can be used */
-    void setRotatorUsed(const bool& rotUsed);
+    void setTransform(const utils::eTransform& p);
     /* set mdp position using dim */
-    bool setPosition(const utils::Dim& dim);
+    void setPosition(const utils::Dim& dim);
     /* mdp set overlay/commit changes */
     bool commit();
 
@@ -74,40 +72,21 @@
     int  getPipeId() const;
     /* ctrl fd */
     int  getFd() const;
-
-    /* access for screen info */
-    utils::ScreenInfo getScreenInfo() const;
-
-    /* retrieve cached crop data */
+    /* retrieve crop data */
     utils::Dim getCrop() const;
-
-    /* Perform transformation calculations */
-    void doTransform();
-
-    /* Performs downscale calculations */
-    void doDownscale(int dscale_factor);
-
-    /* Get downscale factor */
-    int getDownscalefactor();
-
-    /* Update the src format */
-    void updateSrcformat(const uint32_t& inputsrcFormat);
-
+    utils::Dim getPosition() const;
+    /* Set downscale */
+    void setDownscale(int dscale_factor);
+    /* Update the src format based on rotator's dest */
+    void updateSrcFormat(const uint32_t& rotDstFormat);
     /* dump the state of the object */
     void dump() const;
-
     /* Return the dump in the specified buffer */
     void getDump(char *buf, size_t len);
 
 private:
-    /* Retrieve screen info from underlying mdp */
-    bool getScreenInfo(utils::ScreenInfo& info);
-
     // mdp ctrl struct(info e.g.)
     MdpCtrl mMdp;
-
-    /* Screen info */
-    utils::ScreenInfo mInfo;
 };
 
 
@@ -115,28 +94,20 @@
 public:
     /* init, reset */
     explicit Data();
-
     /* calls close */
     ~Data();
-
     /* init fd etc */
     bool init(uint32_t fbnum);
-
     /* calls underlying mdp close */
     bool close();
-
     /* set overlay pipe id in the mdp struct */
     void setPipeId(int id);
-
     /* get overlay id in the mdp struct */
     int getPipeId() const;
-
     /* queue buffer to the overlay */
     bool queueBuffer(int fd, uint32_t offset);
-
     /* sump the state of the obj */
     void dump() const;
-
     /* Return the dump in the specified buffer */
     void getDump(char *buf, size_t len);
 
@@ -171,17 +142,44 @@
     return true;
 }
 
-inline bool Ctrl::commit() {
-    if(!mMdp.set()) {
-        ALOGE("Ctrl commit failed set overlay");
+inline bool Ctrl::init(uint32_t fbnum) {
+    // MDP/FD init
+    if(!mMdp.init(fbnum)) {
+        ALOGE("Ctrl failed to init fbnum=%d", fbnum);
         return false;
     }
     return true;
 }
 
-inline bool Ctrl::getScreenInfo(utils::ScreenInfo& info) {
-    if(!mMdp.getScreenInfo(info)){
-        ALOGE("Ctrl failed to get screen info");
+inline void Ctrl::setSource(const utils::PipeArgs& args)
+{
+    mMdp.setSource(args);
+}
+
+inline void Ctrl::setPosition(const utils::Dim& dim)
+{
+    mMdp.setPosition(dim);
+}
+
+inline void Ctrl::setTransform(const utils::eTransform& orient)
+{
+    mMdp.setTransform(orient);
+}
+
+inline void Ctrl::setCrop(const utils::Dim& d)
+{
+    mMdp.setCrop(d);
+}
+
+inline void Ctrl::dump() const {
+    ALOGE("== Dump Ctrl start ==");
+    mMdp.dump();
+    ALOGE("== Dump Ctrl end ==");
+}
+
+inline bool Ctrl::commit() {
+    if(!mMdp.set()) {
+        ALOGE("Ctrl commit failed set overlay");
         return false;
     }
     return true;
@@ -195,28 +193,20 @@
     return mMdp.getFd();
 }
 
-inline void Ctrl::updateSrcformat(const uint32_t& inputsrcFormat) {
-    mMdp.updateSrcformat(inputsrcFormat);
-}
-
-inline utils::ScreenInfo Ctrl::getScreenInfo() const {
-    return mInfo;
+inline void Ctrl::updateSrcFormat(const uint32_t& rotDstFmt) {
+    mMdp.updateSrcFormat(rotDstFmt);
 }
 
 inline utils::Dim Ctrl::getCrop() const {
     return mMdp.getSrcRectDim();
 }
 
-inline void Ctrl::doTransform() {
-    return mMdp.doTransform();
+inline utils::Dim Ctrl::getPosition() const {
+    return mMdp.getDstRectDim();
 }
 
-inline void Ctrl::doDownscale(int dscale_factor) {
-    mMdp.doDownscale(dscale_factor);
-}
-
-inline int Ctrl::getDownscalefactor() {
-    return mMdp.getDownscalefactor();
+inline void Ctrl::setDownscale(int dscale_factor) {
+    mMdp.setDownscale(dscale_factor);
 }
 
 inline void Ctrl::getDump(char *buf, size_t len) {