e_comp_screen: add e_comp_screen_pp_support 77/133977/1
authorSooChan Lim <sc1.lim@samsung.com>
Fri, 9 Jun 2017 07:15:21 +0000 (16:15 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Wed, 14 Jun 2017 05:41:17 +0000 (14:41 +0900)
Change-Id: I86006deec8c6f1d9cacdb4150fca5b7fe96bc467

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

index 0641fe8c2a74b8a5edab64dc313132b14e79dac8..e57a3f585344c26713429c310d46caf069ea958d 100644 (file)
@@ -309,6 +309,7 @@ _e_comp_screen_new(E_Comp *comp)
 {
    E_Comp_Screen *e_comp_screen = NULL;
    tdm_error error = TDM_ERROR_NONE;
+   tdm_display_capability capabilities;
 
    e_comp_screen = E_NEW(E_Comp_Screen, 1);
    if (!e_comp_screen) return NULL;
@@ -322,6 +323,19 @@ _e_comp_screen_new(E_Comp *comp)
         return NULL;
      }
 
+   error = tdm_display_get_capabilities(e_comp_screen->tdisplay, &capabilities);
+   if (error != TDM_ERROR_NONE)
+     {
+        ERR("tdm get_capabilities failed");
+        tdm_display_deinit(e_comp_screen->tdisplay);
+        free(e_comp_screen);
+        return NULL;
+     }
+
+   /* check the pp_support */
+   if (capabilities & TDM_DISPLAY_CAPABILITY_PP)
+     e_comp_screen->pp_enabled = EINA_TRUE;
+
    if (e_comp_socket_init("tdm-socket"))
      PRCTL("[Winsys] change permission and create sym link for %s", "tdm-socket");
 
@@ -1110,6 +1124,19 @@ e_comp_screen_primary_output_get(E_Comp_Screen *e_comp_screen)
    return output;
 }
 
+EINTERN Eina_Bool
+e_comp_screen_pp_support(void)
+{
+   E_Comp_Screen *e_comp_screen = NULL;
+   EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp, EINA_FALSE);
+
+   e_comp_screen = e_comp->e_comp_screen;
+   EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_screen, EINA_FALSE);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_screen->tdisplay, EINA_FALSE);
+
+   return e_comp_screen->pp_enabled;
+}
+
 EINTERN void
 e_comp_screen_hwc_info_debug(void)
 {
index 12839118d9bce50e1d5a758e7c63477a8b905350..3d405abf1334ffddc6c49eea49d0ee3b02a563a5 100644 (file)
@@ -26,6 +26,9 @@ struct _E_Comp_Screen
 
    /* for screen_rotation */
    int rotation;
+
+   /* pp support */
+   Eina_Bool pp_enabled;
 };
 
 
@@ -50,6 +53,7 @@ E_API   Eina_Bool         e_comp_screen_rotation_setting_set(E_Comp_Screen *e_co
 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);
 
+EINTERN Eina_Bool         e_comp_screen_pp_support(void);
 
 #endif /*E_COMP_SCREEN_H*/