hwc: set wait_commit before do commit 64/208764/3
authorChangyeon Lee <cyeon.lee@samsung.com>
Fri, 28 Jun 2019 07:29:53 +0000 (16:29 +0900)
committerchangyeon lee <cyeon.lee@samsung.com>
Mon, 1 Jul 2019 05:14:44 +0000 (05:14 +0000)
it is possible that commit handler is called inside
tdm_layer_commit or hwc_commit.

Change-Id: I984d3afdbf14deda9dfb45fae70e7bd80b7aac0f

src/bin/e_hwc_windows.c
src/bin/e_plane.c

index 04d03ad..b5b08ac 100644 (file)
@@ -2321,6 +2321,8 @@ e_hwc_windows_commit(E_Hwc *hwc)
         EHWSTRACE("!!!!!!!! HWC Commit !!!!!!!!", NULL);
         _e_hwc_windows_update_fps(hwc);
 
+        hwc->wait_commit = EINA_TRUE;
+
         error = tdm_hwc_commit(hwc->thwc, 0, _e_hwc_windows_commit_handler, hwc);
         if (error != TDM_ERROR_NONE)
           {
@@ -2328,13 +2330,13 @@ e_hwc_windows_commit(E_Hwc *hwc)
              _e_hwc_windows_commit_handler(hwc->thwc, 0, 0, 0, hwc);
              goto fail;
           }
-
-        hwc->wait_commit = EINA_TRUE;
      }
 
    return EINA_TRUE;
 
 fail:
+   hwc->wait_commit = EINA_FALSE;
+
    return EINA_FALSE;
 }
 
index b3439a9..b225bcd 100644 (file)
@@ -2228,11 +2228,14 @@ e_plane_commit(E_Plane *plane)
            NULL, plane, plane->zpos, data->tsurface, plane->renderer ? plane->renderer->tqueue : NULL,
            data->buffer_ref.buffer ? data->buffer_ref.buffer->resource : NULL, data);
 
+   plane->wait_commit = EINA_TRUE;
+
    error = tdm_layer_commit(plane->tlayer, _e_plane_commit_hanler, data);
    if (error != TDM_ERROR_NONE)
      {
         ERR("fail to tdm_layer_commit plane:%p, zpos:%d", plane, plane->zpos);
         e_plane_commit_data_release(plane, data);
+        plane->wait_commit = EINA_FALSE;
         return EINA_FALSE;
      }
 
@@ -2242,6 +2245,7 @@ e_plane_commit(E_Plane *plane)
         if (error != TDM_ERROR_NONE)
           {
             ERR("fail to tdm_output_wait_vblank plane:%p, zpos:%d", plane, plane->zpos);
+            plane->wait_commit = EINA_FALSE;
             return EINA_FALSE;
           }
      }
@@ -2250,8 +2254,6 @@ e_plane_commit(E_Plane *plane)
    if (plane->ec)
      e_pixmap_image_clear(plane->ec->pixmap, 1);
 
-   plane->wait_commit = EINA_TRUE;
-
    _e_plane_update_fps(plane);
 
    if (!plane->is_fb && plane->unset_ec_pending)