display: Add support for dynamic refresh rate

- The primary panels refresh rate can be change by clients
- Required refresh rate will be set by client using metadata
- If there are multiple clients requesting, it will be used only
  when the refresh rates are equal, else it resets to default
- Set the new refresh rate only when there are only YUV layers
  updating or when the list has only one RGB layer updating
- MdpVersion gets the dyn fps capabilities from panelInfo

Change-Id: If3e7e6b2f028eb301399c4d32c748eed8a97c41f
diff --git a/libhwcomposer/hwc_utils.h b/libhwcomposer/hwc_utils.h
index 4858b3a..9d1e7c0 100644
--- a/libhwcomposer/hwc_utils.h
+++ b/libhwcomposer/hwc_utils.h
@@ -80,6 +80,8 @@
 };
 
 struct DisplayAttributes {
+    uint32_t refreshRate;
+    uint32_t dynRefreshRate;
     uint32_t vsync_period; //nanos
     uint32_t xres;
     uint32_t yres;
@@ -137,6 +139,8 @@
     // Secure RGB specific
     int secureRGBCount;
     int secureRGBIndices[MAX_NUM_APP_LAYERS];
+    //dyn refresh rate-Client requested refreshrate
+    uint32_t refreshRateRequest;
 };
 
 //PTOR Comp info
@@ -305,6 +309,8 @@
 void getAspectRatioPosition(hwc_context_t* ctx, int dpy, int extOrientation,
                                 hwc_rect_t& inRect, hwc_rect_t& outRect);
 
+void setRefreshRate(hwc_context_t *ctx, int dpy, uint32_t refreshRate);
+
 bool isPrimaryPortrait(hwc_context_t *ctx);
 
 bool isOrientationPortrait(hwc_context_t *ctx);