display: Enable copybit on msm8610

This change is the hwc and copybit changes need to enable
composition to go through mdp on msm8610.

Change-Id: If0df3a247c5f4f4310966d14fe8fd839bf84b9d5
diff --git a/libcopybit/Android.mk b/libcopybit/Android.mk
index 73bfa86..b125f11 100644
--- a/libcopybit/Android.mk
+++ b/libcopybit/Android.mk
@@ -35,5 +35,9 @@
             LOCAL_SRC_FILES := software_converter.cpp copybit.cpp
             include $(BUILD_SHARED_LIBRARY)
         endif
+        ifeq ($(call is-board-platform-in-list,msm8610),true)
+            LOCAL_SRC_FILES := software_converter.cpp copybit.cpp
+            include $(BUILD_SHARED_LIBRARY)
+        endif
     endif
 endif
diff --git a/libcopybit/copybit.cpp b/libcopybit/copybit.cpp
index ed302f1..43b90d1 100644
--- a/libcopybit/copybit.cpp
+++ b/libcopybit/copybit.cpp
@@ -42,15 +42,8 @@
 
 /******************************************************************************/
 
-#if defined(COPYBIT_MSM7K)
 #define MAX_SCALE_FACTOR    (4)
 #define MAX_DIMENSION       (4096)
-#elif defined(COPYBIT_QSD8K)
-#define MAX_SCALE_FACTOR    (8)
-#define MAX_DIMENSION       (2048)
-#else
-#error "Unsupported MDP version"
-#endif
 
 /******************************************************************************/
 
@@ -394,6 +387,7 @@
             struct mdp_blit_req req[12];
         } list;
 
+        memset(&list, 0, sizeof(list));
         if (ctx->mAlpha < 255) {
             switch (src->format) {
                 // we don't support plane alpha with RGBA formats
@@ -428,7 +422,7 @@
 
         if(src->format ==  HAL_PIXEL_FORMAT_YV12) {
             int usage =
-            GRALLOC_USAGE_PRIVATE_CAMERA_HEAP|GRALLOC_USAGE_PRIVATE_UNCACHED;
+            GRALLOC_USAGE_PRIVATE_IOMMU_HEAP | GRALLOC_USAGE_PRIVATE_UNCACHED;
             if (0 == alloc_buffer(&yv12_handle,src->w,src->h,
                                   src->format, usage)){
                 if(0 == convertYV12toYCrCb420SP(src,yv12_handle)){
@@ -509,6 +503,7 @@
 static int finish_copybit(struct copybit_device_t *dev)
 {
     // NOP for MDP copybit
+    return 0;
 }
 
 /*****************************************************************************/
@@ -524,6 +519,11 @@
     return 0;
 }
 
+static int flush_get_fence(struct copybit_device_t *dev, int* fd)
+{
+    return -1;
+}
+
 /** Open a new instance of a copybit device using name */
 static int open_copybit(const struct hw_module_t* module, const char* name,
                         struct hw_device_t** device)
@@ -542,6 +542,7 @@
     ctx->device.blit = blit_copybit;
     ctx->device.stretch = stretch_copybit;
     ctx->device.finish = finish_copybit;
+    ctx->device.flush_get_fence = flush_get_fence;
     ctx->mAlpha = MDP_ALPHA_NOP;
     ctx->mFlags = 0;
     ctx->mFD = open("/dev/graphics/fb0", O_RDWR, 0);
@@ -551,25 +552,8 @@
               status, strerror(status));
         status = -status;
     } else {
-        struct fb_fix_screeninfo finfo;
-        if (ioctl(ctx->mFD, FBIOGET_FSCREENINFO, &finfo) == 0) {
-            if (strncmp(finfo.id, "msmfb", 5) == 0) {
-                /* Success */
-                status = 0;
-            } else {
-                ALOGE("Error not msm frame buffer");
-                status = -EINVAL;
-            }
-        } else {
-            ALOGE("Error executing ioctl for screen info");
-            status = -errno;
-        }
-    }
-
-    if (status == 0) {
+        status = 0;
         *device = &ctx->device.common;
-    } else {
-        close_copybit(&ctx->device.common);
     }
     return status;
 }