}
}
-static void
-_e_output_commit_hanler(tdm_output *output, unsigned int sequence,
- unsigned int tv_sec, unsigned int tv_usec,
- void *user_data)
-{
- Eina_List *data_list = user_data;
- E_Plane_Commit_Data *data = NULL;
- Eina_List *l, *ll;
-
- _e_output_update_fps();
-
- TRACE_DS_ASYNC_END((unsigned int)output, [OUTPUT:COMMIT~HANDLER]);
-
- EINA_LIST_FOREACH_SAFE(data_list, l, ll, data)
- {
- data_list = eina_list_remove_list(data_list, l);
- e_plane_commit_data_release(data);
- data = NULL;
- }
-}
-
-static Eina_Bool
-_e_output_commit(E_Output *output)
-{
- Eina_List *data_list = NULL;
- E_Plane_Commit_Data *data = NULL;
- E_Plane *plane = NULL;
- Eina_List *l, *ll;
- tdm_error error;
-
- EINA_LIST_REVERSE_FOREACH(output->planes, l, plane)
- {
- data = e_plane_commit_data_aquire(plane);
- if (!data) continue;
- data_list = eina_list_append(data_list, data);
- }
-
- TRACE_DS_ASYNC_BEGIN((unsigned int)output->toutput, [OUTPUT:COMMIT~HANDLER]);
-
- error = tdm_output_commit(output->toutput, 0, _e_output_commit_hanler, data_list);
- if (error != TDM_ERROR_NONE)
- {
- ERR("fail to tdm_output_commit");
- TRACE_DS_ASYNC_END((unsigned int)output->toutput, [OUTPUT:COMMIT~HANDLER]);
- EINA_LIST_FOREACH_SAFE(data_list, l, ll, data)
- {
- data_list = eina_list_remove_list(data_list, l);
- e_plane_commit_data_release(data);
- data = NULL;
- }
- return EINA_FALSE;
- }
-
- return EINA_TRUE;
-}
-
EINTERN Eina_Bool
e_output_init(void)
{
{
E_Plane *plane = NULL;
Eina_List *l;
- Eina_Bool commitable = EINA_FALSE;
+ Eina_Bool fb_commit = EINA_FALSE;
Eina_Bool fb_hwc_on = EINA_FALSE;
EINA_SAFETY_ON_NULL_RETURN_VAL(output, EINA_FALSE);
return EINA_FALSE;
}
- EINA_LIST_FOREACH(output->planes, l, plane)
- {
- if (e_plane_is_fb_target(plane))
- {
- if (plane->ec)
- fb_hwc_on = EINA_TRUE;
-
- break;
- }
- }
-
/* set planes */
- EINA_LIST_REVERSE_FOREACH(output->planes, l, plane)
+ EINA_LIST_FOREACH(output->planes, l, plane)
{
- if (e_plane_fetch(plane))
- {
- if (output->dpms == E_OUTPUT_DPMS_OFF)
- {
- e_plane_unfetch(plane);
- continue;
- }
+ if (e_plane_is_fb_target(plane) && plane->ec)
+ fb_hwc_on = EINA_TRUE;
- if (!commitable) commitable = EINA_TRUE;
- }
-
- if (fb_hwc_on && plane->need_to_unset_commit && !commitable)
- commitable = EINA_TRUE;
- }
+ if (!e_plane_fetch(plane)) continue;
- /* commit output */
- if (commitable)
- {
- if (!_e_output_commit(output))
+ if (output->dpms == E_OUTPUT_DPMS_OFF)
{
- ERR("fail to _e_output_commit.");
-
- /* unset planes */
- EINA_LIST_REVERSE_FOREACH(output->planes, l, plane)
- e_plane_unfetch(plane);
+ e_plane_unfetch(plane);
+ continue;
+ }
- return EINA_FALSE;
+ if (e_plane_is_fb_target(plane))
+ {
+ _e_output_update_fps();
+ fb_commit = EINA_TRUE;
}
+ else
+ {
+ if (plane->need_to_unset_commit)
+ {
+ if (!fb_hwc_on && !fb_commit)
+ continue;
+ }
+ }
+
+ if (!e_plane_commit(plane))
+ ERR("fail to e_plane_commit");
}
return EINA_TRUE;
}
-
E_API E_Output *
e_output_find(const char *id)
{
tdm_error error;
if (plane_trace_debug)
- ELOGF("E_PLANE", "Unset Plane(%p)", NULL, NULL, plane);
+ ELOGF("E_PLANE", "Unset Plane(%p)", NULL, NULL, plane);
error = tdm_layer_unset_buffer(tlayer);
if (error != TDM_ERROR_NONE)
if (plane_trace_debug)
{
- ELOGF("E_PLANE", "Set Plane(%p) tsurface(%p) (%dx%d,[%d,%d,%d,%d]=>[%d,%d,%d,%d])",
+ ELOGF("E_PLANE", "Set Plane(%p) tsurface(%p) (%dx%d,[%d,%d,%d,%d]=>[%d,%d,%d,%d])",
NULL, NULL, plane, tsurface,
plane->info.src_config.size.h, plane->info.src_config.size.h,
plane->info.src_config.pos.x, plane->info.src_config.pos.y,
EINA_SAFETY_ON_NULL_RETURN_VAL(plane, EINA_FALSE);
- if (plane->pending_commit_data)
+ if (plane->pending_commit)
return EINA_FALSE;
if (plane->is_fb && !plane->ec)
}
}
+static void
+_e_plane_vblank_handler(tdm_output *output, unsigned int sequence,
+ unsigned int tv_sec, unsigned int tv_usec,
+ void *user_data)
+{
+ E_Plane *plane = (E_Plane *)user_data;
+
+ EINA_SAFETY_ON_NULL_RETURN(plane);
+
+ plane->pending_commit = EINA_FALSE;
+}
+
+static void
+_e_plane_commit_hanler(tdm_layer *layer, unsigned int sequence,
+ unsigned int tv_sec, unsigned int tv_usec,
+ void *user_data)
+{
+ E_Plane_Commit_Data *data = (E_Plane_Commit_Data *)user_data;
+
+ EINA_SAFETY_ON_NULL_RETURN(data);
+
+ TRACE_DS_ASYNC_END((unsigned int)layer, [PLANE:COMMIT~HANDLER]);
+
+ e_plane_commit_data_release(data);
+}
+
+EINTERN Eina_Bool
+e_plane_commit(E_Plane *plane)
+{
+ E_Plane_Commit_Data *data = NULL;
+ tdm_error error = TDM_ERROR_NONE;
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(plane, EINA_FALSE);
+
+ data = e_plane_commit_data_aquire(plane);
+
+ if (!data) return EINA_TRUE;
+
+ TRACE_DS_ASYNC_BEGIN((unsigned int)plane->tlayer, [PLANE:COMMIT~HANDLER]);
+
+ if (plane_trace_debug)
+ ELOGF("E_PLANE", "Commit Plane(%p) tsurface(%p) tqueue(%p) data(%p)",
+ NULL, NULL, plane, data->tsurface, plane->renderer ? plane->renderer->tqueue : NULL, data);
+
+ 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(data);
+ 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;
+ }
+
+ return EINA_TRUE;
+}
+
EINTERN E_Plane_Commit_Data *
e_plane_commit_data_aquire(E_Plane *plane)
{
data->plane = plane;
data->tsurface = NULL;
data->ec = NULL;
- plane->pending_commit_data = data;
+ plane->pending_commit = EINA_TRUE;
plane->need_to_unset_commit = EINA_FALSE;
return data;
/* set the update_exist to be false */
e_plane_renderer_update_exist_set(plane->renderer, EINA_FALSE);
- plane->pending_commit_data = data;
+ plane->pending_commit = EINA_TRUE;
return data;
}
/* set the update_exist to be false */
e_plane_renderer_update_exist_set(plane->renderer, EINA_FALSE);
- plane->pending_commit_data = data;
+ plane->pending_commit = EINA_TRUE;
/* send frame event enlightenment dosen't send frame evnet in nocomp */
e_pixmap_image_clear(plane->ec->pixmap, 1);
if (!tsurface)
{
- plane->pending_commit_data = NULL;
e_comp_wl_buffer_reference(&plane->displaying_buffer_ref, NULL);
if (plane->displaying_buffer_tsurface)
{
e_comp_wl_buffer_reference(&data->buffer_ref, NULL);
}
- plane->pending_commit_data = NULL;
tbm_surface_internal_unref(tsurface);
free(data);
}