hwc: Add support for perf display hint

- Set the perf hint when there is only one updating layer, which helps
  in reducing cpu params and thus reduce power.
- This feature is enabled with the property persist.mdpcomp_perfhint,
  which is set to a positive value, which will be the window of frames
  before the perf hint is set

CRs-fixed: 765460
Change-Id: Ie21e1cd201afab16bedd3c750ea3b0230769969a
diff --git a/libhwcomposer/hwc_mdpcomp.h b/libhwcomposer/hwc_mdpcomp.h
index 4978182..302b047 100644
--- a/libhwcomposer/hwc_mdpcomp.h
+++ b/libhwcomposer/hwc_mdpcomp.h
@@ -247,6 +247,10 @@
             hwc_display_contents_1_t* list);
     /* checks for conditions to enable partial udpate */
     bool canPartialUpdate(hwc_context_t *ctx, hwc_display_contents_1_t* list);
+    // Checks if only videocontent is updating
+    bool onlyVideosUpdating(hwc_context_t *ctx, hwc_display_contents_1_t* list);
+    static bool loadPerfLib();
+    void setPerfHint(hwc_context_t *ctx, hwc_display_contents_1_t* list);
 
     int mDpy;
     static bool sEnabled;
@@ -269,6 +273,12 @@
     bool allocSplitVGPipesfor4k2k(hwc_context_t *ctx, int index);
     //Enable Partial Update for MDP3 targets
     static bool enablePartialUpdateForMDP3;
+    static void *sLibPerfHint;
+    static int sPerfLockHandle;
+    static int (*sPerfLockAcquire)(int, int, int*, int);
+    static int (*sPerfLockRelease)(int value);
+    static int sPerfHintWindow;
+
 };
 
 class MDPCompNonSplit : public MDPComp {