hwc : Enable partial update if panel supports it.

Rely on panel info shared by driver and enable
partial update if it says as supported. Use the
existing property to disable partial update if
required for debugging.

Change-Id: I75d5dcbbfea08515d17150054ca91367319b929c
diff --git a/libhwcomposer/hwc_mdpcomp.cpp b/libhwcomposer/hwc_mdpcomp.cpp
index 8599392..40fa624 100644
--- a/libhwcomposer/hwc_mdpcomp.cpp
+++ b/libhwcomposer/hwc_mdpcomp.cpp
@@ -118,9 +118,13 @@
             sDebugLogs = true;
     }
 
-    if(property_get("persist.hwc.partialupdate", property, NULL) > 0) {
-        if((atoi(property) != 0) && ctx->mMDP.panel == MIPI_CMD_PANEL &&
-           qdutils::MDPVersion::getInstance().is8x74v2())
+    // We read from drivers if panel supports partial updating
+    // and we enable partial update computations if supported.
+    // Keeping this property to disable partial update for
+    // debugging by setting below property to 0 & only 0.
+    property_get("persist.hwc.partialupdate", property, "-1");
+    if((atoi(property) != 0) &&
+        qdutils::MDPVersion::getInstance().isPartialUpdateEnabled()) {
             sEnablePartialFrameUpdate = true;
     }
     ALOGE_IF(isDebug(), "%s: Partial Update applicable?: %d",__FUNCTION__,
diff --git a/libqdutils/mdp_version.h b/libqdutils/mdp_version.h
index 1a779cc..cace430 100644
--- a/libqdutils/mdp_version.h
+++ b/libqdutils/mdp_version.h
@@ -128,7 +128,10 @@
     bool supportsMacroTile();
     int getLeftSplit() { return mSplit.left(); }
     int getRightSplit() { return mSplit.right(); }
-    int isPartialUpdateEnabled() { return mPanelInfo.mPartialUpdateEnable; }
+    bool isPartialUpdateEnabled() {
+        return mPanelInfo.mPartialUpdateEnable &&
+                mPanelInfo.mType == MIPI_CMD_PANEL;
+    }
     int getLeftAlign() { return mPanelInfo.mLeftAlign; }
     int getWidthAlign() { return mPanelInfo.mWidthAlign; }
     int getTopAlign() { return mPanelInfo.mTopAlign; }