e_hwc_window: set device state available to true in case transform of client is rectangle 40/268240/2 accepted/tizen/6.5/unified/20211220.133337 submit/tizen_6.5/20211220.023237
authorChangyeon Lee <cyeon.lee@samsung.com>
Wed, 15 Dec 2021 08:55:51 +0000 (17:55 +0900)
committerchangyeon lee <cyeon.lee@samsung.com>
Fri, 17 Dec 2021 08:13:32 +0000 (08:13 +0000)
hw plane can support rectangle transform.
tdm backend should decide whether rectangle transform window can be
display by hw plane.

Change-Id: I05be6daba65f811977f617441d656e0a6c0b5b36

src/bin/e_hwc_window.c

index bcb97286f42eb13c65a95032cf7f56cf5636bd0c..4a4014eb2559c97b1d1ffe5fbf55f6b526d2b429 100644 (file)
@@ -2021,6 +2021,39 @@ e_hwc_window_device_state_available_get(E_Hwc_Window *hwc_window)
    return hwc_window->device_state_available;
 }
 
+static Eina_Bool
+_e_hwc_window_client_transform_device_state_available_get(E_Client *ec)
+{
+   E_Map *map;
+   int x[4], y[4], z[4];
+   int i;
+
+   if (!e_client_transform_core_enable_get(ec))
+     return EINA_TRUE;
+
+   map = e_client_map_get(ec);
+   if (!map) return EINA_TRUE;
+
+   for (i = 0; i < 4; i++)
+     {
+        if (!e_map_point_coord_get(map, i, &x[i], &y[i], &z[i]))
+          return EINA_FALSE;
+     }
+
+   /* check 2D */
+   if ((z[0] != z[1]) || (z[0] != z[2]) || (z[0] != z[3]))
+     return EINA_FALSE;
+
+   /* check rectangle */
+   if ((x[0] != x[3]) || (x[1] != x[2]))
+     return EINA_FALSE;
+
+   if ((y[0] != y[1]) || (y[2] != y[3]))
+     return EINA_FALSE;
+
+   return EINA_TRUE;
+}
+
 // if ec has invalid buffer or scaled( transformed ) or forced composite(never_hwc)
 EINTERN Eina_Bool
 e_hwc_window_device_state_available_update(E_Hwc_Window *hwc_window)
@@ -2034,7 +2067,6 @@ e_hwc_window_device_state_available_update(E_Hwc_Window *hwc_window)
    Eina_Bool available = EINA_TRUE;
    E_Hwc_Window_Restriction restriction = E_HWC_WINDOW_RESTRICTION_NONE;
    E_Desk *desk;
-   int count;
 
    EINA_SAFETY_ON_NULL_RETURN_VAL(hwc_window, EINA_FALSE);
 
@@ -2106,16 +2138,11 @@ e_hwc_window_device_state_available_update(E_Hwc_Window *hwc_window)
         goto finish;
      }
 
-   if (e_client_transform_core_enable_get(ec))
+   if (!_e_hwc_window_client_transform_device_state_available_get(ec))
      {
-        /* allow device if ec has only transform of base_output_resolution */
-        count = e_client_transform_core_transform_count_get(ec);
-        if ((!ec->base_output_resolution.transform) || (count > 1))
-          {
-             restriction = E_HWC_WINDOW_RESTRICTION_TRANSFORM;
-             available = EINA_FALSE;
-             goto finish;
-          }
+        restriction = E_HWC_WINDOW_RESTRICTION_TRANSFORM;
+        available = EINA_FALSE;
+        goto finish;
      }
 
    switch (cdata->buffer_ref.buffer->type)