hwc: Update to new API

* Updates HWC to use the Jellybean MR1 API
* Remove qcom_ui which was using parts of the old API

Change-Id: I663363547b193d2318aae88f2256a9baed1e3d4b
diff --git a/libhwcomposer/hwc_mdpcomp.cpp b/libhwcomposer/hwc_mdpcomp.cpp
index 135d651..787ba9b 100644
--- a/libhwcomposer/hwc_mdpcomp.cpp
+++ b/libhwcomposer/hwc_mdpcomp.cpp
@@ -125,7 +125,7 @@
     proc->invalidate(proc);
 }
 
-void MDPComp::reset( hwc_context_t *ctx, hwc_layer_list_t* list ) {
+void MDPComp::reset( hwc_context_t *ctx, hwc_display_contents_1_t* list ) {
     sCurrentFrame.count = 0;
     free(sCurrentFrame.pipe_layer);
     sCurrentFrame.pipe_layer = NULL;
@@ -145,13 +145,13 @@
     }
 }
 
-void MDPComp::setLayerIndex(hwc_layer_t* layer, const int pipe_index)
+void MDPComp::setLayerIndex(hwc_layer_1_t* layer, const int pipe_index)
 {
     layer->flags &= ~HWC_MDPCOMP_INDEX_MASK;
     layer->flags |= pipe_index << MDPCOMP_INDEX_OFFSET;
 }
 
-int MDPComp::getLayerIndex(hwc_layer_t* layer)
+int MDPComp::getLayerIndex(hwc_layer_1_t* layer)
 {
     int byp_index = -1;
 
@@ -162,7 +162,7 @@
     }
     return byp_index;
 }
