qdutils : Read max mixer width from drivers.

Read the maximum width mixer can output from drivers
and consider this in identifying if dual pipes are required
to support a layer. So far above 2K dimensions we are using dual
pipes, but 8x39 mixer output can be upto 2560. So there is no
need of dual pipes as long as pipe data is less than this limit.
Compare layer/panel resolutions against this limit to deduce
if there is a need for dual pipes or split.

Change-Id: I52e1d28e381327d4f0b00f5ea8547c1e6157313c
diff --git a/libqdutils/mdp_version.cpp b/libqdutils/mdp_version.cpp
index 6b53522..48f7cb7 100644
--- a/libqdutils/mdp_version.cpp
+++ b/libqdutils/mdp_version.cpp
@@ -37,6 +37,12 @@
 
 #define TOKEN_PARAMS_DELIM  "="
 
+// chip variants have same major number and minor numbers usually vary
+// for e.g., MDSS_MDP_HW_REV_101 is 0x10010000
+//                                    1001       -  major number
+//                                        0000   -  minor number
+// 8x26 v1 minor number is 0000
+//      v2 minor number is 0001 etc..
 #ifndef MDSS_MDP_HW_REV_100
 #define MDSS_MDP_HW_REV_100 0x10000000 //8974 v1
 #endif
@@ -92,6 +98,10 @@
     mRGBHasNoScalar = false;
     mRotDownscale = false;
 
+    // this is the default limit of mixer unless driver reports it.
+    // For resolutions beyond this, we use dual/split overlay pipes.
+    mMaxMixerWidth = 2048;
+
     updatePanelInfo();
 
     if(!updateSysFsInfo()) {
@@ -279,6 +289,9 @@
                 } else if(!strncmp(tokens[0], "max_bandwidth_high",
                         strlen("max_bandwidth_high"))) {
                     mHighBw = atol(tokens[1]);
+                } else if(!strncmp(tokens[0], "max_mixer_width",
+                        strlen("max_mixer_width"))) {
+                    mMaxMixerWidth = atoi(tokens[1]);
                 } else if(!strncmp(tokens[0], "features", strlen("features"))) {
                     for(int i=1; i<index;i++) {
                         if(!strncmp(tokens[i], "bwc", strlen("bwc"))) {
diff --git a/libqdutils/mdp_version.h b/libqdutils/mdp_version.h
index 6c4a3f4..ced414e 100644
--- a/libqdutils/mdp_version.h
+++ b/libqdutils/mdp_version.h
@@ -57,17 +57,6 @@
     MDSS_V5     = 500,
 };
 
-// chip variants have same major number and minor numbers usually vary
-// for e.g., MDSS_MDP_HW_REV_101 is 0x10010000
-//                                    1001       -  major number
-//                                        0000   -  minor number
-// 8x26 v1 minor number is 0000
-//      v2 minor number is 0001 etc..
-
-enum {
-    MAX_DISPLAY_DIM = 2048,
-};
-
 #define NO_PANEL         '0'
 #define MDDI_PANEL       '1'
 #define EBI2_PANEL       '2'
@@ -140,6 +129,7 @@
     unsigned long getLowBw() { return mLowBw; }
     unsigned long getHighBw() { return mHighBw; }
     bool isRotDownscaleEnabled() { return mRotDownscale; }
+    int getMaxMixerWidth() const { return mMaxMixerWidth; }
     bool isSrcSplit() const;
     bool isSrcSplitAlways() const;
     bool isRGBScalarSupported() const;
@@ -177,6 +167,7 @@
     bool mSourceSplitAlways;
     bool mRGBHasNoScalar;
     bool mRotDownscale;
+    uint32_t mMaxMixerWidth; //maximum x-res of a given mdss mixer.
 };
 }; //namespace qdutils
 #endif //INCLUDE_LIBQCOMUTILS_MDPVER