e_hwc_windows: remove functions about presentation mode 17/271317/1
authorChangyeon Lee <cyeon.lee@samsung.com>
Tue, 8 Feb 2022 12:25:29 +0000 (21:25 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Fri, 18 Feb 2022 02:15:41 +0000 (11:15 +0900)
Change-Id: If7f468714b4c163475e33c53c676da2657b4f156

src/bin/e_hwc.h
src/bin/e_hwc_windows.c
src/bin/e_hwc_windows.h
src/bin/e_output.c

index d1d1956..563281b 100644 (file)
@@ -179,7 +179,6 @@ struct _E_Hwc
    E_Hwc               *mirror_src_hwc;
    tbm_surface_h        mirror_src_tsurface;
    Eina_List           *mirror_dst_hwc;
-   E_Hwc_Window        *presentation_hwc_window;
 
    int                  norender;
 
index a7f9e9c..44fd3ef 100644 (file)
@@ -2862,41 +2862,6 @@ _e_hwc_windows_sw_copy(E_Hwc *hwc, tbm_surface_h src_tsurface, tbm_surface_h dst
                               dst_pos.x, dst_pos.y, dst_pos.w, dst_pos.h);
 }
 
-static Eina_Bool
-_e_hwc_windows_presentation_evaluation_check(E_Hwc *hwc)
-{
-   E_Hwc_Window_Target *target_hwc_window;
-   tbm_surface_h target_tsurface, src_tsurface;
-   E_Hwc_Window_Queue *queue;
-   E_Hwc_Window_Queue_Buffer *queue_buffer = NULL;
-
-   /* copy the presentation_hwc_window to the target_window. */
-   target_hwc_window = hwc->target_hwc_window;
-   EINA_SAFETY_ON_NULL_RETURN_VAL(target_hwc_window, EINA_FALSE);
-
-   queue = ((E_Hwc_Window *)target_hwc_window)->queue;
-   EINA_SAFETY_ON_NULL_RETURN_VAL(queue, EINA_FALSE);
-
-   src_tsurface = hwc->presentation_hwc_window->current.buffer.tsurface;
-   if (!src_tsurface) return EINA_TRUE;
-
-   /* dequeue buffer */
-   queue_buffer = e_hwc_window_queue_buffer_dequeue(queue);
-   EINA_SAFETY_ON_NULL_RETURN_VAL(queue_buffer, EINA_FALSE);
-
-   /* copy */
-   target_tsurface = queue_buffer->tsurface;
-   _e_hwc_windows_sw_copy(hwc, src_tsurface, target_tsurface, E_OUTPUT_DISPLAY_MODE_PRESENTATION);
-
-   /* enqueue buffer */
-   e_hwc_window_queue_buffer_enqueue(queue, queue_buffer);
-
-   /* fetch the buffer */
-   _e_hwc_windows_target_buffer_fetch(hwc);
-
-   return EINA_TRUE;
-}
-
 /* evaluate the hwc_windows */
 static Eina_Bool
 _e_hwc_windows_evaluate(E_Hwc *hwc, E_Output_Display_Mode display_mode)
@@ -2958,9 +2923,6 @@ _e_hwc_windows_evaluate(E_Hwc *hwc, E_Output_Display_Mode display_mode)
         _e_hwc_windows_target_state_set(hwc->target_hwc_window, E_HWC_WINDOW_STATE_NONE);
      }
 
-   if ((!hwc->primary_output) && (display_mode == E_OUTPUT_DISPLAY_MODE_PRESENTATION))
-     _e_hwc_windows_presentation_evaluation_check(hwc);
-
    /* skip the target_buffer when the window is on trainsition of the composition */
    if ((hwc_mode != E_HWC_MODE_FULL) && (_e_hwc_windows_transition_check(hwc)) && (!hwc->pp_set))
      {
@@ -3138,60 +3100,6 @@ _e_hwc_windows_mirror_changes_update(E_Hwc *hwc)
    return EINA_TRUE;
 }
 
