hwc: mdpcomp: Make all pipes available if a frame fails

Make all pipes in overlay available, if programming a frame (list)
fails. The failure could be due to commit failure, in which case the
overlay itself will make pipes available.

The failure can also be owing to lack of pipes, since we don't allow
switching pipes across mixers any more. This is particularly a problem
for split-panels. This fix addresses this latter case.

Change-Id: Ieac7ae7d03e5b9a93c7245fa160c8933593c2e09
diff --git a/libhwcomposer/hwc_mdpcomp.cpp b/libhwcomposer/hwc_mdpcomp.cpp
index f2217b9..85450d2 100644
--- a/libhwcomposer/hwc_mdpcomp.cpp
+++ b/libhwcomposer/hwc_mdpcomp.cpp
@@ -785,12 +785,14 @@
                         mCurrentFrame.fbZ)) {
                 ALOGE("%s configure framebuffer failed", __func__);
                 reset(numLayers, list);
+                ctx->mOverlay->clear(mDpy);
                 return -1;
             }
         }
         //Acquire and Program MDP pipes
         if(!programMDP(ctx, list)) {
             reset(numLayers, list);
+            ctx->mOverlay->clear(mDpy);
             return -1;
         } else { //Success
             //Any change in composition types needs an FB refresh
@@ -822,11 +824,13 @@
             if(!ctx->mFBUpdate[mDpy]->prepare(ctx, list, mCurrentFrame.fbZ)) {
                 ALOGE("%s configure framebuffer failed", __func__);
                 reset(numLayers, list);
+                ctx->mOverlay->clear(mDpy);
                 return -1;
             }
         }
         if(!programYUV(ctx, list)) {
             reset(numLayers, list);
+            ctx->mOverlay->clear(mDpy);
             return -1;
         }
     } else {