overlay: Do not clean up pipes at bootup for MDSS

The MDSS driver takes care of this cleanup itself.
Also - MDSS driver does not export the mixer info ioctl

Change-Id: I3b736dfaaf355d71fe999b89027aced75ca1e248
diff --git a/liboverlay/overlayUtils.cpp b/liboverlay/overlayUtils.cpp
index 207531a..d0f9457 100644
--- a/liboverlay/overlayUtils.cpp
+++ b/liboverlay/overlayUtils.cpp
@@ -153,44 +153,47 @@
 
 /* clears any VG pipes allocated to the fb devices */
 int initOverlay() {
-    msmfb_mixer_info_req  req;
-    mdp_mixer_info *minfo = NULL;
-    char name[64];
-    int fd = -1;
-    for(int i = 0; i < NUM_FB_DEVICES; i++) {
-        snprintf(name, 64, FB_DEVICE_TEMPLATE, i);
-        ALOGD("initoverlay:: opening the device:: %s", name);
-        fd = ::open(name, O_RDWR, 0);
-        if(fd < 0) {
-            ALOGE("cannot open framebuffer(%d)", i);
-            return -1;
-        }
-        //Get the mixer configuration */
-        req.mixer_num = i;
-        if (ioctl(fd, MSMFB_MIXER_INFO, &req) == -1) {
-            ALOGE("ERROR: MSMFB_MIXER_INFO ioctl failed");
-            close(fd);
-            return -1;
-        }
-        minfo = req.info;
-        for (int j = 0; j < req.cnt; j++) {
-            ALOGD("ndx=%d num=%d z_order=%d", minfo->pndx, minfo->pnum,
-                    minfo->z_order);
-            // except the RGB base layer with z_order of -1, clear any
-            // other pipes connected to mixer.
-            if((minfo->z_order) != -1) {
-                int index = minfo->pndx;
-                ALOGD("Unset overlay with index: %d at mixer %d", index, i);
-                if(ioctl(fd, MSMFB_OVERLAY_UNSET, &index) == -1) {
-                    ALOGE("ERROR: MSMFB_OVERLAY_UNSET failed");
-                    close(fd);
-                    return -1;
-                }
+    int mdpVersion = qdutils::MDPVersion::getInstance().getMDPVersion();
+    if (mdpVersion < qdutils::MDSS_V5) {
+        msmfb_mixer_info_req  req;
+        mdp_mixer_info *minfo = NULL;
+        char name[64];
+        int fd = -1;
+        for(int i = 0; i < NUM_FB_DEVICES; i++) {
+            snprintf(name, 64, FB_DEVICE_TEMPLATE, i);
+            ALOGD("initoverlay:: opening the device:: %s", name);
+            fd = ::open(name, O_RDWR, 0);
+            if(fd < 0) {
+                ALOGE("cannot open framebuffer(%d)", i);
+                return -1;
             }
-            minfo++;
+            //Get the mixer configuration */
+            req.mixer_num = i;
+            if (ioctl(fd, MSMFB_MIXER_INFO, &req) == -1) {
+                ALOGE("ERROR: MSMFB_MIXER_INFO ioctl failed");
+                close(fd);
+                return -1;
+            }
+            minfo = req.info;
+            for (int j = 0; j < req.cnt; j++) {
+                ALOGD("ndx=%d num=%d z_order=%d", minfo->pndx, minfo->pnum,
+                      minfo->z_order);
+                // except the RGB base layer with z_order of -1, clear any
+                // other pipes connected to mixer.
+                if((minfo->z_order) != -1) {
+                    int index = minfo->pndx;
+                    ALOGD("Unset overlay with index: %d at mixer %d", index, i);
+                    if(ioctl(fd, MSMFB_OVERLAY_UNSET, &index) == -1) {
+                        ALOGE("ERROR: MSMFB_OVERLAY_UNSET failed");
+                        close(fd);
+                        return -1;
+                    }
+                }
+                minfo++;
+            }
+            close(fd);
+            fd = -1;
         }
-        close(fd);
-        fd = -1;
     }
     return 0;
 }