-static Eina_Bool
-_e_hwc_windows_presentation_changes_update(E_Hwc *hwc)
-{
-   Eina_Rectangle src_rect = {0, };
-   Eina_Rectangle dst_rect = {0, };
-   tbm_surface_h tsurface;
-
-   EINA_SAFETY_ON_NULL_RETURN_VAL(hwc->presentation_hwc_window, EINA_FALSE);
-
-   /* set buffer */
-   if (!e_hwc_window_buffer_fetch(hwc->presentation_hwc_window))
-     return EINA_FALSE;
-
-   e_hwc_window_zpos_set(hwc->presentation_hwc_window, 0);
-   e_hwc_window_state_set(hwc->presentation_hwc_window, E_HWC_WINDOW_STATE_DEVICE, EINA_TRUE);
-   e_hwc_window_info_update(hwc->presentation_hwc_window);
-
-   if (hwc->pp_set)
-     {
-        tsurface = hwc->presentation_hwc_window->current.buffer.tsurface;
-
-        src_rect.x = 0;
-        src_rect.y = 0;
-        src_rect.w = tbm_surface_get_width(tsurface);
-        src_rect.h = tbm_surface_get_height(tsurface);
-        dst_rect.x = 0;
-        dst_rect.y = 0;
-        dst_rect.w = hwc->pp_queue->width;
-        dst_rect.h = hwc->pp_queue->height;
-        _e_hwc_windows_pp_rect_set(hwc, &src_rect, &dst_rect);
-     }
-
-   return EINA_TRUE;
-}
-
-static Eina_Bool
-_e_hwc_windows_external_changes_update(E_Hwc *hwc, E_Output_Display_Mode display_mode)
-{
-   Eina_Bool update_changes = EINA_FALSE;
-
-   if (display_mode == E_OUTPUT_DISPLAY_MODE_MIRROR)
-     {
-        if (_e_hwc_windows_mirror_changes_update(hwc))
-          update_changes = EINA_TRUE;
-     }
-   else if (display_mode == E_OUTPUT_DISPLAY_MODE_PRESENTATION)
-     {
-        if (_e_hwc_windows_presentation_changes_update(hwc))
-          update_changes = EINA_TRUE;
-     }
-
-   return update_changes;
-}
-
 EINTERN Eina_Bool
 e_hwc_windows_init(void)
 {
@@ -3538,14 +3446,14 @@ e_hwc_windows_commit(E_Hwc *hwc, E_Output_Display_Mode display_mode)
         return EINA_TRUE;
      }
 
-   if (hwc->primary_output)
+   if (display_mode == E_OUTPUT_DISPLAY_MODE_MIRROR)
      {
-        if (!_e_hwc_windows_changes_update(hwc))
+        if (!_e_hwc_windows_mirror_changes_update(hwc))
           goto update_done;
      }
    else
      {
-        if (!_e_hwc_windows_external_changes_update(hwc, display_mode))
+        if (!_e_hwc_windows_changes_update(hwc))
           goto update_done;
      }
 
@@ -4372,70 +4280,6 @@ e_hwc_windows_mirror_unset(E_Hwc *hwc)
 }
 
 EINTERN Eina_Bool
