hwc: Add support for panel resolution switch

Add support for panel resolution switch. This feature makes use of
the Linux modedb feature that lists available modes in
/sys/class/graphics/fb0/modes and accepts a mode change when written
to /sys/class/graphics/fb0/mode

Clients can link to APIs exposed in display_config.h, these
internally resolve to binder calls into HWC. For debugging, mode
changes can be made over binder using shell commands.
adb shell service call display.qservice CODE ARGS
ARGS can include config index and display (only primary supported)

setActiveConfig():
adb shell service call display.qservice 25 i32 INDEX i32 0
getActiveConfig():
adb shell service call display.qservice 26 i32 0
getConfigCount():
adb shell service call display.qservice 27 i32 0
getDisplayAttributes():
adb shell service call display.qservice 28 i32 INDEX i32 0

Change-Id: I97d34cc9c0e521a3bd5c948eeea6d1e07db7b7ff
diff --git a/libhwcomposer/hwc_fbupdate.cpp b/libhwcomposer/hwc_fbupdate.cpp
index ef83008..692ce29 100644
--- a/libhwcomposer/hwc_fbupdate.cpp
+++ b/libhwcomposer/hwc_fbupdate.cpp
@@ -49,11 +49,9 @@
     unsigned int size = 0;
     uint32_t xres = ctx->dpyAttr[mDpy].xres;
     uint32_t yres = ctx->dpyAttr[mDpy].yres;
-    if (ctx->dpyAttr[dpy].customFBSize) {
-        //GPU will render and compose at new resolution
-        //So need to have FB at new resolution
-        xres = ctx->dpyAttr[mDpy].xres_new;
-        yres = ctx->dpyAttr[mDpy].yres_new;
+    if (ctx->dpyAttr[dpy].fbScaling) {
+        xres = ctx->dpyAttr[mDpy].xresFB;
+        yres = ctx->dpyAttr[mDpy].yresFB;
     }
     getBufferAttributes((int)xres, (int)yres,
             HAL_PIXEL_FORMAT_RGBA_8888,
@@ -168,7 +166,7 @@
 
         // No FB update optimization on (1) Custom FB resolution,
         // (2) External Mirror mode, (3) External orientation
-        if(!ctx->dpyAttr[mDpy].customFBSize && !ctx->mBufferMirrorMode
+        if(!ctx->dpyAttr[mDpy].fbScaling && !ctx->mBufferMirrorMode
            && !ctx->mExtOrientation) {
             sourceCrop = fbUpdatingRect;
             displayFrame = fbUpdatingRect;
@@ -191,7 +189,7 @@
         } else if((mDpy && !extOrient
                   && !ctx->dpyAttr[mDpy].mMDPScalingMode)) {
             if(ctx->mOverlay->isUIScalingOnExternalSupported() &&
-                !ctx->dpyAttr[mDpy].customFBSize) {
+                !ctx->dpyAttr[mDpy].fbScaling) {
                 getNonWormholeRegion(list, sourceCrop);
                 displayFrame = sourceCrop;
             }
@@ -300,7 +298,7 @@
 
         // No FB update optimization on (1) Custom FB resolution,
         // (2) External Mirror mode, (3) External orientation
-        if(!ctx->dpyAttr[mDpy].customFBSize && !ctx->mBufferMirrorMode
+        if(!ctx->dpyAttr[mDpy].fbScaling && !ctx->mBufferMirrorMode
            && !ctx->mExtOrientation) {
             sourceCrop = fbUpdatingRect;
             displayFrame = fbUpdatingRect;
@@ -319,7 +317,7 @@
         } else if((mDpy && !extOrient
                   && !ctx->dpyAttr[mDpy].mMDPScalingMode)) {
             if(!qdutils::MDPVersion::getInstance().is8x26() &&
-                !ctx->dpyAttr[mDpy].customFBSize) {
+                !ctx->dpyAttr[mDpy].fbScaling) {
                 getNonWormholeRegion(list, sourceCrop);
                 displayFrame = sourceCrop;
             }
@@ -466,7 +464,7 @@
 
     // No FB update optimization on (1) Custom FB resolution,
     // (2) External Mirror mode, (3) External orientation
-    if(!ctx->dpyAttr[mDpy].customFBSize && !ctx->mBufferMirrorMode
+    if(!ctx->dpyAttr[mDpy].fbScaling && !ctx->mBufferMirrorMode
        && !ctx->mExtOrientation) {
         sourceCrop = fbUpdatingRect;
         displayFrame = fbUpdatingRect;
@@ -487,7 +485,7 @@
     } else if((mDpy && !extOrient
               && !ctx->dpyAttr[mDpy].mMDPScalingMode)) {
         if(!qdutils::MDPVersion::getInstance().is8x26() &&
-            !ctx->dpyAttr[mDpy].customFBSize) {
+            !ctx->dpyAttr[mDpy].fbScaling) {
             getNonWormholeRegion(list, sourceCrop);
             displayFrame = sourceCrop;
         }