hwc: vd: Add support for Dynamic Resolution Change (DRC)

1. Add support for Dynamic Resolution Change

We add support for DRC on virtual displays. This is achieved
by reading the width and height attributes that are set as
part of the buffer handle metadata.

For the WFD use cases, the WFD  MultiMedia framework will
update the width and height during DRC by using setMetaData
API with UPDATE_BUFFER_GEOMETRY. We then proceed to configure
WB with the new resolution for subsequent frames.

2. Update WB dump with output buffer format and resolution

Update WB dump with output buffer format and resolution. This is
helpful for debugging purposes.

Change-Id: I537277499041bffc7bfc5c6e3d024b67f80fce44
diff --git a/libexternal/external.cpp b/libexternal/external.cpp
index 0a1335a..a615f5f 100644
--- a/libexternal/external.cpp
+++ b/libexternal/external.cpp
@@ -581,14 +581,14 @@
         // Always set dpyAttr res to mVInfo res
         mHwcContext->dpyAttr[HWC_DISPLAY_EXTERNAL].xres = width;
         mHwcContext->dpyAttr[HWC_DISPLAY_EXTERNAL].yres = height;
-        mHwcContext->dpyAttr[HWC_DISPLAY_EXTERNAL].mDownScaleMode = false;
+        mHwcContext->dpyAttr[HWC_DISPLAY_EXTERNAL].mMDPScalingMode = false;
         if(mHwcContext->mOverlay->isUIScalingOnExternalSupported()
                 && mHwcContext->mMDPDownscaleEnabled) {
             int priW = mHwcContext->dpyAttr[HWC_DISPLAY_PRIMARY].xres;
             int priH = mHwcContext->dpyAttr[HWC_DISPLAY_PRIMARY].yres;
             // if primary resolution is more than the hdmi resolution
-            // configure dpy attr to primary resolution and set
-            // downscale mode
+            // configure dpy attr to primary resolution and set MDP
+            // scaling mode.
             // Restrict this upto 1080p resolution max, if target does not
             // support source split feature.
             if((priW * priH) > (width * height) &&
@@ -632,16 +632,17 @@
                 mHwcContext->dpyAttr[HWC_DISPLAY_EXTERNAL].xres = alignedExtW;
                 mHwcContext->dpyAttr[HWC_DISPLAY_EXTERNAL].yres = alignedExtH;
                 // Set External Display MDP Downscale mode indicator
-                mHwcContext->dpyAttr[HWC_DISPLAY_EXTERNAL].mDownScaleMode =true;
+                mHwcContext->dpyAttr[HWC_DISPLAY_EXTERNAL].mMDPScalingMode
+                        = true;
             }
         }
         ALOGD_IF(DEBUG_MDPDOWNSCALE, "Selected external resolution [%d X %d] "
-                 "maxMDPDownScale %d MDPDownScaleMode %d srcSplitEnabled %d "
+                 "maxMDPDownScale %d mMDPScalingMode %d srcSplitEnabled %d "
                  "MDPDownscale feature %d",
                  mHwcContext->dpyAttr[HWC_DISPLAY_EXTERNAL].xres,
                  mHwcContext->dpyAttr[HWC_DISPLAY_EXTERNAL].yres,
                  qdutils::MDPVersion::getInstance().getMaxMDPDownscale(),
-                 mHwcContext->dpyAttr[HWC_DISPLAY_EXTERNAL].mDownScaleMode,
+                 mHwcContext->dpyAttr[HWC_DISPLAY_EXTERNAL].mMDPScalingMode,
                  qdutils::MDPVersion::getInstance().isSrcSplit(),
                  mHwcContext->mMDPDownscaleEnabled);
         //Initialize the display viewFrame info