From dd0665d822ad6d50839267e4a28a1237480ffeff Mon Sep 17 00:00:00 2001 From: Kirill Primak Date: Fri, 7 Oct 2022 17:43:13 +0300 Subject: [PATCH] output-damage: drop precommit listener --- include/wlr/types/wlr_output_damage.h | 1 - types/wlr_output_damage.c | 20 +------------------- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/include/wlr/types/wlr_output_damage.h b/include/wlr/types/wlr_output_damage.h index 51a5be8c..588bad6d 100644 --- a/include/wlr/types/wlr_output_damage.h +++ b/include/wlr/types/wlr_output_damage.h @@ -55,7 +55,6 @@ struct wlr_output_damage { struct wl_listener output_needs_frame; struct wl_listener output_damage; struct wl_listener output_frame; - struct wl_listener output_precommit; struct wl_listener output_commit; }; diff --git a/types/wlr_output_damage.c b/types/wlr_output_damage.c index c95d6e88..92c421ff 100644 --- a/types/wlr_output_damage.c +++ b/types/wlr_output_damage.c @@ -44,21 +44,6 @@ static void output_handle_frame(struct wl_listener *listener, void *data) { wl_signal_emit_mutable(&output_damage->events.frame, output_damage); } -static void output_handle_precommit(struct wl_listener *listener, void *data) { - struct wlr_output_damage *output_damage = - wl_container_of(listener, output_damage, output_precommit); - const struct wlr_output_event_precommit *event = data; - const struct wlr_output_state *state = event->state; - struct wlr_output *output = output_damage->output; - - if (state->committed & WLR_OUTPUT_STATE_BUFFER) { - // TODO: find a better way to access this info without a precommit - // handler - output_damage->pending_attach_render = - !output_is_direct_scanout(output, state->buffer); - } -} - static void output_handle_commit(struct wl_listener *listener, void *data) { struct wlr_output_damage *output_damage = wl_container_of(listener, output_damage, output_commit); @@ -66,7 +51,7 @@ static void output_handle_commit(struct wl_listener *listener, void *data) { if (event->committed & WLR_OUTPUT_STATE_BUFFER) { pixman_region32_t *prev; - if (output_damage->pending_attach_render) { + if (!output_is_direct_scanout(output_damage->output, event->buffer)) { // render-buffers have been swapped, rotate the damage // same as decrementing, but works on unsigned integers @@ -117,8 +102,6 @@ struct wlr_output_damage *wlr_output_damage_create(struct wlr_output *output) { output_damage->output_damage.notify = output_handle_damage; wl_signal_add(&output->events.frame, &output_damage->output_frame); output_damage->output_frame.notify = output_handle_frame; - wl_signal_add(&output->events.precommit, &output_damage->output_precommit); - output_damage->output_precommit.notify = output_handle_precommit; wl_signal_add(&output->events.commit, &output_damage->output_commit); output_damage->output_commit.notify = output_handle_commit; @@ -135,7 +118,6 @@ void wlr_output_damage_destroy(struct wlr_output_damage *output_damage) { wl_list_remove(&output_damage->output_needs_frame.link); wl_list_remove(&output_damage->output_damage.link); wl_list_remove(&output_damage->output_frame.link); - wl_list_remove(&output_damage->output_precommit.link); wl_list_remove(&output_damage->output_commit.link); pixman_region32_fini(&output_damage->current); for (size_t i = 0; i < WLR_OUTPUT_DAMAGE_PREVIOUS_LEN; ++i) {