-void MDPComp::print_info(hwc_layer_t* layer)
+void MDPComp::print_info(hwc_layer_1_t* layer)
 {
      hwc_rect_t sourceCrop = layer->sourceCrop;
      hwc_rect_t displayFrame = layer->displayFrame;
@@ -185,7 +185,7 @@
 /*
  * Configures pipe(s) for MDP composition
  */
-int MDPComp::prepare(hwc_context_t *ctx, hwc_layer_t *layer,
+int MDPComp::prepare(hwc_context_t *ctx, hwc_layer_1_t *layer,
                                             mdp_pipe_info& mdp_info) {
 
     int nPipeIndex = mdp_info.index;
@@ -333,8 +333,8 @@
  * 5. Overlay in use
  */
 
-bool MDPComp::is_doable(hwc_composer_device_t *dev,
-                                                const hwc_layer_list_t* list) {
+bool MDPComp::is_doable(hwc_composer_device_1_t *dev,
+                                                const hwc_display_contents_1_t* list) {
     hwc_context_t* ctx = (hwc_context_t*)(dev);
 
     if(!ctx) {
@@ -370,13 +370,13 @@
     return true;
 }
 
-void MDPComp::setMDPCompLayerFlags(hwc_layer_list_t* list) {
+void MDPComp::setMDPCompLayerFlags(hwc_display_contents_1_t* list) {
 
     for(int index = 0 ; index < sCurrentFrame.count; index++ )
     {
         int layer_index = sCurrentFrame.pipe_layer[index].layer_index;
         if(layer_index >= 0) {
-            hwc_layer_t* layer = &(list->hwLayers[layer_index]);
+            hwc_layer_1_t* layer = &(list->hwLayers[layer_index]);
 
             layer->flags |= HWC_MDPCOMP;
             layer->compositionType = HWC_OVERLAY;
@@ -385,7 +385,7 @@
     }
 }
 
-void MDPComp::get_layer_info(hwc_layer_t* layer, int& flags) {
+void MDPComp::get_layer_info(hwc_layer_1_t* layer, int& flags) {
 
     private_handle_t* hnd = (private_handle_t*)layer->handle;
 
@@ -410,7 +410,7 @@
     }
 }
 
-int MDPComp::mark_layers(hwc_layer_list_t* list, layer_mdp_info* layer_info,
+int MDPComp::mark_layers(hwc_display_contents_1_t* list, layer_mdp_info* layer_info,
                                                     frame_info& current_frame) {
 
     int layer_count = list->numHwLayers;
@@ -424,7 +424,7 @@
 
     //Parse layers from higher z-order
     for(int index = layer_count - 1 ; index >= 0; index-- ) {
-        hwc_layer_t* layer = &list->hwLayers[index];
+        hwc_layer_1_t* layer = &list->hwLayers[index];
 
         int layer_prop = 0;
         get_layer_info(layer, layer_prop);
@@ -476,7 +476,7 @@
     }
 }
 
-bool MDPComp::alloc_layer_pipes(hwc_layer_list_t* list,
+bool MDPComp::alloc_layer_pipes(hwc_display_contents_1_t* list,
                         layer_mdp_info* layer_info, frame_info& current_frame) {
 
     int layer_count = list->numHwLayers;
@@ -490,7 +490,7 @@
                             layer_count, mdp_count, fallback_count);
 
     for(int index = 0 ; index < layer_count ; index++ ) {
-        hwc_layer_t* layer = &list->hwLayers[index];
+        hwc_layer_1_t* layer = &list->hwLayers[index];
 
         if(layer_info[index].can_use_mdp) {
              pipe_layer_pair& info = current_frame.pipe_layer[frame_pipe_count];
@@ -518,7 +518,7 @@
 }
 
 //returns array of layers and their allocated pipes
-bool MDPComp::parse_and_allocate(hwc_context_t* ctx, hwc_layer_list_t* list,
+bool MDPComp::parse_and_allocate(hwc_context_t* ctx, hwc_display_contents_1_t* list,
                                                   frame_info& current_frame ) {
 
     int layer_count = list->numHwLayers;
@@ -584,7 +584,7 @@
 }
 #endif
 
-bool MDPComp::setup(hwc_context_t* ctx, hwc_layer_list_t* list) {
+bool MDPComp::setup(hwc_context_t* ctx, hwc_display_contents_1_t* list) {
     int nPipeIndex, vsync_wait, isFG;
     int numHwLayers = list->numHwLayers;
 
@@ -632,7 +632,7 @@
 
     for (int index = 0 ; index < current_frame.count; index++) {
         int layer_index = current_frame.pipe_layer[index].layer_index;
-        hwc_layer_t* layer = &list->hwLayers[layer_index];
+        hwc_layer_1_t* layer = &list->hwLayers[layer_index];
         mdp_pipe_info& cur_pipe = current_frame.pipe_layer[index].pipe_index;
 
         if( prepare(ctx, layer, cur_pipe) != 0 ) {
@@ -647,7 +647,7 @@
     return true;
 }
 
-void MDPComp::unsetMDPCompLayerFlags(hwc_context_t* ctx, hwc_layer_list_t* list)
+void MDPComp::unsetMDPCompLayerFlags(hwc_context_t* ctx, hwc_display_contents_1_t* list)
 {
     if (!list)
         return;
@@ -660,7 +660,7 @@
     }
 }
 
-int MDPComp::draw(hwc_context_t *ctx, hwc_layer_list_t* list) {
+int MDPComp::draw(hwc_context_t *ctx, hwc_display_contents_1_t* list) {
 
     if(!isEnabled()) {
         ALOGD_IF(isDebug(),"%s: MDP Comp. not enabled",__FUNCTION__);
@@ -676,7 +676,7 @@
 
     for(unsigned int i = 0; i < list->numHwLayers; i++ )
     {
-        hwc_layer_t *layer = &list->hwLayers[i];
+        hwc_layer_1_t *layer = &list->hwLayers[i];
 
         if(!(layer->flags & HWC_MDPCOMP)) {
             ALOGD_IF(isDebug(), "%s: Layer Not flagged for MDP comp",
@@ -789,7 +789,7 @@
     return true;
 }
 
-bool MDPComp::configure(hwc_composer_device_t *dev,  hwc_layer_list_t* list) {
+bool MDPComp::configure(hwc_composer_device_1_t *dev,  hwc_display_contents_1_t* list) {
 
     if(!isEnabled()) {
         ALOGD_IF(isDebug(),"%s: MDP Comp. not enabled.", __FUNCTION__);