e_config: add screen_rotation_client_ignore variable sandbox/boram1288/devel
authorBoram Park <boram1288.park@samsung.com>
Wed, 18 Oct 2017 06:37:44 +0000 (15:37 +0900)
committerBoram Park <boram1288.park@samsung.com>
Thu, 19 Oct 2017 04:17:05 +0000 (13:17 +0900)
for all clients to ignore output transform status

Change-Id: If293a8dc010b76668c1f1db1dbcbd1942bea72d7

src/bin/e_comp.c
src/bin/e_comp_screen.c
src/bin/e_comp_wl.c
src/bin/e_config.c
src/bin/e_config.h
src/bin/e_plane.c

index 7ee3d8bb1053235f33d20a959c8e055a3148a052..c4a86475b733ce7f386bb55e30c56470adc7c8d3 100644 (file)
@@ -276,7 +276,7 @@ _hwc_available_get(E_Client *ec)
 {
    E_Comp_Wl_Client_Data *cdata = (E_Comp_Wl_Client_Data*)ec->comp_data;
    E_Output *eout;
-   int transform = 0, minw = 0, minh = 0;
+   int minw = 0, minh = 0;
 
    if ((!cdata) ||
        (!cdata->buffer_ref.buffer) ||
@@ -307,9 +307,6 @@ _hwc_available_get(E_Client *ec)
    if (e_comp_wl_tbm_buffer_sync_timeline_used(cdata->buffer_ref.buffer))
      return EINA_FALSE;
 
-   /* if the buffer transform of surface is not same with output's transform, we
-    * can't show it to HW overlay directly.
-    */
    eout = e_output_find(ec->zone->output_id);
    EINA_SAFETY_ON_NULL_RETURN_VAL(eout, EINA_FALSE);
 
@@ -320,10 +317,6 @@ _hwc_available_get(E_Client *ec)
    if ((minh > 0) && (minh > cdata->buffer_ref.buffer->h))
      return EINA_FALSE;
 
-   transform = e_comp_wl_output_buffer_transform_get(ec);
-   if ((eout->config.rotation / 90) != transform)
-     return EINA_FALSE;
-
    return EINA_TRUE;
 }
 
index fbecc846c1ce99b1c76add3701122067fa413064..0c2b769e1fe8e99d876f174caa9b33e596f71777 100644 (file)
@@ -82,9 +82,14 @@ _tz_screen_rotation_get_ignore_output_transform(struct wl_client *client, struct
    tzsr->resource = resource;
    tzsr->ec = ec;
 
-   ELOGF("COMP", "|tzsr(%p)", NULL, ec, tzsr);
+   ELOGF("TRANSFORM", "|tzsr(%p) client_ignore(%d)", NULL, ec, tzsr, e_config->screen_rotation_client_ignore);
 
    tzsr_list = eina_list_append(tzsr_list, tzsr);
+
+   /* make all clients ignore the output tramsform
+    * we will decide later when hwc prepared.
+    */
+   e_comp_screen_rotation_ignore_output_transform_send(ec, EINA_TRUE);
 }
 
 static void
@@ -1241,7 +1246,24 @@ e_comp_screen_rotation_ignore_output_transform_send(E_Client *ec, Eina_Bool igno
 
    if (!tzsr) return;
 
-   ELOGF("COMP", "|tzsr(%p) ignore(%d)", NULL, ec, tzsr, ignore);
+   /* if client have to considers the output transform */
+   if (!ignore)
+     {
+        /* exception */
+        if (e_config->screen_rotation_client_ignore)
+          {
+             ELOGF("TRANSFORM", "|tzsr(%p) ignore_output_transform: client_ignore", NULL, ec, tzsr);
+             return;
+          }
+
+        if (e_policy_client_is_quickpanel(ec))
+           {
+              ELOGF("TRANSFORM", "|tzsr(%p) ignore_output_transform: quickpanel", NULL, ec, tzsr);
+              return;
+           }
+     }
+
+   ELOGF("TRANSFORM", "|tzsr(%p) ignore_output_transform(%d)", NULL, ec, tzsr, ignore);
 
    tizen_screen_rotation_send_ignore_output_transform(tzsr->resource, ec->comp_data->surface, ignore);
 }
index 6732f4867106070f18af66e678f5acf12c0d14a9..792401d6ad9bf6673f050aa1be15a2aea1b0ef1f 100644 (file)
@@ -4906,6 +4906,8 @@ e_comp_wl_surface_attach(E_Client *ec, E_Comp_Wl_Buffer *buffer)
    e_pixmap_resource_set(ec->pixmap, buffer);
    e_pixmap_dirty(ec->pixmap);
    e_pixmap_refresh(ec->pixmap);
+   
+   ELOGF("TRANSFORM", "@@@ buffer_transform(%d) animating(%d)", NULL, ec, e_comp_wl_output_buffer_transform_get(ec), e_comp_object_is_animating(ec->frame));
 
    e_comp_wl_map_size_cal_from_buffer(ec);
    _e_comp_wl_surface_state_size_update(ec, &ec->comp_data->pending);
index 2c2f409f550e03879f1d054e92d12f27f6a25a63..cd01038058c4d866e34b7e7d279651de0607f4d8 100644 (file)
@@ -257,6 +257,7 @@ _e_config_edd_init(Eina_Bool old)
 #endif
    E_CONFIG_VAL(D, T, screen_rotation_pre, UINT);
    E_CONFIG_VAL(D, T, screen_rotation_setting, UINT);
+   E_CONFIG_VAL(D, T, screen_rotation_client_ignore, UCHAR);
    E_CONFIG_VAL(D, T, eom_enable, UCHAR);
    E_CONFIG_VAL(D, T, use_cursor_timer, INT);
    E_CONFIG_VAL(D, T, cursor_timer_interval, INT);
@@ -484,6 +485,7 @@ e_config_load(void)
    E_CONFIG_LIMIT(e_config->keyboard.repeat_rate, -1, 1000); // 1 second
    E_CONFIG_LIMIT(e_config->screen_rotation_pre, 0, 270);
    E_CONFIG_LIMIT(e_config->screen_rotation_setting, 0, 270);
+   E_CONFIG_LIMIT(e_config->screen_rotation_client_ignore, 0, 1);
    E_CONFIG_LIMIT(e_config->eom_enable, 0, 1);
    E_CONFIG_LIMIT(e_config->use_cursor_timer, 0, 1);
    E_CONFIG_LIMIT(e_config->sleep_for_dri, 0, 1);
index 2fc6cc70d5dc8f4f29a2a2b25d22b0c557db9073..81f7e21b56a034aa4969c428a437362e3ec1bd3d 100644 (file)
@@ -149,6 +149,7 @@ struct _E_Config
 #endif
    unsigned int screen_rotation_pre; // screen-rotation value as default (0/90/180/270)
    unsigned int screen_rotation_setting; // screen-rotation value which is set in runtime (0/90/180/270)
+   Eina_Bool screen_rotation_client_ignore; // client ignores screen rotation (0/1)
    Eina_Bool eom_enable; // 0: eom disable, 1: eom enable
    int use_cursor_timer; // boolean value for enabling cursor timer (default : disable : 0)
    int cursor_timer_interval; // time value the cursor will be displayed in second (default : 5)
index 03948242fb56018fc4f2c9e9664d058bc7cd138f..9085b13b5da90566f83ac83cf575f7719b14eefc 100755 (executable)
@@ -2224,6 +2224,18 @@ e_plane_ec_prepare_set(E_Plane *plane, E_Client *ec)
           }
      }
 
+   /* if the buffer transform of surface is not same with output's transform, we
+    * can't show it to HW overlay directly.
+    */
+   int transform = e_comp_wl_output_buffer_transform_get(ec);
+   if ((plane->output->config.rotation / 90) != transform)
+     {
+        if (!e_config->screen_rotation_client_ignore)
+          e_comp_screen_rotation_ignore_output_transform_send(ec, EINA_FALSE);
+
+        return EINA_FALSE;
+     }
+
    plane->prepare_ec = ec;
 
    return EINA_TRUE;