libcopybit: update the target config_mask for transformation

With the new C2D optimization, the layer transformation is
passed through the config_mask.  If two layers had same
transform then the transform info was lost, fix that by
updating the config_mask when the layer has transformation info

Change-Id: Idecb5b16a65269fd13eead9a2de27a4756435583
CRs-fixed: 453083
diff --git a/libcopybit/copybit_c2d.cpp b/libcopybit/copybit_c2d.cpp
index 2fa55cd..c186242 100644
--- a/libcopybit/copybit_c2d.cpp
+++ b/libcopybit/copybit_c2d.cpp
@@ -600,7 +600,13 @@
         ctx->blit_list[i].next = &(ctx->blit_list[i+1]);
     }
     ctx->blit_list[ctx->blit_count-1].next = NULL;
-    if(LINK_c2dDraw(target,ctx->trg_transform, 0x0, 0, 0, ctx->blit_list,
+    uint32_t target_transform = ctx->trg_transform;
+    if (ctx->c2d_driver_info.capabilities_mask &
+        C2D_DRIVER_SUPPORTS_OVERRIDE_TARGET_ROTATE_OP) {
+        // For A3xx - set 0x0 as the transform is set in the config_mask
+        target_transform = 0x0;
+    }
+    if(LINK_c2dDraw(target, target_transform, 0x0, 0, 0, ctx->blit_list,
                     ctx->blit_count)) {
         ALOGE("%s: LINK_c2dDraw ERROR", __FUNCTION__);
         return COPYBIT_FAILURE;
@@ -784,17 +790,15 @@
                 }
             }
 
-            if (transform != ctx->trg_transform) {
-                if (ctx->c2d_driver_info.capabilities_mask &
-                    C2D_DRIVER_SUPPORTS_OVERRIDE_TARGET_ROTATE_OP) {
-                    ctx->config_mask |= config_mask;
-                } else {
-                    // The transform for this surface does not match the current
-                    // target transform. Draw all previous surfaces. This will be
-                    // changed once we have a new mechanism to send different
-                    // target rotations to c2d.
-                    finish_copybit(dev);
-                }
+            if (ctx->c2d_driver_info.capabilities_mask &
+                C2D_DRIVER_SUPPORTS_OVERRIDE_TARGET_ROTATE_OP) {
+                ctx->config_mask |= config_mask;
+            } else {
+                // The transform for this surface does not match the current
+                // target transform. Draw all previous surfaces. This will be
+                // changed once we have a new mechanism to send different
+                // target rotations to c2d.
+                finish_copybit(dev);
             }
             ctx->trg_transform = transform;
         }