From 520821e432476ff440b44e90fe9bfe21ec0847b9 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Thu, 18 Jan 2018 17:21:27 -0600 Subject: [PATCH] wayland: Reduce number of unneccessary display flushes b48781aa6c85c72f620c57cebff96580ddd67899 fixed multiple bugs where the display wasn't flushed correctly, however it was a little overzealous. Some of the flushes were added after calls that only updated internal state, some in internal functions in which the caller was already going to flush, and some were after wayland protocol calls that are double buffered anyway and won't do anything until a following commit. Also, I've removes at least one long standing flush where the recently added flush is in a better location than the original. --- src/lib/ecore_wl2/ecore_wl2_buffer.c | 1 - src/lib/ecore_wl2/ecore_wl2_input.c | 1 - src/lib/ecore_wl2/ecore_wl2_output.c | 1 - src/lib/ecore_wl2/ecore_wl2_subsurf.c | 5 ----- src/lib/ecore_wl2/ecore_wl2_window.c | 11 +---------- 5 files changed, 1 insertion(+), 18 deletions(-) diff --git a/src/lib/ecore_wl2/ecore_wl2_buffer.c b/src/lib/ecore_wl2/ecore_wl2_buffer.c index bf2fe5f8ec..4fa905e5ff 100644 --- a/src/lib/ecore_wl2/ecore_wl2_buffer.c +++ b/src/lib/ecore_wl2/ecore_wl2_buffer.c @@ -749,7 +749,6 @@ _ecore_wl2_buffer_test(Ecore_Wl2_Display *ewd) zwp_linux_buffer_params_v1_add_listener(dp, ¶ms_listener, ewd); zwp_linux_buffer_params_v1_create(dp, buf->w, buf->h, DRM_FORMAT_ARGB8888, 0); - ecore_wl2_display_flush(ewd); ecore_wl2_buffer_destroy(buf); diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c b/src/lib/ecore_wl2/ecore_wl2_input.c index aa87fde651..fd1e0f4a9b 100644 --- a/src/lib/ecore_wl2/ecore_wl2_input.c +++ b/src/lib/ecore_wl2/ecore_wl2_input.c @@ -1652,7 +1652,6 @@ _ecore_wl2_input_add(Ecore_Wl2_Display *display, unsigned int id, unsigned int v wl_data_device_manager_get_data_device(display->wl.data_device_manager, input->wl.seat); wl_data_device_add_listener(input->data.device, &_data_listener, input); - ecore_wl2_display_flush(input->display); } void diff --git a/src/lib/ecore_wl2/ecore_wl2_output.c b/src/lib/ecore_wl2/ecore_wl2_output.c index c58667131e..ba1d7cea8f 100644 --- a/src/lib/ecore_wl2/ecore_wl2_output.c +++ b/src/lib/ecore_wl2/ecore_wl2_output.c @@ -96,7 +96,6 @@ _ecore_wl2_output_add(Ecore_Wl2_Display *display, unsigned int id) eina_inlist_append(display->outputs, EINA_INLIST_GET(output)); wl_output_add_listener(output->wl_output, &_output_listener, output); - ecore_wl2_display_flush(display); } void diff --git a/src/lib/ecore_wl2/ecore_wl2_subsurf.c b/src/lib/ecore_wl2/ecore_wl2_subsurf.c index c5ecf99e19..980c2eed47 100644 --- a/src/lib/ecore_wl2/ecore_wl2_subsurf.c +++ b/src/lib/ecore_wl2/ecore_wl2_subsurf.c @@ -106,7 +106,6 @@ ecore_wl2_subsurface_position_set(Ecore_Wl2_Subsurface *subsurface, int x, int y subsurface->y = y; wl_subsurface_set_position(subsurface->wl.subsurface, x, y); - ecore_wl2_display_flush(subsurface->parent->display); } EAPI void @@ -125,7 +124,6 @@ ecore_wl2_subsurface_place_above(Ecore_Wl2_Subsurface *subsurface, struct wl_sur EINA_SAFETY_ON_NULL_RETURN(surface); wl_subsurface_place_above(subsurface->wl.subsurface, surface); - ecore_wl2_display_flush(subsurface->parent->display); } EAPI void @@ -135,7 +133,6 @@ ecore_wl2_subsurface_place_below(Ecore_Wl2_Subsurface *subsurface, struct wl_sur EINA_SAFETY_ON_NULL_RETURN(surface); wl_subsurface_place_below(subsurface->wl.subsurface, surface); - ecore_wl2_display_flush(subsurface->parent->display); } EAPI void @@ -153,7 +150,6 @@ ecore_wl2_subsurface_sync_set(Ecore_Wl2_Subsurface *subsurface, Eina_Bool sync) wl_subsurface_set_sync(subsurface->wl.subsurface); else wl_subsurface_set_desync(subsurface->wl.subsurface); - ecore_wl2_display_flush(subsurface->parent->display); } EAPI void @@ -186,5 +182,4 @@ ecore_wl2_subsurface_opaque_region_set(Ecore_Wl2_Subsurface *subsurface, int x, } else wl_surface_set_opaque_region(subsurface->wl.surface, NULL); - ecore_wl2_display_flush(subsurface->parent->display); } diff --git a/src/lib/ecore_wl2/ecore_wl2_window.c b/src/lib/ecore_wl2/ecore_wl2_window.c index 71d3478e2b..d84a302a3f 100644 --- a/src/lib/ecore_wl2/ecore_wl2_window.c +++ b/src/lib/ecore_wl2/ecore_wl2_window.c @@ -414,7 +414,6 @@ _ecore_wl2_window_shell_surface_init(Ecore_Wl2_Window *window) } else zwp_e_session_recovery_get_uuid(window->display->wl.session_recovery, window->surface); - ecore_wl2_display_flush(window->display); } } @@ -708,7 +707,6 @@ ecore_wl2_window_raise(Ecore_Wl2_Window *window) window->set_config.geometry.w, window->set_config.geometry.h, &states); wl_array_release(&states); - ecore_wl2_display_flush(window->display); } } @@ -735,7 +733,6 @@ ecore_wl2_window_alpha_set(Ecore_Wl2_Window *window, Eina_Bool alpha) window->opaque.h); else ecore_wl2_window_opaque_region_set(window, 0, 0, 0, 0); - ecore_wl2_display_flush(window->display); } EAPI void @@ -753,7 +750,6 @@ ecore_wl2_window_transparent_set(Ecore_Wl2_Window *window, Eina_Bool transparent window->opaque.h); else ecore_wl2_window_opaque_region_set(window, 0, 0, 0, 0); - ecore_wl2_display_flush(window->display); } EAPI void @@ -1048,6 +1044,7 @@ ecore_wl2_window_iconified_set(Ecore_Wl2_Window *window, Eina_Bool iconified) xdg_toplevel_set_minimized(window->xdg_toplevel); if (window->zxdg_toplevel) zxdg_toplevel_v6_set_minimized(window->zxdg_toplevel); + ecore_wl2_display_flush(window->display); } else { @@ -1078,7 +1075,6 @@ ecore_wl2_window_iconified_set(Ecore_Wl2_Window *window, Eina_Bool iconified) wl_array_release(&states); } } - ecore_wl2_display_flush(window->display); } EAPI void @@ -1169,7 +1165,6 @@ ecore_wl2_window_buffer_transform_set(Ecore_Wl2_Window *window, int transform) EINA_SAFETY_ON_NULL_RETURN(window); wl_surface_set_buffer_transform(window->surface, transform); - ecore_wl2_display_flush(window->display); } EAPI void @@ -1492,7 +1487,6 @@ _maximized_set(Ecore_Wl2_Window *window) if (window->zxdg_toplevel) zxdg_toplevel_v6_unset_maximized(window->zxdg_toplevel); } - ecore_wl2_display_flush(window->display); } static void @@ -1515,7 +1509,6 @@ _fullscreen_set(Ecore_Wl2_Window *window) if (window->zxdg_toplevel) zxdg_toplevel_v6_unset_fullscreen(window->zxdg_toplevel); } - ecore_wl2_display_flush(window->display); } static void @@ -1542,7 +1535,6 @@ _input_set(Ecore_Wl2_Window *window) window->input_rect.w, window->input_rect.h); wl_surface_set_input_region(window->surface, region); wl_region_destroy(region); - ecore_wl2_display_flush(window->display); } static void @@ -1567,7 +1559,6 @@ _opaque_set(Ecore_Wl2_Window *window) window->opaque.w, window->opaque.h); wl_surface_set_opaque_region(window->surface, region); wl_region_destroy(region); - ecore_wl2_display_flush(window->display); } EAPI void