e_plane: do not set ec to plane if plane is trying to unset 04/144304/2 accepted/tizen/unified/20170817.004211 submit/tizen/20170816.102731
authorChangyeon Lee <cyeon.lee@samsung.com>
Wed, 16 Aug 2017 07:29:47 +0000 (16:29 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Wed, 16 Aug 2017 10:13:14 +0000 (10:13 +0000)
Change-Id: I20a9e225702a00dc1db6fdc760f9fe5728b900e1

src/bin/e_plane.c

index 141debd854b80e70ad7f17ce0c7514ff09e70a98..a4d60251d23b0c8ed27e424a5e408e3ac53da7d6 100644 (file)
@@ -660,14 +660,14 @@ _e_plane_unset_reset(E_Plane *plane)
 }
 
 static void
-_e_plane_unset_candidate_set(E_Plane *plane)
+_e_plane_unset_candidate_set(E_Plane *plane, Eina_Bool sync)
 {
    E_Plane *fb_target = NULL;
 
    fb_target = e_output_fb_target_get(plane->output);
    if (fb_target)
      {
-        if(fb_target->ec)
+        if(fb_target->ec && !sync)
           plane->unset_counter = 0;
         else
           plane->unset_counter = e_plane_renderer_render_count_get(fb_target->renderer) + 1;
@@ -1931,7 +1931,7 @@ e_plane_ec_set(E_Plane *plane, E_Client *ec)
      ELOGF("E_PLANE", "Request Plane(%p) zpos(%d)   Set ec(%p, %s)",
            (ec ? ec->pixmap : NULL), ec, plane, plane->zpos, ec, e_client_util_name_get(ec));
 
-   if (ec)
+   if (ec && (plane->is_fb || !plane->ec))
      {
         if (plane->ec == ec) return EINA_TRUE;
 
@@ -1969,6 +1969,12 @@ e_plane_ec_set(E_Plane *plane, E_Client *ec)
           {
              if (!plane->is_fb)
                {
+                  if (e_plane_is_unset_candidate(plane) || e_plane_is_unset_try(plane))
+                    {
+                       INF("Trying to unset plane:%p zpos:%d", plane, plane->zpos);
+                       return EINA_FALSE;
+                    }
+
                   if ((plane->renderer) && (plane->role != E_PLANE_ROLE_OVERLAY))
                     _e_plane_renderer_unset(plane);
 
@@ -1992,8 +1998,6 @@ e_plane_ec_set(E_Plane *plane, E_Client *ec)
 
         if (plane->is_fb)
           _e_plane_fb_target_all_unset_counter_reset(plane);
-        else
-          _e_plane_unset_reset(plane);
 
         e_comp_object_hwc_update_set(ec->frame, EINA_TRUE);
 
@@ -2022,7 +2026,11 @@ e_plane_ec_set(E_Plane *plane, E_Client *ec)
           {
              if (plane->tsurface)
                {
-                  _e_plane_unset_candidate_set(plane);
+                  if (ec)
+                    _e_plane_unset_candidate_set(plane, EINA_TRUE);
+                  else
+                    _e_plane_unset_candidate_set(plane, EINA_FALSE);
+
                   if (plane_trace_debug)
                     ELOGF("E_PLANE", "Plane(%p) Set the unset_candidate", (plane->ec ? ec->pixmap : NULL), ec, plane);
                }
@@ -2039,6 +2047,18 @@ e_plane_ec_set(E_Plane *plane, E_Client *ec)
              if (plane->ec) e_client_redirected_set(plane->ec, EINA_TRUE);
              plane->ec_redirected = EINA_FALSE;
           }
+
+        if (ec)
+          {
+             plane->ec = NULL;
+             plane->need_ev = EINA_TRUE;
+
+             if (plane_trace_debug)
+               ELOGF("E_PLANE", "Plane(%p) zpos(%d)   Set ec(%p, %s)",
+                     (ec ? ec->pixmap : NULL), ec, plane, plane->zpos, NULL, NULL);
+
+             return EINA_FALSE;
+          }
      }
 
    plane->ec = ec;