sdm: Add support to get/set DSI clk.

CRs-Fixed: 2314107
Change-Id: I213edcaa61b33731b920b500a170e5a265909e47
diff --git a/libqdutils/display_config.cpp b/libqdutils/display_config.cpp
index 964640f..fc2e3dc 100644
--- a/libqdutils/display_config.cpp
+++ b/libqdutils/display_config.cpp
@@ -316,6 +316,60 @@
     return panel_brightness;
 }
 
+int setDsiClk(int dpy, uint64_t bitClk) {
+    status_t err = (status_t) FAILED_TRANSACTION;
+    sp<IQService> binder = getBinder();
+    Parcel inParcel, outParcel;
+
+    if(binder != NULL) {
+        inParcel.writeInt32(dpy);
+        inParcel.writeUint64(bitClk);
+        status_t err = binder->dispatch(IQService::SET_DSI_CLK, &inParcel, &outParcel);
+        if(err) {
+            ALOGE("%s() failed with err %d", __FUNCTION__, err);
+        }
+    }
+    return err;
+}
+
+uint64_t getDsiClk(int dpy) {
+    uint64_t dsi_clk = 0;
+    sp<IQService> binder = getBinder();
+    Parcel inParcel, outParcel;
+
+    if(binder != NULL) {
+        inParcel.writeInt32(dpy);
+        status_t err = binder->dispatch(IQService::GET_DSI_CLK, &inParcel, &outParcel);
+        if(!err) {
+            dsi_clk = outParcel.readUint64();
+        } else {
+            ALOGE("%s() failed with err %d", __FUNCTION__, err);
+        }
+    }
+    return dsi_clk;
+}
+
+int getSupportedBitClk(int dpy, std::vector<uint64_t>& bit_rates) {
+    sp<IQService> binder = getBinder();
+    Parcel inParcel, outParcel;
+
+    if(binder != NULL) {
+        inParcel.writeInt32(dpy);
+        status_t err = binder->dispatch(IQService::GET_SUPPORTED_DSI_CLK, &inParcel, &outParcel);
+        if(err) {
+            ALOGE("%s() failed with err %d", __FUNCTION__, err);
+            return err;
+        }
+    }
+
+    int32_t clk_levels = outParcel.readInt32();
+    while (clk_levels > 0) {
+      bit_rates.push_back(outParcel.readUint64());
+      clk_levels--;
+    }
+    return 0;
+}
+
 }// namespace
 
 // ----------------------------------------------------------------------------
diff --git a/libqdutils/display_config.h b/libqdutils/display_config.h
index 8373c90..c0952b0 100644
--- a/libqdutils/display_config.h
+++ b/libqdutils/display_config.h
@@ -30,6 +30,8 @@
 #ifndef _DISPLAY_CONFIG_H
 #define _DISPLAY_CONFIG_H
 
+#include <vector>
+
 #include <gralloc_priv.h>
 #include <qdMetaData.h>
 #include <hardware/hwcomposer.h>
@@ -160,6 +162,15 @@
 // Retrieves the current panel brightness value
 int getPanelBrightness();
 
+// Sets the specified bit clk value.
+int setDsiClk(int dpy, uint64_t bitClk);
+
+// Retrieves the current bit clk value.
+uint64_t getDsiClk(int dpy);
+
+// Get supported bit clk values.
+int getSupportedBitClk(int dpy, std::vector<uint64_t>& bit_rates);
+
 }; //namespace