e_comp_screen: add e_comp_screen_primary_output_get 74/133974/1
authorSooChan Lim <sc1.lim@samsung.com>
Thu, 1 Jun 2017 05:32:55 +0000 (14:32 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Wed, 14 Jun 2017 05:39:30 +0000 (14:39 +0900)
The primary output is the most highest priority of e_output.
The lower index of the tdm_output gets the higher priority of e_output.

Change-Id: I71e726f9ec71d991d5bb541c3c3b82d2c3468df0

src/bin/e_comp_screen.c
src/bin/e_comp_screen.h
src/bin/e_output.c

index 6b14b0248a737fad8f9bc6119d476c5f70b88010..af3e4c5917f2902038b0eaea8b5a9b540018784b 100644 (file)
@@ -1292,6 +1292,28 @@ e_comp_screen_rotation_ignore_output_transform_send(E_Client *ec, Eina_Bool igno
    tizen_screen_rotation_send_ignore_output_transform(tzsr->resource, ec->comp_data->surface, ignore);
 }
 
+EINTERN E_Output *
+e_comp_screen_primary_output_get(E_Comp_Screen *e_comp_screen)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_screen, NULL);
+
+   E_Output *output = NULL, *o = NULL;
+   Eina_List *l = NULL;
+   int highest_priority = 0;
+
+   /* find the highest priority of the e_output */
+   EINA_LIST_FOREACH(e_comp_screen->outputs, l, o)
+     {
+        if (highest_priority < o->config.priority)
+          {
+             highest_priority = o->config.priority;
+             output = o;
+          }
+     }
+
+   return output;
+}
+
 EINTERN void
 e_comp_screen_hwc_info_debug(void)
 {
index 4b0ab03abaf786a69271e891e8b7081a16b423c9..a1ad318b79d7fba32bd1adb4fa9917098e33893a 100644 (file)
@@ -48,6 +48,7 @@ EINTERN const Eina_List * e_comp_screen_e_screens_get(E_Comp_Screen *e_comp_scre
 E_API   Eina_Bool         e_comp_screen_rotation_setting_set(E_Comp_Screen *e_comp_screen, int rotation);
 
 EINTERN void              e_comp_screen_rotation_ignore_output_transform_send(E_Client *ec, Eina_Bool ignore);
+EINTERN E_Output        * e_comp_screen_primary_output_get(E_Comp_Screen *e_comp_screen);
 
 
 #endif /*E_COMP_SCREEN_H*/
index e27b9e21db9e1e17e479197547410667921b54ea..12cbec5f272ceb470f37978d2fb19f81fabaf0ce 100644 (file)
@@ -539,11 +539,16 @@ e_output_mode_apply(E_Output *output, E_Output_Mode *mode)
    output->config.mode.h = mode->h;
    output->config.mode.refresh = mode->refresh;
 
+   /* the index of the tdm_output is higher, the tdm_output is important.
+      the priority of the e_output is higher, the e_output is more important. */
+   output->config.priority = 100 - output->index;
+
    output->config.enabled = 1;
 
-   INF("E_OUTPUT: '%s' %i %i %ix%i", output->info.name,
+   INF("E_OUTPUT: '%s' %i %i %ix%i %i %i", output->info.name,
        output->config.geom.x, output->config.geom.y,
-       output->config.geom.w, output->config.geom.h);
+       output->config.geom.w, output->config.geom.h,
+       output->config.rotation, output->config.priority);
 
    INF("E_OUTPUT: rotation = %d", output->config.rotation);