hwcomposer : Fix cache redraw logic of MDP composition.

Redraw the cache if current frame cache/drop  data doesn't
match with cached frame data. Frame buffer z-order, fbcount
and mdp count are not reliable. With same fbz, fbcount and
mdpcount it is possible that layers in previous cached
frame are not part of current frame fb cache.

Change-Id: I858228dc1a3a8ab8673ab8d294e54fdbf43cc1ad
diff --git a/libhwcomposer/hwc_mdpcomp.h b/libhwcomposer/hwc_mdpcomp.h
index e1839cd..4aa21cc 100644
--- a/libhwcomposer/hwc_mdpcomp.h
+++ b/libhwcomposer/hwc_mdpcomp.h
@@ -108,10 +108,9 @@
     /* cached data */
     struct LayerCache {
         int layerCount;
-        int mdpCount;
-        int fbCount;
-        int fbZ;
         buffer_handle_t hnd[MAX_NUM_APP_LAYERS];
+        bool isFBComposed[MAX_NUM_APP_LAYERS];
+        bool drop[MAX_NUM_APP_LAYERS];
 
         /* c'tor */
         LayerCache();
@@ -119,6 +118,7 @@
         void reset();
         void cacheAll(hwc_display_contents_1_t* list);
         void updateCounts(const FrameInfo&);
+        bool isSameFrame(const FrameInfo& curFrame);
     };
 
     /* allocates pipe from pipe book */