e_plane: plane unset surface in e_plane_fetch 17/116317/3
authorChangyeon Lee <cyeon.lee@samsung.com>
Thu, 23 Feb 2017 15:25:23 +0000 (00:25 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Fri, 24 Feb 2017 08:27:24 +0000 (00:27 -0800)
Change-Id: If7e4eafc102ce9d1773fcf0765b1927698670580

src/bin/e_output.c
src/bin/e_plane.c
src/bin/e_plane.h

index 8a76459760552348ef97dd7947e2263f83a459ac..c4b5a57345cd6a25a3148183c473ee644365bd03 100644 (file)
@@ -775,11 +775,10 @@ e_output_commit(E_Output *output)
         if (e_plane_is_fb_target(plane) && plane->ec)
            fb_hwc_on = EINA_TRUE;
 
-        if (!e_plane_fetch(plane))
-          {
-             if (!plane->need_to_unset_commit) continue;
-             if (!fb_hwc_on && !fb_commit) continue;
-          }
+        if (!e_plane_fetch(plane)) continue;
+
+        if (plane->need_unset_commit && !fb_hwc_on && !fb_commit)
+           continue;
 
         if (output->dpms == E_OUTPUT_DPMS_OFF)
           {
index bad2363bbb484647540ba1fdbad68ca57d5d503f..f7b5f833adc9bd904404c51d7611c82e67e7e584 100644 (file)
@@ -102,15 +102,6 @@ _e_plane_surface_unset(E_Plane *plane)
          return EINA_FALSE;
      }
 
-   plane->tsurface = NULL;
-   plane->need_to_unset_commit = EINA_TRUE;
-
-   if (plane->renderer)
-     {
-        /* set the update_exist to be false */
-        e_plane_renderer_update_exist_set(plane->renderer, EINA_FALSE);
-     }
-
    return EINA_TRUE;
 }
 
@@ -756,48 +747,75 @@ e_plane_fetch(E_Plane *plane)
      }
    else
      {
-        if (!plane->ec) return EINA_FALSE;
-
-        if (plane->role == E_PLANE_ROLE_OVERLAY)
+        if (plane->ec)
           {
-             /* acquire the surface */
-             if (plane->reserved_memory)
-                tsurface = _e_plane_surface_from_client_acquire_reserved(plane);
+             if (plane->role == E_PLANE_ROLE_OVERLAY)
+               {
+                 /* acquire the surface */
+                 if (plane->reserved_memory)
+                    tsurface = _e_plane_surface_from_client_acquire_reserved(plane);
+                 else
+                    tsurface = _e_plane_surface_from_client_acquire(plane);
+               }
+             else if (plane->role == E_PLANE_ROLE_CURSOR)
+               {
+                  tsurface = _e_plane_cursor_surface_acquire(plane);
+               }
              else
-                tsurface = _e_plane_surface_from_client_acquire(plane);
-          }
-        else if (plane->role == E_PLANE_ROLE_CURSOR)
-          {
-             tsurface = _e_plane_cursor_surface_acquire(plane);
-          }
-        else
-          {
-             ERR("not supported plane:%p role:%d", plane, plane->role);
-             return EINA_FALSE;
-          }
+               {
+                  ERR("not supported plane:%p role:%d", plane, plane->role);
+                  return EINA_FALSE;
+               }
 
-        /* For send frame::done to client */
-        if (!tsurface)
-          e_pixmap_image_clear(plane->ec->pixmap, 1);
+             /* For send frame::done to client */
+             if (!tsurface)
+                e_pixmap_image_clear(plane->ec->pixmap, 1);
+          }
      }
 
-   if (!tsurface) return EINA_FALSE;
+   /* exist tsurface for update plane */
+   if (tsurface)
+     {
+        if (plane->need_unset)
+            plane->need_unset = EINA_FALSE;
+
+        if (plane->need_unset_commit)
+            plane->need_unset_commit = EINA_FALSE;
 
-   if (plane->need_to_unset_commit)
-      plane->need_to_unset_commit = EINA_FALSE;
+        plane->tsurface = tsurface;
 
-   plane->tsurface = tsurface;
+        /* set plane info and set tsurface to the plane */
+        if (!_e_plane_surface_set(plane, tsurface))
+          {
+              ERR("fail: _e_plane_set_info.");
+              e_plane_unfetch(plane);
+              return EINA_FALSE;
+          }
 
-   /* set plane info and set tsurface to the plane */
-   if (!_e_plane_surface_set(plane, tsurface))
-     {
-        ERR("fail: _e_plane_set_info.");
-        e_plane_unfetch(plane);
-        return EINA_FALSE;
+        /* set the update_exist to be true */
+        e_plane_renderer_update_exist_set(plane->renderer, EINA_TRUE);
      }
+   else
+     {
+        if (plane->need_unset)
+          {
+              plane->tsurface = NULL;
 
-   /* set the update_exist to be true */
-   e_plane_renderer_update_exist_set(plane->renderer, EINA_TRUE);
+              /* set plane info and set tsurface to the plane */
+              if (!_e_plane_surface_unset(plane))
+                {
+                  ERR("failed to unset surface plane:%p", plane);
+                  return EINA_FALSE;
+                }
+
+              plane->need_unset = EINA_FALSE;
+              plane->need_unset_commit = EINA_TRUE;
+          }
+        else
+          {
+             if (!plane->need_unset_commit) return EINA_FALSE;
+          }
+     }
 
    return EINA_TRUE;
 }
@@ -905,14 +923,14 @@ e_plane_commit_data_aquire(E_Plane *plane)
 
    EINA_SAFETY_ON_NULL_RETURN_VAL(plane, NULL);
 
-   if (plane->need_to_unset_commit)
+   if (plane->need_unset_commit)
      {
         data = E_NEW(E_Plane_Commit_Data, 1);
         data->plane = plane;
         data->tsurface = NULL;
         data->ec = NULL;
         plane->pending_commit = EINA_TRUE;
-        plane->need_to_unset_commit = EINA_FALSE;
+        plane->need_unset_commit = EINA_FALSE;
 
         return data;
      }
@@ -979,6 +997,9 @@ e_plane_commit_data_release(E_Plane_Commit_Data *data)
 
    if (!tsurface)
      {
+        if (plane_trace_debug)
+           ELOGF("E_PLANE", "Done    Plane(%p)  data(%p)  ::Unset", NULL, NULL, plane, data);
+
         e_comp_wl_buffer_reference(&plane->displaying_buffer_ref, NULL);
         if (plane->displaying_buffer_tsurface)
           {
@@ -1253,11 +1274,8 @@ e_plane_ec_set(E_Plane *plane, E_Client *ec)
      {
         if (!plane->is_fb)
           {
-             if (plane->tsurface && !_e_plane_surface_unset(plane))
-               {
-                  ERR("failed to unset surface plane:%p", plane);
-                  return EINA_FALSE;
-               }
+             if (plane->tsurface)
+                plane->need_unset = EINA_TRUE;
 
              if (plane->renderer)
                {
index e2e6f717c933269749e905858ca15ef26f292073..f44e5e013decf9010ee2cf4027ecc724a2d8cc79 100644 (file)
@@ -66,7 +66,8 @@ struct _E_Plane
    unsigned int          buffer_flags;
    Eina_Bool             pending_commit;
    Eina_List             *pending_commit_data_list;
-   Eina_Bool             need_to_unset_commit;
+   Eina_Bool             need_unset;
+   Eina_Bool             need_unset_commit;
 
    /* true if plane's ec is set or unset.
     * false when E_Event_Plane_Win_Change has been generated.