e_plane: fixed flickering when ec is unset at plane 71/126071/2
authorChangyeon Lee <cyeon.lee@samsung.com>
Tue, 18 Apr 2017 10:55:19 +0000 (19:55 +0900)
committerchangyeon lee <cyeon.lee@samsung.com>
Thu, 11 May 2017 04:17:37 +0000 (04:17 +0000)
- e20 sholud render and display include ec when ec is unset at plane.
  so this patch don't ec unset to plane untill render and display include ec.
- plane get rendering count of fb_target and set to sync_unset_count
  when ecof plane is unset at plane.
- e_output don't fetch and commit plane, untill sync_unset_count of plane is zero.
- if fb_target have ec(hwc mode), plane immediately unset layer by setting zero to sync_unset_count
  because e20 doesn't need to composite ec.

Change-Id: I3d2a2b31bb1383dedbaa6ae58f1ae6feb066389e

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

index 30ccbc1a266b3da80dc5e2720dc805fd48787c01..a283f1750e21dc28e1032bb1c1e99cb465aec79f 100644 (file)
@@ -829,7 +829,6 @@ e_output_commit(E_Output *output)
    E_Plane *plane = NULL;
    Eina_List *l;
    Eina_Bool fb_commit = EINA_FALSE;
-   Eina_Bool fb_hwc_on = EINA_FALSE;
 
    EINA_SAFETY_ON_NULL_RETURN_VAL(output, EINA_FALSE);
 
@@ -842,26 +841,33 @@ e_output_commit(E_Output *output)
    /* set planes */
    EINA_LIST_FOREACH(output->planes, l, plane)
      {
-        if (e_plane_is_fb_target(plane) && plane->ec)
-          fb_hwc_on = EINA_TRUE;
+        if (plane->need_unset && plane->sync_unset_count)
+          {
+             if (fb_commit)
+               {
+                  plane->sync_unset_count--;
+                  if (plane->sync_unset_count)
+                    continue;
+               }
+          }
 
         if (!e_plane_fetch(plane)) continue;
 
+        if (e_plane_is_fb_target(plane))
+          fb_commit = EINA_TRUE;
+
         if (output->dpms == E_OUTPUT_DPMS_OFF)
           {
              if (!plane->need_unset_commit)
                e_plane_unfetch(plane);
           }
-
-        if (e_plane_is_fb_target(plane))
-          fb_commit = EINA_TRUE;
      }
 
    if (output->dpms == E_OUTPUT_DPMS_OFF) return EINA_TRUE;
 
    EINA_LIST_FOREACH(output->planes, l, plane)
      {
-        if (plane->need_unset_commit && !fb_hwc_on && !fb_commit)
+        if (plane->need_unset_commit && plane->sync_unset_count)
           continue;
 
         if (e_plane_is_fb_target(plane) && fb_commit)
index 2616e4a6e0969d763cb3833a66a9a64efe0b0eaa..2b2b5ae36d8f4d14a2e8d05f273c1b0cc1df669f 100644 (file)
@@ -935,6 +935,7 @@ e_plane_commit_data_aquire(E_Plane *plane)
         data->tsurface = NULL;
         data->ec = NULL;
         plane->need_unset_commit = EINA_FALSE;
+        plane->sync_unset_count = 0;
 
         return data;
      }
@@ -1210,6 +1211,8 @@ e_plane_ec_get(E_Plane *plane)
 E_API Eina_Bool
 e_plane_ec_set(E_Plane *plane, E_Client *ec)
 {
+   E_Plane *fb_target = NULL;
+
    EINA_SAFETY_ON_NULL_RETURN_VAL(plane, EINA_FALSE);
 
    if (plane_trace_debug)
@@ -1278,7 +1281,18 @@ e_plane_ec_set(E_Plane *plane, E_Client *ec)
         if (!plane->is_fb)
           {
              if (plane->tsurface)
-               plane->need_unset = EINA_TRUE;
+               {
+                  fb_target = e_output_fb_target_get(plane->output);
+                  if (fb_target)
+                    {
+                       if(fb_target->ec)
+                         plane->sync_unset_count = 0;
+                       else
+                         plane->sync_unset_count = e_plane_renderer_render_count_get(fb_target->renderer) + 1;
+                    }
+
+                  plane->need_unset = EINA_TRUE;
+               }
 
              if (plane->renderer)
                {
index f44e5e013decf9010ee2cf4027ecc724a2d8cc79..ea65c9cd92884c992fe913eca0a6d6c0670ef748 100644 (file)
@@ -68,6 +68,7 @@ struct _E_Plane
    Eina_List             *pending_commit_data_list;
    Eina_Bool             need_unset;
    Eina_Bool             need_unset_commit;
+   int                   sync_unset_count;
 
    /* true if plane's ec is set or unset.
     * false when E_Event_Plane_Win_Change has been generated.