e_hwc_planes: setup e_plane after ecore_evas of e_comp is allocated 96/271596/2 accepted/tizen/unified/20220223.222557 submit/tizen/20220223.083906
authorChangyeon Lee <cyeon.lee@samsung.com>
Wed, 23 Feb 2022 07:25:40 +0000 (16:25 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Wed, 23 Feb 2022 08:18:18 +0000 (17:18 +0900)
ecore_evas of e_comp is allocated after all e_output is created.
if e_plane_setup is called in e_output_hwc_setup, it is failed
because ecore_evas of e_comp is null.
this patch fixes failing of e_plane_setup.

Change-Id: I8b3e164cb3175770f1e924681634c0fa761d172f

src/bin/e_hwc.c
src/bin/e_hwc_planes.c
src/bin/e_hwc_planes.h
src/bin/e_output.c

index 12604df..4ab68a4 100644 (file)
@@ -460,11 +460,23 @@ e_hwc_ecore_evas_init(void)
         e_main_ts(buf);
      }
 
-   if (!e_hwc_windows_ecore_evas_set(hwc, ee))
+   if (hwc->hwc_policy == E_HWC_POLICY_WINDOWS)
      {
-        ERR("fail to e_hwc_windows_ecore_evas_set");
-        e_hwc_ecore_evas_deinit();
-        return EINA_FALSE;
+        if (!e_hwc_windows_ecore_evas_set(hwc, ee))
+          {
+             ERR("fail to e_hwc_windows_ecore_evas_set");
+             e_hwc_ecore_evas_deinit();
+             return EINA_FALSE;
+          }
+     }
+   else
+     {
+        if (!e_hwc_planes_ecore_evas_set(hwc, ee))
+          {
+             ERR("fail to e_hwc_planes_ecore_evas_set");
+             e_hwc_ecore_evas_deinit();
+             return EINA_FALSE;
+          }
      }
 
    return EINA_TRUE;
index ee01fa2..b004cbc 100644 (file)
@@ -918,3 +918,29 @@ e_hwc_planes_external_commit(E_Hwc *hwc)
    return EINA_TRUE;
 }
 
+EINTERN Eina_Bool
+e_hwc_planes_ecore_evas_set(E_Hwc *hwc, Ecore_Evas *ee)
+{
+   E_Output *output;
+   E_Plane *plane;
+   Eina_List *l, *ll;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(hwc, EINA_FALSE);
+
+   if (e_hwc_policy_get(hwc) == E_HWC_POLICY_WINDOWS)
+     return EINA_FALSE;
+
+   output = hwc->output;
+   EINA_SAFETY_ON_NULL_RETURN_VAL(output, EINA_FALSE);
+
+   EINA_LIST_FOREACH_SAFE(output->planes, l, ll, plane)
+     {
+        if (plane->is_fb)
+          {
+             if (!e_plane_setup(plane)) return EINA_FALSE;
+             else return EINA_TRUE;
+          }
+     }
+
+   return EINA_FALSE;
+}
index 7546908..52245a2 100644 (file)
@@ -19,5 +19,7 @@ EINTERN void                 e_hwc_planes_mirror_unset(E_Hwc *hwc);
 EINTERN Eina_Bool            e_hwc_planes_presentation_update(E_Hwc *hwc, E_Client *ec);
 EINTERN Eina_Bool            e_hwc_planes_external_commit(E_Hwc *hwc);
 
+EINTERN Eina_Bool            e_hwc_planes_ecore_evas_set(E_Hwc *hwc, Ecore_Evas *ee);
+
 #endif
 #endif
index fb0f5bf..8194aab 100644 (file)
@@ -2935,14 +2935,11 @@ EINTERN Eina_Bool
 e_output_hwc_setup(E_Output *output)
 {
    E_Hwc *hwc = NULL;
-   Eina_List *l, *ll;
-   E_Plane *plane = NULL;
    E_Output *primary_output = NULL;
    Eina_Bool is_primary_output = EINA_FALSE;
 
    EINA_SAFETY_ON_NULL_RETURN_VAL(output, EINA_FALSE);
 
-   /* available only the primary output now. */
    if (output->hwc)
      {
         EOINF("Already has the HWC.", output);
@@ -2956,40 +2953,7 @@ e_output_hwc_setup(E_Output *output)
    EINA_SAFETY_ON_NULL_RETURN_VAL(hwc, EINA_FALSE);
    output->hwc = hwc;
 
-   if (e_hwc_policy_get(output->hwc) == E_HWC_POLICY_PLANES)
-     {
-        if (primary_output == output)
-          {
-             /* ecore evas engine setup */
-             EINA_LIST_FOREACH_SAFE(output->planes, l, ll, plane)
-               {
-                  if (plane->is_fb)
-                    {
-                       if (!e_plane_setup(plane)) return EINA_FALSE;
-                       else return EINA_TRUE;
-                    }
-               }
-          }
-        else
-          {
-             return EINA_TRUE;
-          }
-     }
-   else
-     {
-#if 0
-       Evas_Object *canvas_bg = NULL;
-       unsigned int r, g, b, a;
-
-        /* set the color of the canvas_gb object */
-        r = 0; g = 0; b = 0; a = 1;
-        canvas_bg = e_comp->bg_blank_object;
-        evas_object_color_set(canvas_bg, r, g, b, a);
-#endif
-        return EINA_TRUE;
-     }
-
-   return EINA_FALSE;
+   return EINA_TRUE;
 }