From 25a0c122345872ece6b4bc8757ac61a712bd2871 Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Thu, 1 Jun 2017 14:32:55 +0900 Subject: [PATCH] e_comp_screen: add e_comp_screen_primary_output_get 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 | 22 ++++++++++++++++++++++ src/bin/e_comp_screen.h | 1 + src/bin/e_output.c | 9 +++++++-- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/src/bin/e_comp_screen.c b/src/bin/e_comp_screen.c index 6b14b0248a..af3e4c5917 100644 --- a/src/bin/e_comp_screen.c +++ b/src/bin/e_comp_screen.c @@ -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) { diff --git a/src/bin/e_comp_screen.h b/src/bin/e_comp_screen.h index 4b0ab03aba..a1ad318b79 100644 --- a/src/bin/e_comp_screen.h +++ b/src/bin/e_comp_screen.h @@ -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*/ diff --git a/src/bin/e_output.c b/src/bin/e_output.c index e27b9e21db..12cbec5f27 100644 --- a/src/bin/e_output.c +++ b/src/bin/e_output.c @@ -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); -- 2.34.1