sdm: Add support for adaptive variable refresh feature

1. Populate information about AVR feature support from sysfs node.
2. Initialize AVR information based on display mode and dynamic fps
   mode and set corresponding AVR flags.
3. Define debug property sdm.debug.disable_avr to disable avr feature.

Change-Id: I1bfbb9e1f9975468aa9eb6d6b575f317c658480e
CRs-Fixed: 1043833
diff --git a/sdm/include/private/hw_info_types.h b/sdm/include/private/hw_info_types.h
index e806d92..daf88ed 100644
--- a/sdm/include/private/hw_info_types.h
+++ b/sdm/include/private/hw_info_types.h
@@ -110,6 +110,11 @@
   kMultiRectParallelMode = 0x04,
 };
 
+enum HWAVRModes {
+  kContinuousMode,  // Mode to enable AVR feature for every frame.
+  kOneShotMode,     // Mode to enable AVR feature for particular frame.
+};
+
 typedef std::map<HWSubBlockType, std::vector<LayerBufferFormat>> FormatsMap;
 
 struct HWDynBwLimitInfo {
@@ -188,6 +193,7 @@
   FormatsMap supported_formats_map;
   HWRotatorInfo hw_rot_info;
   HWDestScalarInfo hw_dest_scalar_info;
+  bool has_avr = false;
 
   void Reset() { *this = HWResourceInfo(); }
 };
@@ -226,6 +232,7 @@
   int min_roi_height = 0;             // Min height needed for ROI
   bool needs_roi_merge = false;       // Merge ROI's of both the DSI's
   bool dynamic_fps = false;           // Panel Supports dynamic fps
+  bool dfps_porch_mode = false;       // dynamic fps VFP or HFP mode
   uint32_t min_fps = 0;               // Min fps supported by panel
   uint32_t max_fps = 0;               // Max fps supported by panel
   bool is_primary_panel = false;      // Panel is primary display
@@ -244,6 +251,7 @@
             (min_roi_height != panel_info.min_roi_height) ||
             (needs_roi_merge != panel_info.needs_roi_merge) ||
             (dynamic_fps != panel_info.dynamic_fps) || (min_fps != panel_info.min_fps) ||
+            (dfps_porch_mode != panel_info.dfps_porch_mode) ||
             (max_fps != panel_info.max_fps) || (is_primary_panel != panel_info.is_primary_panel) ||
             (split_info != panel_info.split_info) ||
             (s3d_mode != panel_info.s3d_mode));
@@ -386,6 +394,11 @@
 
 typedef std::map<uint32_t, HWDestScaleInfo *> DestScaleInfoMap;
 
+struct HWAVRInfo {
+  bool enable = false;                // Flag to Enable AVR feature
+  HWAVRModes mode = kContinuousMode;  // Specifies the AVR mode
+};
+
 struct HWPipeInfo {
   uint32_t pipe_id = 0;
   HWSubBlockType sub_block_type = kHWSubBlockMax;
@@ -436,6 +449,7 @@
   float output_compression = 1.0f;
   uint32_t bandwidth = 0;
   uint32_t clock = 0;
+  HWAVRInfo hw_avr_info = {};
 };
 
 struct HWDisplayAttributes : DisplayConfigVariableInfo {
diff --git a/sdm/include/utils/debug.h b/sdm/include/utils/debug.h
index 23ba181..74d3236 100644
--- a/sdm/include/utils/debug.h
+++ b/sdm/include/utils/debug.h
@@ -74,6 +74,7 @@
   static bool IsRotatorSplitDisabled();
   static bool IsScalarDisabled();
   static bool IsUbwcTiledFrameBuffer();
+  static bool IsAVRDisabled();
   static bool GetProperty(const char *property_name, char *value);
   static bool SetProperty(const char *property_name, const char *value);