/* return TRUE when the number of the commit data is more than one */
EINA_LIST_FOREACH(hwc->hwc_windows, l, hwc_window)
{
+ if ((E_Hwc_Window *)hwc->root_target_hwc_window == hwc_window)
+ continue;
+
commit_data = e_hwc_window_commit_data_acquire(hwc_window);
if (!commit_data)
{
EINTERN void
e_hwc_windows_target_window_force_render(E_Hwc_Window_Target *target_hwc_window)
{
+ E_Hwc_Window_Target *root_target_hwc_window;
+ E_Output *primary_output;
+ E_Hwc *hwc;
int w, h;
- if (!target_hwc_window->ee) return;
- if (!target_hwc_window->evas) return;
+ hwc = target_hwc_window->hwc;
+ EINA_SAFETY_ON_NULL_RETURN(hwc);
- ecore_evas_geometry_get(target_hwc_window->ee, 0, 0, &w, &h);
- evas_damage_rectangle_add(target_hwc_window->evas, 0, 0, w, h);
+ if (hwc->primary_output)
+ {
+ root_target_hwc_window = hwc->root_target_hwc_window;
+ EINA_SAFETY_ON_NULL_RETURN(root_target_hwc_window);
+ }
+ else
+ {
+ primary_output = e_comp_screen_primary_output_get(e_comp->e_comp_screen);
+ EINA_SAFETY_ON_NULL_RETURN(primary_output);
+ EINA_SAFETY_ON_NULL_RETURN(primary_output->hwc);
+
+ root_target_hwc_window = primary_output->hwc->root_target_hwc_window;
+ EINA_SAFETY_ON_NULL_RETURN(root_target_hwc_window);
+ }
+
+ if (!root_target_hwc_window->ee) return;
+ if (!root_target_hwc_window->evas) return;
+
+ ecore_evas_geometry_get(root_target_hwc_window->ee, 0, 0, &w, &h);
+ evas_damage_rectangle_add(root_target_hwc_window->evas, 0, 0, w, h);
}
static Eina_Bool
if ((hwc_window->current.buffer.tsurface) &&
(hwc_window->current.buffer.tsurface != hwc_window->display.buffer.tsurface))
{
+ e_hwc_window_queue_buffer_reference(&hwc_window->current.queue_buffer_ref, hwc_window->display.queue_buffer_ref.buffer);
+ e_hwc_window_buffer_set(&hwc_window->current.buffer, hwc_window->display.buffer.tsurface,
+ hwc_window->display.buffer.queue, hwc_window->display.buffer.transform);
+ tdm_hwc_set_client_target_buffer(thwc, hwc_window->display.buffer.tsurface, fb_damage);
+
+ e_hwc_windows_target_window_force_render(target_hwc_window);
+ }
+
+ if (hwc->root_target_hwc_window)
+ {
+ hwc_window = (E_Hwc_Window *)hwc->root_target_hwc_window;
+
comp_info = _e_hwc_windows_comp_info_get(hwc_window->current.buffer.tsurface);
if (comp_info)
{
- e_hwc_window_presentation_time_feedback_take(hwc_window,
+ e_hwc_window_presentation_time_feedback_take((E_Hwc_Window *)target_hwc_window,
&comp_info->presentation_container);
- e_hwc_window_presentation_callback_take(hwc_window,
+ e_hwc_window_presentation_callback_take((E_Hwc_Window *)target_hwc_window,
&comp_info->presentation_callbacks);
}
e_hwc_window_queue_buffer_reference(&hwc_window->current.queue_buffer_ref, hwc_window->display.queue_buffer_ref.buffer);
e_hwc_window_buffer_set(&hwc_window->current.buffer, hwc_window->display.buffer.tsurface,
hwc_window->display.buffer.queue, hwc_window->display.buffer.transform);
- tdm_hwc_set_client_target_buffer(thwc, hwc_window->display.buffer.tsurface, fb_damage);
-
- e_hwc_windows_target_window_force_render(target_hwc_window);
}
return EINA_TRUE;
}
-/* set the tsurface to the target_window->tsurface according to the state.
- * 1. try to set the tsurface to the target_window at E_HWC_WINDOW_STATE_DEVICE.
- * 2. try to set NULL and release(clear) tsurface_queue of the target_window at E_HWC_WINDOW_STATE_NONE.
- * Returing EINA_FALSE means that there is no update for the target_window->tsurface.
- **/
static Eina_Bool
-_e_hwc_windows_target_buffer_fetch(E_Hwc *hwc)
+_e_hwc_windows_root_target_buffer_fetch(E_Hwc *hwc)
{
E_Hwc_Window_Target *target_hwc_window;
E_Hwc_Window *hwc_window, *hw;
- tdm_hwc *thwc;
tbm_surface_h tsurface;
- tdm_region fb_damage;
Eina_List *rendered_windows = NULL;
E_Hwc_Window_Queue_Buffer *queue_buffer = NULL;
E_Hwc_Windows_Comp_Info *comp_info;
const Eina_List *l;
int i;
- target_hwc_window = hwc->target_hwc_window;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(hwc, EINA_FALSE);
+
+ target_hwc_window = hwc->root_target_hwc_window;
EINA_SAFETY_ON_NULL_RETURN_VAL(target_hwc_window, EINA_FALSE);
hwc_window = (E_Hwc_Window *)target_hwc_window;
- thwc = hwc->thwc;
- EINA_SAFETY_ON_NULL_RETURN_VAL(thwc, EINA_FALSE);
-
if (!hwc_window->queue)
{
if (!_e_hwc_windows_target_window_queue_set(target_hwc_window))
{
- EHWSERR("fail to _e_hwc_windows_target_window_queue_set", hwc);
+ EHWSERR("fail to _e_hwc_windows_target_window_queue_set", NULL);
return EINA_FALSE;
}
}
- EINA_SAFETY_ON_NULL_RETURN_VAL(hwc_window->queue , EINA_FALSE);
-
- if ((hwc->pp_set) && (target_hwc_window->pp_queue))
- queue = target_hwc_window->pp_queue;
- else
- queue = hwc_window->queue;
+ queue = hwc_window->queue;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(queue, EINA_FALSE);
if (hwc_window->state == E_HWC_WINDOW_STATE_DEVICE)
{
comp_info = _e_hwc_windows_comp_info_get(tsurface);
if ((comp_info) && (comp_info->skip))
{
- e_hwc_window_presentation_time_feedback_take(hwc_window,
+ e_hwc_window_presentation_time_feedback_take((E_Hwc_Window *)hwc->target_hwc_window,
&comp_info->presentation_container);
- e_hwc_window_presentation_callback_take(hwc_window,
+ e_hwc_window_presentation_callback_take((E_Hwc_Window *)hwc->target_hwc_window,
&comp_info->presentation_callbacks);
e_hwc_window_queue_buffer_release(queue, queue_buffer);
return EINA_FALSE;
e_hwc_window_buffer_set(&hwc_window->current.buffer, tsurface, queue, 0);
e_hwc_window_info_update(hwc_window);
- /* the damage isn't supported by hwc extension yet */
- CLEAR(fb_damage);
-
- tdm_hwc_set_client_target_buffer(thwc, hwc_window->current.buffer.tsurface, fb_damage);
- if ((target_hwc_window->end_render_sync) && (e_hwc_windows_fence_enabled_get(hwc)))
- {
- int fence = e_egl_sync_fence_fd_dup(target_hwc_window->end_render_sync);
- if (fence >= 0)
- {
- tdm_hwc_set_client_target_acquire_fence(thwc, fence);
- close(fence);
- }
- }
-
if (ehws_trace)
{
rendered_windows = _e_hwc_windows_target_window_rendered_windows_get(hwc_window->current.buffer.tsurface);
if (n_thw)
{
EHWSTRACE("FET {%s} ts:%p state:%s has hwc_windows to render below.",
- NULL, hwc, "@TARGET WINDOW@", hwc_window->current.buffer.tsurface,
+ NULL, hwc, "@ROOT TARGET WINDOW@", hwc_window->current.buffer.tsurface,
e_hwc_window_state_string_get(hwc_window->state));
i = 0;
}
else
EHWSTRACE("FET {%s} ts:%p state:%s has no hwc_windows to render.",
- NULL, hwc, "@TARGET WINDOW@", hwc_window->current.buffer.tsurface,
+ NULL, hwc, "@ROOT TARGET WINDOW@", hwc_window->current.buffer.tsurface,
e_hwc_window_state_string_get(hwc_window->state));
}
}
comp_info = _e_hwc_windows_comp_info_get(hwc_window->current.buffer.tsurface);
if (comp_info)
{
- e_hwc_window_presentation_time_feedback_take(hwc_window,
+ e_hwc_window_presentation_time_feedback_take((E_Hwc_Window *)hwc->target_hwc_window,
&comp_info->presentation_container);
- e_hwc_window_presentation_callback_take(hwc_window,
+ e_hwc_window_presentation_callback_take((E_Hwc_Window *)hwc->target_hwc_window,
&comp_info->presentation_callbacks);
}
}
e_hwc_window_buffer_set(&hwc_window->current.buffer, NULL, NULL, 0);
e_hwc_window_info_update(hwc_window);
+ EHWSTRACE("FET {%s} ts:%p state:%s",
+ NULL, hwc, "@ROOT TARGET WINDOW@", hwc_window->current.buffer.tsurface,
+ e_hwc_window_state_string_get(hwc_window->state));
+ }
+
+ return EINA_TRUE;
+}
+
+static Eina_Bool
+_e_hwc_windows_target_buffer_fetch(E_Hwc *hwc)
+{
+ E_Hwc_Window_Target *target_hwc_window;
+ E_Hwc_Window *hwc_window, *root_hwc_window;
+ E_Hwc_Window_Queue_Buffer *queue_buffer;
+ E_Output *primary_output;
+ tdm_region fb_damage;
+ tbm_surface_h tsurface;
+ tdm_hwc *thwc;
+
+ thwc = hwc->thwc;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(thwc, EINA_FALSE);
+
+ target_hwc_window = hwc->target_hwc_window;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(target_hwc_window, EINA_FALSE);
+
+ hwc_window = (E_Hwc_Window *)target_hwc_window;
+
+ if (hwc->primary_output)
+ {
+ root_hwc_window = (E_Hwc_Window *)hwc->root_target_hwc_window;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(root_hwc_window, EINA_FALSE);
+ }
+ else
+ {
+ primary_output = e_comp_screen_primary_output_get(e_comp->e_comp_screen);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(primary_output, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(primary_output->hwc, EINA_FALSE);
+
+ root_hwc_window = (E_Hwc_Window *)primary_output->hwc->root_target_hwc_window;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(root_hwc_window, EINA_FALSE);
+ }
+
+ if (hwc_window->state == E_HWC_WINDOW_STATE_DEVICE)
+ {
+ if ((hwc->pp_set) && (target_hwc_window->pp_queue))
+ queue_buffer = e_hwc_window_queue_buffer_acquire(target_hwc_window->pp_queue);
+ else
+ queue_buffer = root_hwc_window->current.queue_buffer_ref.buffer;
+
+ if (!queue_buffer) return EINA_FALSE;
+
+ tsurface = queue_buffer->tsurface;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(tsurface, EINA_FALSE);
+
+ if (tsurface == hwc_window->current.buffer.tsurface) return EINA_FALSE;
+
+ e_hwc_window_queue_buffer_reference(&hwc_window->current.queue_buffer_ref, queue_buffer);
+ e_hwc_window_buffer_set(&hwc_window->current.buffer, tsurface, NULL, 0);
+ e_hwc_window_info_update(hwc_window);
+
+ /* the damage isn't supported by hwc extension yet */
+ CLEAR(fb_damage);
+
+ tdm_hwc_set_client_target_buffer(thwc, hwc_window->current.buffer.tsurface, fb_damage);
+ if ((target_hwc_window->end_render_sync) && (e_hwc_windows_fence_enabled_get(hwc)))
+ {
+ int fence = e_egl_sync_fence_fd_dup(target_hwc_window->end_render_sync);
+ if (fence >= 0)
+ {
+ tdm_hwc_set_client_target_acquire_fence(thwc, fence);
+ close(fence);
+ }
+ }
+
+ EHWSTRACE("FET {%s} ts:%p state:%s",
+ NULL, hwc, "@TARGET WINDOW@",
+ hwc_window->current.buffer.tsurface, e_hwc_window_state_string_get(hwc_window->state));
+
+ }
+ else
+ {
+ if (!hwc_window->current.buffer.tsurface) return EINA_FALSE;
+
+ e_hwc_window_queue_buffer_reference(&hwc_window->current.queue_buffer_ref, NULL);
+ e_hwc_window_buffer_set(&hwc_window->current.buffer, NULL, NULL, 0);
+ e_hwc_window_info_update(hwc_window);
+
CLEAR(fb_damage);
tdm_hwc_set_client_target_buffer(thwc, NULL, fb_damage);
if (e_hwc_windows_fence_enabled_get(hwc))
tdm_hwc_set_client_target_acquire_fence(thwc, -1);
+
+ EHWSTRACE("FET {%s} ts:%p state:%s",
+ NULL, hwc, "@TARGET WINDOW@",
+ hwc_window->current.buffer.tsurface, e_hwc_window_state_string_get(hwc_window->state));
}
return EINA_TRUE;
fence_enabled = e_hwc_windows_fence_enabled_get(target_hwc_window->hwc);
- EINA_LIST_FOREACH(target_hwc_window->hwc->hwc_windows, l, hwc_window)
+ EINA_LIST_FOREACH(target_hwc_window->rendered_windows, l, hwc_window)
{
E_Client *ec = NULL;
E_Comp_Wl_Client_Data *cdata;
- if (hwc_window->render_target)
- e_hwc_presentation_callback_list_merge(&comp_info->presentation_callbacks,
- &hwc_window->pending_presentation_callbacks);
-
if (!hwc_window->on_rendered_target) continue;
hwc_window->on_rendered_target = EINA_FALSE;
+ e_hwc_presentation_callback_list_merge(&comp_info->presentation_callbacks,
+ &hwc_window->pending_presentation_callbacks);
+
ec = hwc_window->ec;
if (!ec) continue;
{
E_Hwc_Window *target_window = (E_Hwc_Window *)target_hwc_window;
- evas_event_callback_del(target_hwc_window->evas,
- EVAS_CALLBACK_RENDER_FLUSH_POST,
- _e_hwc_windows_target_window_render_flush_post_cb);
+ if (target_hwc_window->evas)
+ {
+ evas_event_callback_del(target_hwc_window->evas,
+ EVAS_CALLBACK_RENDER_FLUSH_POST,
+ _e_hwc_windows_target_window_render_flush_post_cb);
- evas_event_callback_del(target_hwc_window->evas,
- EVAS_CALLBACK_RENDER_FLUSH_PRE,
- _e_hwc_windows_target_window_render_flush_pre_cb);
+ evas_event_callback_del(target_hwc_window->evas,
+ EVAS_CALLBACK_RENDER_FLUSH_PRE,
+ _e_hwc_windows_target_window_render_flush_pre_cb);
- evas_event_callback_del(target_hwc_window->evas,
- EVAS_CALLBACK_RENDER_PRE,
- _e_hwc_windows_target_window_render_pre_cb);
+ evas_event_callback_del(target_hwc_window->evas,
+ EVAS_CALLBACK_RENDER_PRE,
+ _e_hwc_windows_target_window_render_pre_cb);
+ }
+
+ if (target_hwc_window->event_hdlr)
+ ecore_main_fd_handler_del(target_hwc_window->event_hdlr);
- ecore_main_fd_handler_del(target_hwc_window->event_hdlr);
- close(target_hwc_window->event_fd);
+ if (target_hwc_window->event_fd >= 0)
+ close(target_hwc_window->event_fd);
if (target_window->queue && target_window->queue->tqueue)
tbm_surface_queue_destroy(target_window->queue->tqueue);
_e_hwc_windows_transition_check(E_Hwc *hwc)
{
E_Hwc_Window *hwc_window = NULL;
- E_Hwc_Window_Target *target_hwc_window = NULL;
+ E_Hwc_Window_Target *target_hwc_window = NULL, *root_target_hwc_window;
Eina_Bool transition = EINA_FALSE;
const Eina_List *l;
Eina_Bool display_state_changed = EINA_FALSE;
Eina_Bool target_window_changed = EINA_FALSE;
Eina_Bool client_to_none_transition = EINA_FALSE;
E_Hwc_Window_Queue_Type queue_type;
+ E_Output *primary_output;
target_hwc_window = hwc->target_hwc_window;
EINA_SAFETY_ON_NULL_RETURN_VAL(target_hwc_window, EINA_FALSE);
- queue_type = e_hwc_window_queue_type_get(((E_Hwc_Window *)target_hwc_window)->queue);
+ if (hwc->primary_output)
+ {
+ root_target_hwc_window = hwc->root_target_hwc_window;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(root_target_hwc_window, EINA_FALSE);
+ }
+ else
+ {
+ primary_output = e_comp_screen_primary_output_get(e_comp->e_comp_screen);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(primary_output, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(primary_output->hwc, EINA_FALSE);
+
+ root_target_hwc_window = primary_output->hwc->root_target_hwc_window;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(root_target_hwc_window, EINA_FALSE);
+ }
+
+ queue_type = e_hwc_window_queue_type_get(((E_Hwc_Window *)root_target_hwc_window)->queue);
if (queue_type == E_HWC_WINDOW_QUEUE_TYPE_GBM_SURFACE) return EINA_FALSE;
EINA_LIST_FOREACH(hwc->hwc_windows, l, hwc_window)
update_changes = EINA_TRUE;
}
+ if (hwc->primary_output)
+ _e_hwc_windows_root_target_buffer_fetch(hwc);
+
/* fetch the target buffer (try acquire) */
if (_e_hwc_windows_target_buffer_fetch(hwc))
update_changes = EINA_TRUE;
EINA_SAFETY_ON_NULL_RETURN_VAL(hwc, EINA_FALSE);
- target_hwc_window = hwc->target_hwc_window;
+ target_hwc_window = hwc->root_target_hwc_window;
EINA_SAFETY_ON_NULL_RETURN_VAL(target_hwc_window, EINA_FALSE);
target_window = (E_Hwc_Window *)target_hwc_window;
EINA_SAFETY_ON_NULL_RETURN(target_hwc_window);
hwc_window = (E_Hwc_Window *)target_hwc_window;
- if ((hwc_window->display.buffer.tsurface) && (hwc_window->display.buffer.queue) &&
+ if ((hwc_window->display.buffer.tsurface) &&
(hwc_window->display.buffer.tsurface != hwc_window->commit.buffer.tsurface))
{
comp_info = _e_hwc_windows_comp_info_get(hwc_window->display.buffer.tsurface);
e_hwc_windows_rendered_window_add(E_Hwc_Window *hwc_window)
{
E_Hwc *hwc;
- E_Hwc_Window_Target *target_hwc_window;
+ E_Hwc_Window_Target *root_target_hwc_window;
E_Client *ec;
+ E_Output *primary_output;
EINA_SAFETY_ON_NULL_RETURN(hwc_window);
+ EINA_SAFETY_ON_NULL_RETURN(e_comp);
+ EINA_SAFETY_ON_NULL_RETURN(e_comp->e_comp_screen);
if (hwc_window->on_rendered_target) return;
ec = hwc_window->ec;
EINA_SAFETY_ON_NULL_RETURN(ec);
- hwc = hwc_window->hwc;
+ primary_output = e_comp_screen_primary_output_get(e_comp->e_comp_screen);
+ EINA_SAFETY_ON_NULL_RETURN(primary_output);
+
+ hwc = primary_output->hwc;
EINA_SAFETY_ON_NULL_RETURN(hwc);
- target_hwc_window = hwc->target_hwc_window;
- EINA_SAFETY_ON_NULL_RETURN(target_hwc_window);
+ root_target_hwc_window = hwc->root_target_hwc_window;
+ EINA_SAFETY_ON_NULL_RETURN(root_target_hwc_window);
- target_hwc_window->rendered_windows =
- eina_list_append(target_hwc_window->rendered_windows, hwc_window);
+ root_target_hwc_window->rendered_windows =
+ eina_list_append(root_target_hwc_window->rendered_windows, hwc_window);
hwc_window->on_rendered_target = EINA_TRUE;