e_hwc: add E_EVENT_HWC_ACTIVE/DEACTIVE event 04/216004/2 accepted/tizen/unified/20191021.220221 submit/tizen/20191021.062138
authorChangyeon Lee <cyeon.lee@samsung.com>
Fri, 18 Oct 2019 05:50:01 +0000 (14:50 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Fri, 18 Oct 2019 07:02:08 +0000 (16:02 +0900)
Change-Id: I93d7c35abf68453008f23800c869b1b239c83bd6

src/bin/e_comp_screen.c
src/bin/e_hwc.c
src/bin/e_hwc.h

index 721d5a90a79cec6905dacb4dc353946538608bca..18190aae005967cc8993ef781877bddad6cf59b0 100644 (file)
@@ -653,6 +653,7 @@ _e_comp_screen_deinit_outputs(E_Comp_Screen *e_comp_screen)
         e_output_del(output);
      }
 
+   e_hwc_deinit();
    e_hwc_windows_deinit();
    e_hwc_planes_deinit();
    e_output_shutdown();
@@ -707,6 +708,12 @@ _e_comp_screen_init_outputs(E_Comp_Screen *e_comp_screen)
 
    ELOGF("COMP_SCREEN","num_outputs = %i", NULL, e_comp_screen->num_outputs);
 
+   if (!e_hwc_init())
+     {
+        ERR("e_hwc_init failed");
+        goto fail;
+     }
+
    if (!e_hwc_planes_init())
      {
         ERR("e_hwc_planes_init failed");
index 261bbea9765b4d66cee564d529027032c2cc2494..057c3edcd1ae66b71e02e04ce3b7d748ad09337c 100644 (file)
@@ -17,6 +17,9 @@
      }                                                                \
    while (0)
 
+E_API int E_EVENT_HWC_ACTIVE = -1;
+E_API int E_EVENT_HWC_DEACTIVE = -1;
+
 static int _e_hwc_intercept_hooks_delete = 0;
 static int _e_hwc_intercept_hooks_walking = 0;
 
@@ -326,6 +329,20 @@ _e_hwc_ee_init(E_Hwc* hwc)
    return EINA_TRUE;
 }
 
+EINTERN Eina_Bool
+e_hwc_init(void)
+{
+   E_EVENT_HWC_ACTIVE = ecore_event_type_new();
+   E_EVENT_HWC_DEACTIVE = ecore_event_type_new();
+
+   return EINA_TRUE;
+}
+
+EINTERN void
+e_hwc_deinit(void)
+{
+}
+
 EINTERN E_Hwc *
 e_hwc_new(E_Output *output, Eina_Bool primary_output)
 {
@@ -403,6 +420,9 @@ e_hwc_new(E_Output *output, Eina_Bool primary_output)
           }
      }
 
+   /* default active hwc */
+   ecore_event_add(E_EVENT_HWC_ACTIVE, NULL, NULL, NULL);
+
    return hwc;
 
 fail:
@@ -448,11 +468,18 @@ e_hwc_deactive_set(E_Hwc *hwc, Eina_Bool set)
 {
    EINA_SAFETY_ON_NULL_RETURN(hwc);
 
+   if (hwc->hwc_deactive == set) return;
+
    if (e_hwc_policy_get(hwc) == E_HWC_POLICY_PLANES)
      e_hwc_planes_end(hwc, __FUNCTION__);
 
    hwc->hwc_deactive = set;
 
+   if (set)
+     ecore_event_add(E_EVENT_HWC_DEACTIVE, NULL, NULL, NULL);
+   else
+     ecore_event_add(E_EVENT_HWC_ACTIVE, NULL, NULL, NULL);
+
    EHINF("e_hwc_deactive_set : %d", hwc, set);
 }
 
index 905f73476cf86f01b41326ff446ced36bd4c9e28..2e4622ac309a6f958eb1420f2d774f60cae71e8b 100644 (file)
@@ -140,6 +140,12 @@ struct _E_Hwc
    int                  flapse;
 };
 
+E_API extern int E_EVENT_HWC_ACTIVE;
+E_API extern int E_EVENT_HWC_DEACTIVE;
+
+EINTERN Eina_Bool             e_hwc_init(void);
+EINTERN void                  e_hwc_deinit(void);
+
 EINTERN E_Hwc                *e_hwc_new(E_Output *output, Eina_Bool primary_output);
 EINTERN void                  e_hwc_del(E_Hwc *hwc);
 EINTERN E_Hwc_Mode            e_hwc_mode_get(E_Hwc *hwc);