static Eina_Bool ehws_trace = EINA_FALSE;
static Eina_Bool ehws_dump_enable = EINA_FALSE;
+static Eina_List *hwc_windows_event_hdlrs = NULL;
static int E_EVENT_HWC_WINDOWS_COMP_INFO_FREE = -1;
hwc->wait_commit = set;
}
-static Eina_Bool
-_e_hwc_windows_device_states_available_check(E_Hwc *hwc)
-{
- return hwc->device_state_available;
-}
-
static void
_e_hwc_windows_status_print(E_Hwc *hwc, Eina_Bool with_target)
{
const Eina_List *l;
E_Hwc_Window *hwc_window;
- EHWSTRACE(" Device state available : %d", NULL, hwc,
- _e_hwc_windows_device_states_available_check(hwc));
+ EHWSTRACE(" Restriction : 0x%x", NULL, hwc,
+ e_hwc_windows_restriction_get(hwc));
EINA_LIST_FOREACH(visible_windows, l, hwc_window)
{
visible_windows = hwc->visible_windows;
/* check if e20 forces to set that all window has TDM_HWC_WIN_COMPOSITION_CLIENT types */
- if (_e_hwc_windows_device_states_available_check(hwc))
+ if (!e_hwc_windows_restriction_get(hwc))
{
/* check clients are able to use hwc */
EINA_LIST_FOREACH(visible_windows, l, hwc_window)
return EINA_TRUE;
}
-static Eina_Bool
-_e_hwc_windows_device_state_available_update(E_Hwc *hwc)
-{
- Eina_Bool available = EINA_TRUE;
-
- /* make the full_gl_composite when the zoom is enabled */
- if (hwc->pp_set)
- {
- available = EINA_FALSE;
- goto finish;
- }
-
- /* make the full_gl_composite when the mirror mode is enabled */
- if (eina_list_count(hwc->mirror_dst_hwc))
- {
- available = EINA_FALSE;
- goto finish;
- }
-
- /* full composite is forced to be set */
- if (e_hwc_deactive_get(hwc))
- {
- available = EINA_FALSE;
- goto finish;
- }
-
- /* hwc_window manager required full GLES composition */
- if (e_comp->nocomp_override > 0)
- {
- available = EINA_FALSE;
- goto finish;
- }
-
-finish:
- if (hwc->device_state_available == available) return EINA_FALSE;
-
- hwc->device_state_available = available;
-
- return EINA_TRUE;
-}
-
static void
_e_hwc_windows_pp_hwc_window_update(E_Hwc *hwc)
{
if (_e_hwc_windows_visible_windows_update(hwc))
update_changes = EINA_TRUE;
- /* update the the visible windows */
- if (_e_hwc_windows_device_state_available_update(hwc))
- update_changes = EINA_TRUE;
-
EINA_LIST_FOREACH_SAFE(hwc->hwc_windows, l, ll, hwc_window)
{
if (e_hwc_window_is_target(hwc_window)) continue;
return EINA_TRUE;
}
+static Eina_Bool
+_e_hwc_windows_cb_desk_geometry_change(void *data, int type, void *event)
+{
+ E_Event_Desk_Geometry_Change *ev;
+ E_Desk *desk;
+ E_Zone *zone;
+ E_Output *output;
+ E_Hwc *hwc;
+
+ ev = event;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(ev, ECORE_CALLBACK_PASS_ON);
+
+ desk = ev->desk;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(desk, ECORE_CALLBACK_PASS_ON);
+
+ zone = desk->zone;
+ if (!zone) return ECORE_CALLBACK_PASS_ON;
+
+ output = e_output_find(zone->output_id);
+ if (!output) return ECORE_CALLBACK_PASS_ON;
+
+ hwc = output->hwc;
+ if (!hwc) return ECORE_CALLBACK_PASS_ON;
+
+ if ((desk->geom.x != zone->x) || (desk->geom.y != zone->y) ||
+ (desk->geom.w != zone->w) || (desk->geom.h != zone->h))
+ e_hwc_windows_restriction_set(hwc, E_HWC_WINS_RESTRICTION_DESK_GEOMETRY);
+ else
+ e_hwc_windows_restriction_unset(hwc, E_HWC_WINS_RESTRICTION_DESK_GEOMETRY);
+
+ return ECORE_CALLBACK_PASS_ON;
+}
+
EINTERN Eina_Bool
e_hwc_windows_init(void)
{
return EINA_FALSE;
}
+ E_LIST_HANDLER_APPEND(hwc_windows_event_hdlrs, E_EVENT_DESK_GEOMETRY_CHANGE,
+ _e_hwc_windows_cb_desk_geometry_change, NULL);
+
return EINA_TRUE;
}
EINTERN void
e_hwc_windows_deinit(void)
{
+ E_FREE_LIST(hwc_windows_event_hdlrs, ecore_event_handler_del);
+
e_hwc_window_queue_deinit();
e_hwc_window_deinit();
}
hwc->pp_set = EINA_TRUE;
+ e_hwc_windows_restriction_set(hwc, E_HWC_WINS_RESTRICTION_PP_SET);
+
return EINA_TRUE;
fail:
hwc->pp_hwc_window = NULL;
hwc->pp_set = EINA_FALSE;
+ e_hwc_windows_restriction_unset(hwc, E_HWC_WINS_RESTRICTION_PP_SET);
+
if (hwc->pp_tqueue)
{
EHWSINF("PP Destroy pp_tqueue:%p", NULL, hwc, hwc->pp_tqueue);
/* add mirror_dst list to the src_hwc */
src_hwc->mirror_dst_hwc = eina_list_append(src_hwc->mirror_dst_hwc, hwc);
+ e_hwc_windows_restriction_set(hwc, E_HWC_WINS_RESTRICTION_MIRROR);
+
EHWSINF("e_hwc_windows_mirror_set src_hwc:%p", NULL, hwc, src_hwc);
return EINA_TRUE;
/* remove mirror_dst list at the src_hwc */
src_hwc->mirror_dst_hwc = eina_list_remove(src_hwc->mirror_dst_hwc, hwc);
+ if (!src_hwc->mirror_dst_hwc)
+ e_hwc_windows_restriction_unset(hwc, E_HWC_WINS_RESTRICTION_MIRROR);
if (hwc->zoom_enabled)
{
if (hwc->comp_override == set) return;
hwc->comp_override = set;
+
+ if (set)
+ e_hwc_windows_restriction_set(hwc, E_HWC_WINS_RESTRICTION_COMP_OVERRIDE);
+ else
+ e_hwc_windows_restriction_unset(hwc, E_HWC_WINS_RESTRICTION_COMP_OVERRIDE);
+}
+
+EINTERN void
+e_hwc_windows_restriction_set(E_Hwc *hwc, E_Hwc_Windows_Restriction restriction)
+{
+ EINA_SAFETY_ON_NULL_RETURN(hwc);
+
+ if (hwc->restriction & restriction) return;
+
+ hwc->restriction |= restriction;
+
+ EHWSTRACE("restriction set:0x%x", NULL, hwc, restriction);
+}
+
+EINTERN void
+e_hwc_windows_restriction_unset(E_Hwc *hwc, E_Hwc_Windows_Restriction restriction)
+{
+ EINA_SAFETY_ON_NULL_RETURN(hwc);
+
+ if (!(hwc->restriction & restriction)) return;
+
+ hwc->restriction &= ~restriction;
+
+ EHWSTRACE("restriction set:0x%x", NULL, hwc, restriction);
+}
+
+EINTERN unsigned int
+e_hwc_windows_restriction_get(E_Hwc *hwc)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(hwc, 0);
+
+ return hwc->restriction;
}