-e_hwc_windows_presentation_update(E_Hwc *hwc, E_Client *ec)
-{
-   E_Comp_Wl_Buffer *wl_buffer = NULL;
-   tbm_surface_h tsurface = NULL;
-   Eina_Rectangle rect = {0, };
-   int width = 0;
-   int height = 0;
-
-   EINA_SAFETY_ON_NULL_RETURN_VAL(hwc, EINA_FALSE);
-
-   if (ec)
-     {
-        if (!hwc->presentation_hwc_window)
-          {
-             hwc->presentation_hwc_window = e_hwc_window_get(hwc, ec);
-             EINA_SAFETY_ON_NULL_RETURN_VAL(hwc->presentation_hwc_window, EINA_FALSE);
-
-             e_hwc_window_ref(hwc->presentation_hwc_window);
-             e_hwc_window_state_set(hwc->presentation_hwc_window, E_HWC_WINDOW_STATE_DEVICE, EINA_TRUE);
-             e_hwc_window_external_set(hwc->presentation_hwc_window, EINA_TRUE);
-
-             // TODO: deal with the video
-
-             e_output_size_get(hwc->output, &width, &height);
-
-             rect.x = 0;
-             rect.y = 0;
-             rect.w = width;
-             rect.h = height;
-
-             if (!e_hwc_windows_zoom_set(hwc, &rect))
-               {
-                  EHWSERR("e_hwc_windows_zoom_set failed.", hwc);
-                  return EINA_FALSE;
-               }
-             hwc->pp_dst_buffer_clear = EINA_TRUE;
-             hwc->pp_hwc_window = hwc->presentation_hwc_window;
-          }
-
-        /* update the target_buffer */
-        wl_buffer = e_pixmap_resource_get(ec->pixmap);
-        EINA_SAFETY_ON_NULL_RETURN_VAL(wl_buffer, EINA_FALSE);
-        EINA_SAFETY_ON_NULL_RETURN_VAL(wl_buffer->resource, EINA_FALSE);
-
-        tsurface = wayland_tbm_server_get_surface(e_comp->wl_comp_data->tbm.server, wl_buffer->resource);
-        EINA_SAFETY_ON_NULL_RETURN_VAL(tsurface, EINA_FALSE);
-     }
-   else
-     {
-        if (hwc->presentation_hwc_window)
-          {
-             e_hwc_window_external_set(hwc->presentation_hwc_window, EINA_FALSE);
-             e_hwc_windows_zoom_unset(hwc);
-             hwc->pp_hwc_window = NULL;
-             hwc->pp_dst_buffer_clear = EINA_FALSE;
-             e_hwc_window_unref(hwc->presentation_hwc_window);
-             hwc->presentation_hwc_window = NULL;
-          }
-     }
-
-   return EINA_TRUE;
-}
-
-EINTERN Eina_Bool
 e_hwc_windows_present_sync(E_Hwc *hwc)
 {
    E_Hwc_Window_Target *target_hwc_window;
index e46bc73..d76315d 100644 (file)
@@ -54,7 +54,6 @@ E_API   void                 e_hwc_windows_debug_dump_stop(void);
 
 EINTERN Eina_Bool            e_hwc_windows_mirror_set(E_Hwc *hwc, E_Hwc *src_hwc, Eina_Rectangle *rect);
 EINTERN void                 e_hwc_windows_mirror_unset(E_Hwc *hwc);
-EINTERN Eina_Bool            e_hwc_windows_presentation_update(E_Hwc *hwc, E_Client *ec);
 
 EINTERN Eina_Bool            e_hwc_windows_present_sync(E_Hwc *hwc);
 
index 363db5e..17ef3b7 100644 (file)
@@ -4196,14 +4196,6 @@ e_output_presentation_update(E_Output *output, E_Client *ec)
              return EINA_FALSE;
           }
      }
-   else
-     {
-        if (!e_hwc_windows_presentation_update(hwc, ec))
-          {
-             EOERR("e_hwc_windows_presentation_update fails.", output);
-             return EINA_FALSE;
-          }
-     }
 
    _e_output_display_mode_set(output, E_OUTPUT_DISPLAY_MODE_PRESENTATION);
 
@@ -4231,8 +4223,6 @@ e_output_presentation_unset(E_Output *output)
 
    if (e_hwc_policy_get(hwc) == E_HWC_POLICY_PLANES)
      e_hwc_planes_presentation_update(hwc, NULL);
-   else
-     e_hwc_windows_presentation_update(hwc, NULL);
 }
 
 EINTERN Eina_Bool