hwc: Use max pipe width instead of max mixer width for splitting

Not necessarily the max width supported by the MDP pipe and mixer
need to be same. HWC has to make the decision for using one OR
two pipes per layer only based on the max width supported by the
pipe not the mixer.

Change-Id: I5a2495d07de1b6f54ef64d9140c909f0f4cef914
diff --git a/libhwcomposer/hwc_ad.cpp b/libhwcomposer/hwc_ad.cpp
index 7e96d97..b9cf5ce 100644
--- a/libhwcomposer/hwc_ad.cpp
+++ b/libhwcomposer/hwc_ad.cpp
@@ -134,7 +134,7 @@
         const hwc_layer_1_t* layer = &list->hwLayers[nYuvIndex];
         private_handle_t *hnd = (private_handle_t *)layer->handle;
         qdutils::MDPVersion& mdpHw =  qdutils::MDPVersion::getInstance();
-        if(hnd && hnd->width <= (int) mdpHw.getMaxMixerWidth()) {
+        if(hnd && hnd->width <= (int) mdpHw.getMaxPipeWidth()) {
             mDoable = true;
         }
     }
diff --git a/libhwcomposer/hwc_fbupdate.cpp b/libhwcomposer/hwc_fbupdate.cpp
index 58cf374..08a4fb9 100644
--- a/libhwcomposer/hwc_fbupdate.cpp
+++ b/libhwcomposer/hwc_fbupdate.cpp
@@ -529,7 +529,7 @@
     const uint32_t layerClock = getLayerClock(dstWidth, dstHeight, cropHeight);
     const uint32_t mixerClock = lSplit;
 
-    if((cropWidth > qdutils::MDPVersion::getInstance().getMaxMixerWidth()) or
+    if((cropWidth > qdutils::MDPVersion::getInstance().getMaxPipeWidth()) or
             (primarySplitAlways and
             (cropWidth > lSplit or layerClock > mixerClock))) {
         destR = ov.getPipe(pipeSpecs);
diff --git a/libhwcomposer/hwc_mdpcomp.cpp b/libhwcomposer/hwc_mdpcomp.cpp
index 4a04f60..c9e98c4 100644
--- a/libhwcomposer/hwc_mdpcomp.cpp
+++ b/libhwcomposer/hwc_mdpcomp.cpp
@@ -428,7 +428,7 @@
                 /* On targets that doesnt support Decimation (eg.,8x26)
                  * maximum downscale support is overlay pipe downscale.
                  */
-                if(crop_w > (int) mdpHw.getMaxMixerWidth() ||
+                if(crop_w > (int) mdpHw.getMaxPipeWidth() ||
                         w_dscale > maxMDPDownscale ||
                         h_dscale > maxMDPDownscale)
                     return false;
@@ -439,7 +439,7 @@
                      *      1. Src crop > Mixer limit on nonsplit MDPComp
                      *      2. exceeds maximum downscale limit
                      */
-                    if(((crop_w > (int) mdpHw.getMaxMixerWidth()) &&
+                    if(((crop_w > (int) mdpHw.getMaxPipeWidth()) &&
                                 !sSrcSplitEnabled) ||
                             w_dscale > maxMDPDownscale ||
                             h_dscale > maxMDPDownscale) {
@@ -2401,10 +2401,10 @@
     eDest rDest = mdp_info.rIndex;
 
     ALOGD_IF(isDebug(),"%s: configuring: layer: %p z_order: %d dest_pipeL: %d"
-             "dest_pipeR: %d",__FUNCTION__, layer, zOrder, lDest, rDest);
+            "dest_pipeR: %d",__FUNCTION__, layer, zOrder, lDest, rDest);
 
     return configureSplit(ctx, layer, mDpy, mdpFlagsL, zOrder, lDest,
-                            rDest, &PipeLayerPair.rot);
+            rDest, &PipeLayerPair.rot);
 }
 
 bool MDPCompSplit::draw(hwc_context_t *ctx, hwc_display_contents_1_t* list) {
@@ -2588,8 +2588,8 @@
     //pipe line length, we are still using 2 pipes. This is fine just because
     //this is source split where destination doesn't matter. Evaluate later to
     //see if going through all the calcs to save a pipe is worth it
-    if(dstWidth > mdpHw.getMaxMixerWidth() or
-            cropWidth > mdpHw.getMaxMixerWidth() or
+    if(dstWidth > mdpHw.getMaxPipeWidth() or
+            cropWidth > mdpHw.getMaxPipeWidth() or
             (primarySplitAlways and
             (cropWidth > lSplit or layerClock > mixerClock))) {
         pipe_info.rIndex = ctx->mOverlay->getPipe(pipeSpecs);
diff --git a/libhwcomposer/hwc_utils.cpp b/libhwcomposer/hwc_utils.cpp
index ace0017..d45b39a 100644
--- a/libhwcomposer/hwc_utils.cpp
+++ b/libhwcomposer/hwc_utils.cpp
@@ -86,7 +86,7 @@
 
 bool isValidResolution(hwc_context_t *ctx, uint32_t xres, uint32_t yres)
 {
-    return !((xres > qdutils::MDPVersion::getInstance().getMaxMixerWidth() &&
+    return !((xres > qdutils::MDPVersion::getInstance().getMaxPipeWidth() &&
                 !isDisplaySplit(ctx, HWC_DISPLAY_PRIMARY)) ||
             (xres < MIN_DISPLAY_XRES || yres < MIN_DISPLAY_YRES));
 }
@@ -2353,7 +2353,7 @@
 
 bool isDisplaySplit(hwc_context_t* ctx, int dpy) {
     qdutils::MDPVersion& mdpHw = qdutils::MDPVersion::getInstance();
-    if(ctx->dpyAttr[dpy].xres > mdpHw.getMaxMixerWidth()) {
+    if(ctx->dpyAttr[dpy].xres > mdpHw.getMaxPipeWidth()) {
         return true;
     }
     //For testing we could split primary via device tree values
@@ -2520,7 +2520,7 @@
         swap(src_w, src_h);
     }
     //src width > MAX mixer supported dim
-    if(src_w > (int) qdutils::MDPVersion::getInstance().getMaxMixerWidth()) {
+    if(src_w > (int) qdutils::MDPVersion::getInstance().getMaxPipeWidth()) {
         return;
     }
     //Decimation necessary, cannot use BWC. H/W requirement.
diff --git a/libhwcomposer/hwc_utils.h b/libhwcomposer/hwc_utils.h
index 286ae22..2e15cc5 100644
--- a/libhwcomposer/hwc_utils.h
+++ b/libhwcomposer/hwc_utils.h
@@ -459,9 +459,9 @@
 
 // Returns true if the buffer is yuv and exceeds the mixer width
 static inline bool isYUVSplitNeeded(const private_handle_t* hnd) {
-    int maxMixerWidth = qdutils::MDPVersion::getInstance().getMaxMixerWidth();
+    int maxPipeWidth = qdutils::MDPVersion::getInstance().getMaxPipeWidth();
     return (hnd && (hnd->bufferType == BUFFER_TYPE_VIDEO) &&
-            (hnd->width > maxMixerWidth));
+            (hnd->width > maxPipeWidth));
 }
 
 // Returns true if the buffer is secure