sdm: Initial change for Dpps interface

Support DppsInterface in SDM to create and destroy Dpps server.
And DppsPropIntf provides functions to set and get Dpps properties.

CRs-Fixed: 2232100
Change-Id: I0ecf93ef994ba94ae1baf4f97031e257d30d3dcd
diff --git a/libdrmutils/drm_interface.h b/libdrmutils/drm_interface.h
index 2aeb337..b552a57 100644
--- a/libdrmutils/drm_interface.h
+++ b/libdrmutils/drm_interface.h
@@ -351,13 +351,20 @@
    * Arg: uint32_t - Connector ID
    * DRMPPFeatureInfo * - PP feature data pointer
    */
-   CONNECTOR_SET_POST_PROC,
+  CONNECTOR_SET_POST_PROC,
   /*
    * Op: Sets connector hdr metadata
    * Arg: uint32_t - Connector ID
    *      drm_msm_ext_hdr_metadata - hdr_metadata
    */
   CONNECTOR_SET_HDR_METADATA,
+  /*
+   * Op: Cache Dpps features.
+   * Arg: uint32_t - Object ID
+          uint32_t - Feature ID
+   *      uint64_t - Pointer to feature config data
+   */
+  DPPS_CACHE_FEATURE,
 };
 
 enum struct DRMRotation {
@@ -601,6 +608,56 @@
   uint32_t object_type;
 };
 
+enum DRMDPPSFeatureID {
+  // Ad4 properties
+  kFeatureAd4Mode,
+  kFeatureAd4Init,
+  kFeatureAd4Cfg,
+  kFeatureAd4Input,
+  kFeatureAd4Backlight,
+  kFeatureAd4Assertiveness,
+  kFeatureAd4ManualStrength,
+  // ABA properties
+  kFeatureAbaHistCtrl,
+  kFeatureAbaHistIRQ,
+  kFeatureAbaLut,
+  // BL scale properties
+  kFeatureAd4BlScale,
+  kFeatureBacklightScale,
+  // Events
+  kFeaturePowerEvent,
+  kFeatureAbaHistEvent,
+  kFeatureBackLightEvent,
+  kFeatureAdAttBlEvent,
+  // Insert features above
+  kDppsFeaturesMax,
+};
+
+struct DRMDppsFeatureInfo {
+  DRMDPPSFeatureID id;
+  uint32_t version;
+};
+
+enum AD4Modes {
+  kAd4Off,
+  kAd4AutoStrength,
+  kAd4Calibration,
+  kAd4Manual,
+  kAd4ModeMax,
+};
+
+enum HistModes {
+  kHistDisabled,
+  kHistEnabled,
+};
+
+struct DRMDppsEventInfo {
+  uint32_t object_type;
+  uint32_t event_type;
+  int drm_fd;
+  bool enable;
+};
+
 enum DRMCscType {
   kCscYuv2Rgb601L,
   kCscYuv2Rgb601FR,
@@ -638,16 +695,16 @@
 };
 
 struct DRMSolidfillStage {
- DRMRect bounding_rect {};
- bool is_exclusion_rect = false;
- uint32_t color = 0xff000000; // in 8bit argb
- uint32_t red = 0;
- uint32_t blue = 0;
- uint32_t green = 0;
- uint32_t alpha = 0xff;
- uint32_t color_bit_depth = 0;
- uint32_t z_order = 0;
- uint32_t plane_alpha = 0xff;
+  DRMRect bounding_rect {};
+  bool is_exclusion_rect = false;
+  uint32_t color = 0xff000000;  // in 8bit argb
+  uint32_t red = 0;
+  uint32_t blue = 0;
+  uint32_t green = 0;
+  uint32_t alpha = 0xff;
+  uint32_t color_bit_depth = 0;
+  uint32_t z_order = 0;
+  uint32_t plane_alpha = 0xff;
 };
 
 /* DRM Atomic Request Property Set.
@@ -767,6 +824,13 @@
    * [return]: Error code if the API fails, 0 on success.
    */
   virtual int SetScalerLUT(const DRMScalerLUTInfo &lut_info) = 0;
+
+  /*
+   * Get the DPPS feature info
+   * [input]: Dpps feature id, info->id
+   * [output]: Dpps feature version, info->version
+   */
+  virtual void GetDppsFeatureInfo(DRMDppsFeatureInfo *info) = 0;
 };
 
 }  // namespace sde_drm