e_hwc_window: set client type if e_pixmap resource is null 84/230684/1
authorChangyeon Lee <cyeon.lee@samsung.com>
Tue, 7 Apr 2020 10:44:56 +0000 (19:44 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Mon, 13 Apr 2020 10:49:41 +0000 (19:49 +0900)
in rotation module, e_pixmap resource is set by null for skip frame.
it cause deadlock if client is set HWC and reserved memory is double buffer

Change-Id: Idad3071825df7fa0d6df353e70325fd382b24520

src/bin/e_hwc_window.c

index 5aba4a5ca40de0f27ecc9a700031729add0ea235..afa19be089f8028cc67b5b2bdacaac55ec0f6f19 100644 (file)
@@ -88,6 +88,7 @@ typedef enum _E_Hwc_Window_Restriction
    E_HWC_WINDOW_RESTRICTION_UI_SUBSURFACE,
    E_HWC_WINDOW_RESTRICTION_CONTENT_IMAGE,
    E_HWC_WINDOW_RESTRICTION_QUICKPANEL_OPEN,
+   E_HWC_WINDOW_RESTRICTION_PIXMAP_RESOURCE,
 } E_Hwc_Window_Restriction;
 
 static Eina_Bool ehw_trace = EINA_FALSE;
@@ -1719,6 +1720,7 @@ e_hwc_window_device_state_available_update(E_Hwc_Window *hwc_window)
 {
    E_Client *ec = NULL;
    E_Comp_Wl_Client_Data *cdata = NULL;
+   E_Pixmap *pixmap = NULL;
    E_Output *eout = NULL;
    int minw = 0, minh = 0;
    int transform;
@@ -1759,6 +1761,14 @@ e_hwc_window_device_state_available_update(E_Hwc_Window *hwc_window)
         goto finish;
      }
 
+   pixmap = ec->pixmap;
+   if ((!pixmap) || (!e_pixmap_resource_get(pixmap)))
+     {
+        restriction = E_HWC_WINDOW_RESTRICTION_PIXMAP_RESOURCE;
+        available = EINA_FALSE;
+        goto finish;
+     }
+
    if ((cdata->width_from_buffer != cdata->width_from_viewport) ||
        (cdata->height_from_buffer != cdata->height_from_viewport))
      {
@@ -2212,6 +2222,8 @@ e_hwc_window_restriction_string_get(E_Hwc_Window *hwc_window)
        return "content image";
      case E_HWC_WINDOW_RESTRICTION_QUICKPANEL_OPEN:
        return "quickpanel open";
+     case E_HWC_WINDOW_RESTRICTION_PIXMAP_RESOURCE:
+       return "pixmap resource";
      default:
        return "UNKNOWN";
     }