From d99ee40a1d64576fc55118a898e60c23f401ca9d Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 8 Jan 2024 18:44:34 +0100 Subject: [PATCH] output: drop wlr_output.needs_frame The frame scheduler is responsible for de-duplicating needs_frame events. --- include/wlr/types/wlr_output.h | 2 -- types/output/output.c | 8 -------- types/scene/wlr_scene.c | 2 +- 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/include/wlr/types/wlr_output.h b/include/wlr/types/wlr_output.h index 06dba854d..ece2b5b10 100644 --- a/include/wlr/types/wlr_output.h +++ b/include/wlr/types/wlr_output.h @@ -219,8 +219,6 @@ struct wlr_output { // true, changes may either succeed or fail. bool adaptive_sync_supported; - bool needs_frame; - // true for example with VR headsets bool non_desktop; diff --git a/types/output/output.c b/types/output/output.c index ff2f6130c..bf1d73ac8 100644 --- a/types/output/output.c +++ b/types/output/output.c @@ -774,10 +774,6 @@ bool output_prepare_commit(struct wlr_output *output, const struct wlr_output_st void output_apply_commit(struct wlr_output *output, const struct wlr_output_state *state) { output->commit_seq++; - if (output_pending_enabled(output, state)) { - output->needs_frame = false; - } - output_apply_state(output, state); } @@ -945,10 +941,6 @@ size_t wlr_output_get_gamma_size(struct wlr_output *output) { } void wlr_output_update_needs_frame(struct wlr_output *output) { - if (output->needs_frame) { - return; - } - output->needs_frame = true; wl_signal_emit_mutable(&output->events.needs_frame, output); } diff --git a/types/scene/wlr_scene.c b/types/scene/wlr_scene.c index 10bf8d015..f77ab37fe 100644 --- a/types/scene/wlr_scene.c +++ b/types/scene/wlr_scene.c @@ -2144,7 +2144,7 @@ static enum scene_direct_scanout_result scene_entry_try_direct_scanout( } bool wlr_scene_output_needs_frame(struct wlr_scene_output *scene_output) { - return scene_output->output->needs_frame || + return scene_output->frame_scheduler->needs_frame || !pixman_region32_empty(&scene_output->pending_commit_damage) || scene_output->gamma_lut_changed; }