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_utils.h b/libhwcomposer/hwc_utils.h
index 23157d4..392fd61 100644
--- a/libhwcomposer/hwc_utils.h
+++ b/libhwcomposer/hwc_utils.h
@@ -112,12 +112,6 @@
     int mAsWidthRatio;
     int mAsHeightRatio;
 
-    //If property fbsize set via adb shell debug.hwc.fbsize = XRESxYRES
-    //following fields are used.
-    bool customFBSize;
-    uint32_t xres_new;
-    uint32_t yres_new;
-
     // This is the 3D mode to which the TV is set
     // The mode may be set via the appearance of a layer with 3D format
     // or by forcing the mode via binder.
@@ -130,6 +124,18 @@
     // HDMI_S3D_NONE
     int s3dMode;
     bool s3dModeForced;
+    //If property fbsize set via adb shell debug.hwc.fbsize = XRESxYRES
+    //following fields are used.
+    //Also used when the actual panel's dimensions change and FB remains
+    //constant
+    bool fbScaling;
+    uint32_t xresFB; //FB's width, by default from VSCREEN overridden by prop
+    uint32_t yresFB; //FB's height, by default from VSCREEN overridden by prop
+    float fbWidthScaleRatio; // Panel Width / FB Width
+    float fbHeightScaleRatio; // Panel Height / FB Height
+    //If configuration changed dynamically without subsequent GEOMETRY changes
+    //we may still need to adjust destination params
+    bool configSwitched;
 };
 
 struct ListStats {