display: Add support for MDP Composition

This change
   1) implements MDP Composition upto 3 layers
   2) adds invalidator support to fall back to FB
      composition during idle screen condition.

Change-Id: I55f27321fd0df096b353d66aaad1cc720cd4b84b
Acked-by: Jeykumar Sankaran <jsanka@codeaurora.org>
diff --git a/libhwcomposer/hwc.cpp b/libhwcomposer/hwc.cpp
index ba87f90..c28cf03 100644
--- a/libhwcomposer/hwc.cpp
+++ b/libhwcomposer/hwc.cpp
@@ -30,6 +30,7 @@
 #include "hwc_uimirror.h"
 #include "hwc_copybit.h"
 #include "hwc_external.h"
+#include "hwc_mdpcomp.h"
 
 using namespace qhwc;
 
@@ -85,6 +86,8 @@
             //Nothing here
         } else if(UIMirrorOverlay::prepare(ctx, list)) {
             ctx->overlayInUse = true;
+        } else if(MDPComp::configure(dev, list)) {
+            ctx->overlayInUse = true;
         } else if (0) {
             //Other features
             ctx->overlayInUse = true;
@@ -153,6 +156,7 @@
     if (LIKELY(list)) {
         VideoOverlay::draw(ctx, list);
         CopyBit::draw(ctx, list, (EGLDisplay)dpy, (EGLSurface)sur);
+        MDPComp::draw(ctx, list);
         EGLBoolean sucess = eglSwapBuffers((EGLDisplay)dpy, (EGLSurface)sur);
         UIMirrorOverlay::draw(ctx);
         if(ctx->mExtDisplay->getExternalDisplay())