e_comp_hwc:Reference e_comp_wl_buffer which is commited and displayed buffer in nocomp 91/71791/3 accepted/tizen/common/20160527.152912 accepted/tizen/ivi/20160527.122845 accepted/tizen/mobile/20160527.121112 accepted/tizen/tv/20160527.121945 accepted/tizen/wearable/20160527.122432 submit/tizen/20160527.065319
authorChangyeon Lee <cyeon.lee@samsung.com>
Thu, 26 May 2016 11:25:25 +0000 (20:25 +0900)
committerGwanglim Lee <gl77.lee@samsung.com>
Fri, 27 May 2016 07:55:25 +0000 (00:55 -0700)
Change-Id: Ibd4072070ea055721648b791843824803a6f1f0d

src/bin/e_comp_hwc.c

index de6bf2ee1149ea97c462d17dffece7dc94aa8ed9..569b6246b447126355f27d5255289b6147b4ce0a 100644 (file)
@@ -52,6 +52,7 @@ struct _E_Comp_Hwc_Client
 
 struct _E_Comp_Hwc_Commit_Data {
    E_Comp_Hwc_Layer *hwc_layer;
+   E_Comp_Wl_Buffer_Ref buffer_ref;
    tbm_surface_h tsurface;
    E_Client *ec;
    Eina_Bool is_canvas;
@@ -85,6 +86,8 @@ struct _E_Comp_Hwc_Layer {
    tbm_surface_h pending_tsurface;
    tbm_surface_h tsurface;
 
+   E_Comp_Wl_Buffer_Ref displaying_buffer_ref;
+
    E_Client *ec; /* ec which display on this layer directly */
 
    E_Comp_Hwc_Renderer *hwc_renderer;
@@ -259,8 +262,9 @@ _e_comp_hwc_commit_data_create(void)
 static void
 _e_comp_hwc_commit_data_destroy(E_Comp_Hwc_Commit_Data *data)
 {
-   if (data) return;
+   if (!data) return;
 
+   e_comp_wl_buffer_reference(&data->buffer_ref, NULL);
    free(data);
 }
 
@@ -903,6 +907,7 @@ _e_comp_hwc_output_commit_handler_reserved_memory(tdm_output *output, unsigned i
         else
           {
              _e_comp_hwc_layer_queue_release(hwc_layer, hwc_layer->tsurface);
+             e_comp_wl_buffer_reference(&hwc_layer->displaying_buffer_ref, NULL);
              hwc_layer->tsurface = tsurface;
           }
      }
@@ -916,7 +921,8 @@ _e_comp_hwc_output_commit_handler_reserved_memory(tdm_output *output, unsigned i
         /* release */
         if (hwc_layer->tsurface)
           {
-             _e_comp_hwc_layer_queue_release(hwc_layer, tsurface);
+             _e_comp_hwc_layer_queue_release(hwc_layer, hwc_layer->tsurface);
+             e_comp_wl_buffer_reference(&hwc_layer->displaying_buffer_ref, data->buffer_ref.buffer);
              hwc_layer->tsurface = tsurface;
           }
 
@@ -986,7 +992,6 @@ _e_comp_hwc_output_commit_handler(tdm_output *output, unsigned int sequence,
 
         tbm_surface_internal_unref(tsurface);
         _e_comp_hwc_commit_data_destroy(data);
-
      }
    else
      {
@@ -1032,7 +1037,11 @@ _e_comp_hwc_output_commit(E_Comp_Hwc_Output *hwc_output, E_Comp_Hwc_Layer *hwc_l
    /* hwc_renderer->activated_ec can be changed at the time of commit handler
       , so we stores the current activated_ec at data */
    if (hwc_renderer->activated_ec)
-     data->ec = hwc_renderer->activated_ec;
+     {
+        data->ec = hwc_renderer->activated_ec;
+        e_comp_wl_buffer_reference(&data->buffer_ref, e_pixmap_resource_get(hwc_renderer->activated_ec->pixmap));
+     }
+
    data->is_canvas = is_canvas;
 
    /* set layer when the layer infomation is different from the previous one */