hal: adding support for DRC on WiFi display

    When Dynamic Resolution Change (DRC) is triggered in the WiFi display
    stack, it results in a PAUSE and a RESUME event. During DRC, the
    dimensions of the framebuffer are changed. To support DRC we need to:
    1. Check if a RESUME event is the result of a valid DRC event
    2. Reconfigure the display's attributes to reflect resolution change
    3. Enable MDP downscaling when necessary (Valid DRC cases)

Change-Id: Idc3cbc94de99a4a7299e2f6b26c3e35937c1d6c8
diff --git a/libhwcomposer/hwc_uevents.cpp b/libhwcomposer/hwc_uevents.cpp
index 5590798..cc5b482 100644
--- a/libhwcomposer/hwc_uevents.cpp
+++ b/libhwcomposer/hwc_uevents.cpp
@@ -273,6 +273,15 @@
                 //its pipes; we don't allow inter-mixer pipe transfers.
                 {
                     Locker::Autolock _l(ctx->mDrawLock);
+
+                    // A dynamic resolution change (DRC) can be made for a WiFi
+                    // display. In order to support the resolution change, we
+                    // need to reconfigure the corresponding display attributes.
+                    // Since DRC is only on WiFi display, we only need to call
+                    // configure() on the VirtualDisplay device.
+                    if(dpy == HWC_DISPLAY_VIRTUAL)
+                        ctx->mVirtualDisplay->configure();
+
                     ctx->dpyAttr[dpy].isConfiguring = true;
                     ctx->dpyAttr[dpy].isActive = true;
                     ctx->proc->invalidate(ctx->proc);