display : Add support for copybit composition

This change add support for copybit composition in display HAL
for MDP3 targets.

Change-Id: I9bc8e40f624b0760f4faa223cb03a13695611bb3
Acked-by: Sravan Kumar D.V.N <sravank1@codeaurora.org>
diff --git a/libcopybit/copybit.cpp b/libcopybit/copybit.cpp
index 977a3ab..f79c33b 100644
--- a/libcopybit/copybit.cpp
+++ b/libcopybit/copybit.cpp
@@ -60,6 +60,7 @@
     int     mFD;
     uint8_t mAlpha;
     int     mFlags;
+    bool    mBlitToFB;
 };
 
 /**
@@ -212,6 +213,10 @@
     req->alpha = dev->mAlpha;
     req->transp_mask = MDP_TRANSP_NOP;
     req->flags = dev->mFlags | flags;
+    // check if we are blitting to f/b
+    if (COPYBIT_ENABLE == dev->mBlitToFB) {
+        req->flags |= MDP_MEMORY_ID_TYPE_FB;
+    }
 #if defined(COPYBIT_QSD8K)
     req->flags |= MDP_BLEND_FG_PREMULT;
 #endif
@@ -322,6 +327,16 @@
                 ctx->mFlags &= ~0x7;
                 ctx->mFlags |= value & 0x7;
                 break;
+            case COPYBIT_BLIT_TO_FRAMEBUFFER:
+                if (COPYBIT_ENABLE == value) {
+                    ctx->mBlitToFB = value;
+                } else if (COPYBIT_DISABLE == value) {
+                    ctx->mBlitToFB = value;
+                } else {
+                    ALOGE ("%s:Invalid input for COPYBIT_BLIT_TO_FRAMEBUFFER : %d",
+                            __FUNCTION__, value);
+                }
+                break;
             default:
                 status = -EINVAL;
                 break;
diff --git a/libcopybit/copybit.h b/libcopybit/copybit.h
index 6384dfe..c14af74 100644
--- a/libcopybit/copybit.h
+++ b/libcopybit/copybit.h
@@ -52,6 +52,10 @@
 
 /* name for copybit_set_parameter */
 enum {
+    /* Default blit destination is offline buffer */
+    /* clients to set this to '1', if blitting to framebuffer */
+    /* and reset to '0', after calling blit/stretch */
+    COPYBIT_BLIT_TO_FRAMEBUFFER = 0,
     /* rotation of the source image in degrees (0 to 359) */
     COPYBIT_ROTATION_DEG    = 1,
     /* plane alpha value */