From 7702a197394bb191858e3a8dae9a0b4b5a1a262e Mon Sep 17 00:00:00 2001 From: Alexander Orzechowski Date: Wed, 29 Nov 2023 15:26:47 -0500 Subject: [PATCH] output: Drop back_buffer --- include/wlr/types/wlr_output.h | 1 - types/output/output.c | 17 ----------------- types/output/render.c | 15 --------------- 3 files changed, 33 deletions(-) diff --git a/include/wlr/types/wlr_output.h b/include/wlr/types/wlr_output.h index 72b14b70..a2e1fbae 100644 --- a/include/wlr/types/wlr_output.h +++ b/include/wlr/types/wlr_output.h @@ -200,7 +200,6 @@ struct wlr_output { struct wlr_allocator *allocator; struct wlr_renderer *renderer; struct wlr_swapchain *swapchain; - struct wlr_buffer *back_buffer; struct wl_listener display_destroy; diff --git a/types/output/output.c b/types/output/output.c index efad1976..cc8b5e49 100644 --- a/types/output/output.c +++ b/types/output/output.c @@ -440,7 +440,6 @@ void wlr_output_destroy(struct wlr_output *output) { } wlr_output_destroy_global(output); - output_clear_back_buffer(output); wl_list_remove(&output->display_destroy.link); @@ -761,12 +760,6 @@ bool wlr_output_test_state(struct wlr_output *output, bool wlr_output_test(struct wlr_output *output) { struct wlr_output_state state = output->pending; - if (output->back_buffer != NULL) { - assert((state.committed & WLR_OUTPUT_STATE_BUFFER) == 0); - state.committed |= WLR_OUTPUT_STATE_BUFFER; - state.buffer = output->back_buffer; - } - return wlr_output_test_state(output, &state); } @@ -840,22 +833,12 @@ bool wlr_output_commit(struct wlr_output *output) { struct wlr_output_state state = {0}; output_state_move(&state, &output->pending); - // output_clear_back_buffer detaches the buffer from the renderer. This is - // important to do before calling impl->commit(), because this marks an - // implicit rendering synchronization point. The backend needs it to avoid - // displaying a buffer when asynchronous GPU work isn't finished. - if (output->back_buffer != NULL) { - wlr_output_state_set_buffer(&state, output->back_buffer); - output_clear_back_buffer(output); - } - bool ok = wlr_output_commit_state(output, &state); wlr_output_state_finish(&state); return ok; } void wlr_output_rollback(struct wlr_output *output) { - output_clear_back_buffer(output); output_state_clear(&output->pending); } diff --git a/types/output/render.c b/types/output/render.c index b46a731d..13d57dc5 100644 --- a/types/output/render.c +++ b/types/output/render.c @@ -16,7 +16,6 @@ bool wlr_output_init_render(struct wlr_output *output, struct wlr_allocator *allocator, struct wlr_renderer *renderer) { assert(allocator != NULL && renderer != NULL); - assert(output->back_buffer == NULL); uint32_t backend_caps = backend_get_buffer_caps(output->backend); uint32_t renderer_caps = renderer_get_render_buffer_caps(renderer); @@ -43,20 +42,6 @@ bool wlr_output_init_render(struct wlr_output *output, return true; } -void output_clear_back_buffer(struct wlr_output *output) { - if (output->back_buffer == NULL) { - return; - } - - struct wlr_renderer *renderer = output->renderer; - assert(renderer != NULL); - - renderer_bind_buffer(renderer, NULL); - - wlr_buffer_unlock(output->back_buffer); - output->back_buffer = NULL; -} - static struct wlr_buffer *output_acquire_empty_buffer(struct wlr_output *output, const struct wlr_output_state *state) { assert(!(state->committed & WLR_OUTPUT_STATE_BUFFER));