e_plane: use commit_handler for checking wait commit 01/157301/6
authorChangyeon Lee <cyeon.lee@samsung.com>
Wed, 18 Oct 2017 05:00:41 +0000 (14:00 +0900)
committerBoram Park <boram1288.park@samsung.com>
Mon, 30 Oct 2017 03:51:51 +0000 (03:51 +0000)
if commit_per_vblank is disabled

Change-Id: I4dfc0811e44900547f8a70aafa2ade8747a99a4a

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

index a95f7ff20dbce6b3f1292030432a1d28ce89e086..0e27faab748433d3863de31e1d712a141090c0d0 100644 (file)
@@ -1637,6 +1637,8 @@ e_output_new(E_Comp_Screen *e_comp_screen, int index)
         goto fail;
      }
 
+   output->e_comp_screen = e_comp_screen;
+
    for (i = 0; i < output->plane_count; i++)
      {
         plane = e_plane_new(output, i);
@@ -1663,8 +1665,6 @@ e_output_new(E_Comp_Screen *e_comp_screen, int index)
         goto fail;
      }
 
-   output->e_comp_screen = e_comp_screen;
-
    _e_output_tdm_strem_capture_support(output);
 
    return output;
index 3121c228b466718918a910c8880481ba40533202..39852898a87291c05078038ed2454e8adaae691f 100644 (file)
@@ -1233,6 +1233,7 @@ EINTERN E_Plane *
 e_plane_new(E_Output *output, int index)
 {
    E_Plane *plane = NULL;
+   E_Comp_Screen *comp_screen = NULL;
    tdm_layer *tlayer = NULL;
    tdm_output *toutput = NULL;
    tdm_layer_capability layer_capabilities;
@@ -1246,6 +1247,9 @@ e_plane_new(E_Output *output, int index)
 
    EINA_SAFETY_ON_NULL_RETURN_VAL(output, NULL);
 
+   comp_screen = output->e_comp_screen;
+   EINA_SAFETY_ON_NULL_RETURN_VAL(comp_screen, NULL);
+
    toutput = output->toutput;
    EINA_SAFETY_ON_NULL_RETURN_VAL(toutput, NULL);
 
@@ -1305,6 +1309,9 @@ e_plane_new(E_Output *output, int index)
    for ( i = 0 ; i < count ; i++)
      plane->available_formats = eina_list_append(plane->available_formats, &formats[i]);
 
+   if (tdm_helper_commit_per_vblank_enabled(comp_screen->tdisplay))
+     plane->commit_per_vblank = EINA_TRUE;
+
    INF("E_PLANE: (%d) plane:%p name:%s zpos:%d capa:%s %s",
        index, plane, plane->name,
        plane->zpos,plane->is_primary ? "primary" : "",
@@ -1627,11 +1634,17 @@ _e_plane_commit_hanler(tdm_layer *layer, unsigned int sequence,
                        void *user_data)
 {
    E_Plane_Commit_Data *data = (E_Plane_Commit_Data *)user_data;
+   E_Plane *plane = NULL;
 
    EINA_SAFETY_ON_NULL_RETURN(data);
 
    TRACE_DS_ASYNC_END((unsigned int)layer, [PLANE:COMMIT~HANDLER]);
 
+   plane = data->plane;
+
+   if (!plane->commit_per_vblank)
+     plane->wait_commit = EINA_FALSE;
+
    e_plane_commit_data_release(data);
 }
 
@@ -1748,11 +1761,14 @@ e_plane_commit(E_Plane *plane)
         return EINA_FALSE;
      }
 
-   error = tdm_output_wait_vblank(plane->output->toutput, 1, 0, _e_plane_vblank_handler, (void *)plane);
-   if (error != TDM_ERROR_NONE)
+   if (plane->commit_per_vblank)
      {
-        ERR("fail to tdm_output_wait_vblank plane:%p, zpos:%d", plane, plane->zpos);
-        return EINA_FALSE;
+        error = tdm_output_wait_vblank(plane->output->toutput, 1, 0, _e_plane_vblank_handler, (void *)plane);
+        if (error != TDM_ERROR_NONE)
+          {
+            ERR("fail to tdm_output_wait_vblank plane:%p, zpos:%d", plane, plane->zpos);
+            return EINA_FALSE;
+          }
      }
 
    /* send frame event enlightenment dosen't send frame evnet in nocomp */
index 0ff827e03f31a0bc2a5e1f4fd16bbeca6e39b1b5..dc1a84718fa84b2fad1eeee6eeed761c8cdec02b 100644 (file)
@@ -81,6 +81,8 @@ struct _E_Plane
    E_Plane              *fb_change;
    int                   fb_change_counter;
 
+   Eina_Bool             commit_per_vblank;
+
    /* true if plane's ec is set or unset.
     * false when E_Event_Plane_Win_Change has been generated.
     */