static void
_e_video_hwc_planes_pending_buffer_commit(E_Video_Hwc_Planes *evhp)
{
+ E_Comp_Wl_Video_Buf *vbuf;
+
if (evhp->pending.vbuf)
{
- _e_video_hwc_planes_buffer_commit(evhp,
- evhp->pending.vbuf,
- &evhp->pending.info);
+ vbuf = evhp->pending.vbuf;
evhp->pending.vbuf = NULL;
+ _e_video_hwc_planes_buffer_commit(evhp, vbuf, &evhp->pending.info);
}
else
e_video_hwc_wait_buffer_commit((E_Video_Hwc *)evhp);
return EINA_FALSE;
}
-static void
-_e_video_hwc_planes_tdm_layer_unset(E_Video_Hwc_Planes *evhp)
-{
- unsigned int usable = 1;
-
- if (!evhp->tdm.layer) return;
-
- _tdm_layer_usable_get(evhp->tdm.layer, &usable);
- if (!usable && !evhp->video_plane_ready_handler)
- {
- VIN("stop video", evhp->base.ec);
- _tdm_layer_buffer_unset(evhp->tdm.layer);
- _tdm_layer_commit(evhp->tdm.layer, NULL, NULL);
- }
-
- VIN("release layer: %p", evhp->base.ec, evhp->tdm.layer);
- _e_video_hwc_planes_tdm_layer_usable_set(evhp->tdm.layer, EINA_TRUE);
- evhp->tdm.layer = NULL;
- evhp->base.old_comp_buffer = NULL;
-
- e_plane_video_set(evhp->e_plane, EINA_FALSE, NULL);
- evhp->e_plane = NULL;
-
- E_FREE_FUNC(evhp->video_plane_ready_handler, e_plane_hook_del);
-}
-
static void
_e_video_hwc_planes_cb_commit_handler(tdm_layer *layer, unsigned int sequence,
unsigned int tv_sec, unsigned int tv_usec,
E_Client_Video_Info old_info;
tdm_error ret;
+ if (!evhp->tdm.layer)
+ {
+ VIN("set layer: show", evhp->base.ec);
+ if (!_e_video_hwc_planes_tdm_layer_set(evhp))
+ {
+ VER("set layer failed", evhp->base.ec);
+ return EINA_FALSE;
+ }
+ }
+
+ if (evhp->video_plane_ready_handler)
+ {
+ VIN("wait for video plane ready: Pending commit vbuf(%p)",
+ evhp->base.ec, vbuf);
+
+ if (evhp->pending.vbuf)
+ {
+ /* Cannot reach here because following buffers are supposed
+ * to be queued by 'e_video_hwc' until calling fb_update by
+ * this child module. */
+ NEVER_GET_HERE();
+
+ return EINA_FALSE;
+ }
+
+ evhp->pending.vbuf = vbuf;
+ memcpy(&evhp->pending.info, info, sizeof(E_Client_Video_Info));
+
+ return EINA_TRUE;
+ }
+
if (evhp->tdm.prop_list)
{
// need call tdm property in list
return EINA_TRUE;
}
+static void
+_e_video_hwc_planes_tdm_layer_unset(E_Video_Hwc_Planes *evhp)
+{
+ unsigned int usable = 1;
+
+ if (!evhp->tdm.layer) return;
+
+ if (evhp->wait_flag.commit)
+ {
+ tdm_layer_remove_commit_handler(evhp->tdm.layer, _e_video_hwc_planes_cb_commit_handler, evhp);
+ evhp->wait_flag.commit = EINA_FALSE;
+ }
+
+ _tdm_layer_usable_get(evhp->tdm.layer, &usable);
+ if (!usable && !evhp->video_plane_ready_handler)
+ {
+ VIN("stop video", evhp->base.ec);
+ _tdm_layer_buffer_unset(evhp->tdm.layer);
+ _tdm_layer_commit(evhp->tdm.layer, NULL, NULL);
+ }
+
+ VIN("release layer: %p", evhp->base.ec, evhp->tdm.layer);
+ _e_video_hwc_planes_tdm_layer_usable_set(evhp->tdm.layer, EINA_TRUE);
+ evhp->tdm.layer = NULL;
+ evhp->base.old_comp_buffer = NULL;
+
+ e_plane_video_set(evhp->e_plane, EINA_FALSE, NULL);
+ evhp->e_plane = NULL;
+
+ E_FREE_FUNC(evhp->video_plane_ready_handler, e_plane_hook_del);
+}
+
static void
_e_video_hwc_planes_cb_evas_hide(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
if (evhp->tdm.late_prop_list)
NEVER_GET_HERE();
+ if (evhp->wait_flag.vblank)
+ {
+ tdm_output_remove_vblank_handler(evhp->tdm.output, _e_video_hwc_planes_cb_vblank_handler, evhp);
+ evhp->wait_flag.vblank = EINA_FALSE;
+ }
+
if (evhp->tdm.layer)
{
VIN("unset layer: destroy", evhp->base.ec);
info.dst_pos.h = evhp->base.geo.tdm.output_r.h;
info.transform = vbuf->content_t;
- if (!evhp->tdm.layer)
- {
- VIN("set layer: show", evhp->base.ec);
- if (!_e_video_hwc_planes_tdm_layer_set(evhp))
- {
- VER("set layer failed", evhp->base.ec);
- return EINA_FALSE;
- }
- }
-
- if (evhp->video_plane_ready_handler)
- {
- VIN("wait for video plane ready: Pending commit vbuf(%p)",
- evhp->base.ec, vbuf);
-
- if (evhp->pending.vbuf)
- {
- /* Cannot reach here because following buffers are supposed
- * to be queued by 'e_video_hwc' until calling fb_update by
- * this child module. */
- NEVER_GET_HERE();
-
- return EINA_FALSE;
- }
-
- evhp->pending.vbuf = vbuf;
- memcpy(&evhp->pending.info, &info, sizeof(E_Client_Video_Info));
-
- return EINA_TRUE;
- }
-
ret = _e_video_hwc_planes_buffer_commit(evhp, vbuf, &info);
}