Merge "hwc: Call blank IOCTL on virtual as well if it is connected."
diff --git a/libhwcomposer/hwc.cpp b/libhwcomposer/hwc.cpp
index 1539f3b..37958f7 100644
--- a/libhwcomposer/hwc.cpp
+++ b/libhwcomposer/hwc.cpp
@@ -424,11 +424,7 @@
         ctx->mOverlay->configBegin();
         ctx->mOverlay->configDone();
         ctx->mRotMgr->clear();
-        // If VDS is connected, do not clear WB object as it
-        // will end up detaching IOMMU. This is required
-        // to send black frame to WFD sink on power suspend.
-        // Note: With this change, we keep the WriteBack object
-        // alive on power suspend for AD use case.
+        overlay::Writeback::clear();
     }
     switch(dpy) {
     case HWC_DISPLAY_PRIMARY:
@@ -482,6 +478,13 @@
                     ret = -1;
                 }
             }
+            value = blank ? FB_BLANK_POWERDOWN : FB_BLANK_UNBLANK;
+            if(ioctl(ctx->dpyAttr[HWC_DISPLAY_VIRTUAL].fd, FBIOBLANK, value) < 0
+                    ) {
+                ALOGE("%s: Failed to handle blank event(%d) for virtual!!",
+                        __FUNCTION__, blank );
+                return -1;
+            }
             ctx->dpyAttr[HWC_DISPLAY_VIRTUAL].isActive = !blank;
         }
         break;