Limit #ROT-SESSIONS to 4 in LayerRotMap and RotMgr

* Limit the number of rotator sessions to 4 both in
LayerRotMap and RotMgr structures

* Make use of MDPVersion getter fuctions to check
for maxMixerWidth and maxDownScale supported by MDP

Change-Id: I27dac877807fbb4ed6fcb3500a3a318a2ef5d8b2
diff --git a/liboverlay/overlayUtils.cpp b/liboverlay/overlayUtils.cpp
index 0e063ab..1a97948 100644
--- a/liboverlay/overlayUtils.cpp
+++ b/liboverlay/overlayUtils.cpp
@@ -285,15 +285,16 @@
     vertDeci = 0;
     float horDscale = ceilf((float)src_w / (float)dst_w);
     float verDscale = ceilf((float)src_h / (float)dst_h);
+    qdutils::MDPVersion& mdpHw = qdutils::MDPVersion::getInstance();
 
     //Next power of 2, if not already
     horDscale = powf(2.0f, ceilf(log2f(horDscale)));
     verDscale = powf(2.0f, ceilf(log2f(verDscale)));
 
-    //Since MDP can do 1/4 dscale and has better quality, split the task
+    //Since MDP can do downscale and has better quality, split the task
     //between decimator and MDP downscale
-    horDscale /= 4.0f;
-    verDscale /= 4.0f;
+    horDscale /= (float)mdpHw.getMaxMDPDownscale();
+    verDscale /= (float)mdpHw.getMaxMDPDownscale();
 
     if((int)horDscale)
         horzDeci = (uint8_t)log2f(horDscale);
@@ -301,7 +302,7 @@
     if((int)verDscale)
         vertDeci = (uint8_t)log2f(verDscale);
 
-    if(src_w > 2048) {
+    if(src_w > mdpHw.getMaxMixerWidth()) {
         //If the client sends us something > what a layer mixer supports
         //then it means it doesn't want to use split-pipe but wants us to
         //decimate. A minimum decimation of 2 will ensure that the width is