hwc: Handle worm hole region for one line

MDP3 can't handle one line worm hole region.
Hence passing full FB to clear and disabling the
swap rect if presents.

Change-Id: Iba4c7c0a08625dad8ebe700d71df83e37cc50797
diff --git a/libhwcomposer/hwc_copybit.cpp b/libhwcomposer/hwc_copybit.cpp
index f1edf5d..1891c46 100644
--- a/libhwcomposer/hwc_copybit.cpp
+++ b/libhwcomposer/hwc_copybit.cpp
@@ -542,12 +542,23 @@
                                        __FUNCTION__, mDirtyLayerIndex);
     hwc_rect_t clearRegion = {0,0,0,0};
     mDirtyRect = list->hwLayers[last].displayFrame;
-    if (mDirtyLayerIndex != -1)
-        mDirtyRect = list->hwLayers[mDirtyLayerIndex].displayFrame;
 
     if (CBUtils::getuiClearRegion(list, clearRegion, layerProp,
-                                                       mDirtyLayerIndex))
-             clear(renderBuffer, clearRegion);
+                                                       mDirtyLayerIndex)) {
+       int clear_w =  clearRegion.right -  clearRegion.left;
+       int clear_h =  clearRegion.bottom - clearRegion.top;
+       //mdp can't handle solid fill for one line
+       //making solid fill as full in this case
+       //disable swap rect if presents
+       if ((clear_w == 1) || (clear_h ==1)) {
+           clear(renderBuffer, mDirtyRect);
+           mDirtyLayerIndex = -1;
+       }else
+           clear(renderBuffer, clearRegion);
+    }
+    if (mDirtyLayerIndex != -1)
+           mDirtyRect = list->hwLayers[mDirtyLayerIndex].displayFrame;
+
     // numAppLayers-1, as we iterate from 0th layer index with HWC_COPYBIT flag
     for (int i = 0; i <= (ctx->listStats[dpy].numAppLayers-1); i++) {
         if(!(layerProp[i].mFlags & HWC_COPYBIT)) {