e_hwc_windows: create pp_queue in case of zoom use sw copy 26/271326/1
authorChangyeon Lee <cyeon.lee@samsung.com>
Fri, 11 Feb 2022 07:01:50 +0000 (16:01 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Fri, 18 Feb 2022 02:16:05 +0000 (11:16 +0900)
sw copy was changed to use pp_queue

Change-Id: I53fa36047adef05ffa7d9875820afde38d838c75

src/bin/e_hwc_windows.c

index 52e94f27eb20ffad6c94a6930877a1057c6206d8..4f4043e1d6ffcebaa5644b61a9923530e95b1436 100644 (file)
@@ -816,7 +816,7 @@ _e_hwc_windows_target_buffer_fetch(E_Hwc *hwc)
 
    if (hwc_window->state == E_HWC_WINDOW_STATE_DEVICE)
      {
-        if ((hwc->pp_set) && (target_hwc_window->pp_queue))
+        if (target_hwc_window->pp_queue)
           queue_buffer = e_hwc_window_queue_buffer_acquire(target_hwc_window->pp_queue);
         else
           queue_buffer = root_hwc_window->current.queue_buffer_ref.buffer;
@@ -2858,8 +2858,8 @@ _e_hwc_windows_sw_copy(E_Hwc *hwc, tbm_surface_h src_tsurface, tbm_surface_h dst
    if (width == 0 || height == 0)
      return;
 
-   src_crop.w = tbm_surface_get_width(src_tsurface);
-   src_crop.h = tbm_surface_get_height(src_tsurface);
+   src_crop.w = hwc->pp_src_rect.w;
+   src_crop.h = hwc->pp_src_rect.h;
 
    if (display_mode == E_OUTPUT_DISPLAY_MODE_MIRROR)
      {
@@ -3078,7 +3078,7 @@ _e_hwc_windows_mirror_changes_update(E_Hwc *hwc)
    if (!src_target_hwc_window->hwc_window.current.buffer.tsurface) return EINA_FALSE;
    if (hwc->mirror_src_tsurface == src_target_tsurface) return EINA_FALSE;
 
-   queue = ((E_Hwc_Window *)target_hwc_window)->queue;
+   queue = hwc->pp_queue;
    EINA_SAFETY_ON_NULL_RETURN_VAL(queue, EINA_FALSE);
 
    if (hwc->pp_set)
@@ -3095,9 +3095,7 @@ _e_hwc_windows_mirror_changes_update(E_Hwc *hwc)
      }
    else
      {
-        queue = ((E_Hwc_Window *)target_hwc_window)->queue;
-        EINA_SAFETY_ON_NULL_RETURN_VAL(queue, EINA_FALSE);
-
+        if (!e_hwc_window_queue_buffer_can_dequeue(queue)) return EINA_FALSE;
         /* dequeue buffer */
         queue_buffer = e_hwc_window_queue_buffer_dequeue(queue);
         EINA_SAFETY_ON_NULL_RETURN_VAL(queue_buffer, EINA_FALSE);
@@ -3760,32 +3758,33 @@ e_hwc_windows_zoom_set(E_Hwc *hwc, Eina_Rectangle *rect)
              EHWSINF("PP Create tdm_pp:%p", NULL, hwc, hwc->tpp);
           }
 
-        if (!hwc->pp_tqueue)
-          {
-             _e_hwc_windows_zoom_pp_aligned_value_get(hwc, &w, &h);
-             //TODO: Does e20 get the buffer flags from the tdm backend?
-             hwc->pp_tqueue = tbm_surface_queue_create(3, w, h, TBM_FORMAT_ARGB8888, TBM_BO_SCANOUT);
-             if (!hwc->pp_tqueue)
-               {
-                  EHWSERR("fail tbm_surface_queue_create", hwc);
-                  goto fail;
-               }
+        hwc->pp_set = EINA_TRUE;
+     }
 
-             hwc->pp_queue = e_hwc_window_queue_get(hwc->pp_tqueue);
-             if (!hwc->pp_queue)
-               {
-                  EHWSERR("fail e_hwc_window_queue_get", hwc);
-                  goto fail;
-               }
+   if (!hwc->pp_tqueue)
+     {
+        if (e_comp_screen_pp_support())
+          _e_hwc_windows_zoom_pp_aligned_value_get(hwc, &w, &h);
 
-             EHWSINF("PP Create pp_tqueue:%p", NULL, hwc, hwc->pp_tqueue);
+        //TODO: Does e20 get the buffer flags from the tdm backend?
+        hwc->pp_tqueue = tbm_surface_queue_create(3, w, h, TBM_FORMAT_ARGB8888, TBM_BO_SCANOUT);
+        if (!hwc->pp_tqueue)
+          {
+             EHWSERR("fail tbm_surface_queue_create", hwc);
+             goto fail;
           }
-
-        _e_hwc_windows_target_window_pp_queue_set(hwc->target_hwc_window, hwc->pp_queue);
-        e_hwc_windows_target_window_force_render(hwc->target_hwc_window);
-        hwc->pp_set = EINA_TRUE;
+        hwc->pp_queue = e_hwc_window_queue_get(hwc->pp_tqueue);
+        if (!hwc->pp_queue)
+          {
+             EHWSERR("fail e_hwc_window_queue_get", hwc);
+             goto fail;
+          }
+        EHWSINF("PP Create pp_tqueue:%p", NULL, hwc, hwc->pp_tqueue);
      }
 
+   _e_hwc_windows_target_window_pp_queue_set(hwc->target_hwc_window, hwc->pp_queue);
+   e_hwc_windows_target_window_force_render(hwc->target_hwc_window);
+
    dst_rect.x = 0;
    dst_rect.y = 0;
    dst_rect.w = w;
@@ -3824,34 +3823,30 @@ e_hwc_windows_zoom_unset(E_Hwc *hwc)
    hwc->pp_dst_buffer_clear = EINA_FALSE;
    hwc->pp_hwc_window = NULL;
 
-   if (e_comp_screen_pp_support())
-     {
-        hwc->pp_set = EINA_FALSE;
+   hwc->pp_set = EINA_FALSE;
 
-        if (hwc->pp_tqueue)
-          {
-             EHWSINF("PP Destroy pp_tqueue:%p", NULL, hwc, hwc->pp_tqueue);
-
-             hwc->pp_queue = NULL;
-             tbm_surface_queue_destroy(hwc->pp_tqueue);
-             hwc->pp_tqueue = NULL;
-          }
+   if (hwc->pp_tqueue)
+     {
+        EHWSINF("PP Destroy pp_tqueue:%p", NULL, hwc, hwc->pp_tqueue);
+        hwc->pp_queue = NULL;
+        tbm_surface_queue_destroy(hwc->pp_tqueue);
+        hwc->pp_tqueue = NULL;
+     }
 
-        if (!hwc->pp_commit)
+   if (!hwc->pp_commit)
+     {
+        if (hwc->tpp)
           {
-             if (hwc->tpp)
-               {
-                  EHWSINF("PP Destroy tdm_pp:%p", NULL, hwc, hwc->tpp);
-                  tdm_pp_destroy(hwc->tpp);
-                  hwc->tpp = NULL;
-               }
-
-             e_hwc_window_buffer_set(&hwc->pp_buffer, NULL, NULL, 0);
+             EHWSINF("PP Destroy tdm_pp:%p", NULL, hwc, hwc->tpp);
+             tdm_pp_destroy(hwc->tpp);
+             hwc->tpp = NULL;
           }
 
-        _e_hwc_windows_target_window_pp_queue_set(hwc->target_hwc_window, NULL);
-        e_hwc_windows_target_window_force_render(hwc->target_hwc_window);
+        e_hwc_window_buffer_set(&hwc->pp_buffer, NULL, NULL, 0);
      }
+
+   _e_hwc_windows_target_window_pp_queue_set(hwc->target_hwc_window, NULL);
+   e_hwc_windows_target_window_force_render(hwc->target_hwc_window);
 }
 
 // add hwc_window to the render_list