e_comp_screen: execute fake output setup if there is no connected output. 44/171044/1
authorJunkyeong Kim <jk0430.kim@samsung.com>
Mon, 26 Feb 2018 07:15:58 +0000 (16:15 +0900)
committerJunkyeong Kim <jk0430.kim@samsung.com>
Mon, 26 Feb 2018 07:16:01 +0000 (16:16 +0900)
Change-Id: Ie6930f7067ff84f7f52def231ee64d80428977b8
Signed-off-by: Junkyeong Kim <jk0430.kim@samsung.com>
src/bin/e_comp_screen.c

index 83e918743ad014d2806a46d954f6563a39fdc038..e30f9e5e49b4b93737e68f32e06801b082330861 100644 (file)
@@ -502,6 +502,24 @@ _e_comp_screen_deinit_outputs(E_Comp_Screen *e_comp_screen)
    e_output_shutdown();
 }
 
+static Eina_Bool
+_e_comp_screen_fake_output_set(E_Comp_Screen *e_comp_screen)
+{
+   E_Output *output = NULL;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_screen, EINA_FALSE);
+
+   output = e_output_find_by_index(0);
+
+   if (!e_output_setup(output))
+     {
+        ERR("fail to e_output_setup.");
+        return EINA_FALSE;
+     }
+
+   return EINA_TRUE;
+}
+
 static Eina_Bool
 _e_comp_screen_init_outputs(E_Comp_Screen *e_comp_screen)
 {
@@ -511,6 +529,7 @@ _e_comp_screen_init_outputs(E_Comp_Screen *e_comp_screen)
    int num_outputs;
    int i;
    Eina_Bool scale_updated = EINA_FALSE;
+   Eina_Bool connection_check = EINA_FALSE;
 
    /* init e_output */
    if (!e_output_init())
@@ -545,6 +564,8 @@ _e_comp_screen_init_outputs(E_Comp_Screen *e_comp_screen)
 
         if (!e_output_connected(output)) continue;
 
+        connection_check = EINA_TRUE;
+
         /* setting with the best mode and enable the output */
         mode = e_output_best_mode_find(output);
         if (!mode)
@@ -586,6 +607,11 @@ _e_comp_screen_init_outputs(E_Comp_Screen *e_comp_screen)
 
    //TODO: if there is no output connected, make the fake output which is connected.
 
+   if (!connection_check)
+     {
+        if (!_e_comp_screen_fake_output_set(e_comp_screen))
+          goto fail;
+     }
 
    return EINA_TRUE;
 fail: