output: remove old frame scheduling

This commit is contained in:
Rose Hudson 2023-07-28 11:57:46 +01:00
parent ef710e3fd4
commit e43baf4697
8 changed files with 0 additions and 113 deletions

View file

@ -319,11 +319,6 @@ static void output_apply_state(struct wlr_output *output,
output->cursor_swapchain = NULL;
}
if (state->committed & WLR_OUTPUT_STATE_BUFFER) {
output->frame_pending = true;
output->needs_frame = false;
}
if (state->committed & WLR_OUTPUT_STATE_LAYERS) {
for (size_t i = 0; i < state->layers_len; i++) {
struct wlr_output_layer_state *layer_state = &state->layers[i];
@ -422,7 +417,6 @@ void wlr_output_init(struct wlr_output *output, struct wlr_backend *backend,
wl_list_init(&output->cursors);
wl_list_init(&output->layers);
wl_list_init(&output->resources);
wl_signal_init(&output->events.frame);
wl_signal_init(&output->events.damage);
wl_signal_init(&output->events.needs_frame);
wl_signal_init(&output->events.precommit);
@ -478,10 +472,6 @@ void wlr_output_destroy(struct wlr_output *output) {
wlr_swapchain_destroy(output->swapchain);
if (output->idle_frame != NULL) {
wl_event_source_remove(output->idle_frame);
}
if (output->idle_done != NULL) {
wl_event_source_remove(output->idle_done);
}
@ -792,12 +782,6 @@ bool wlr_output_commit_state(struct wlr_output *output,
return false;
}
if ((pending.committed & WLR_OUTPUT_STATE_BUFFER) &&
output->idle_frame != NULL) {
wl_event_source_remove(output->idle_frame);
output->idle_frame = NULL;
}
struct timespec now;
clock_gettime(CLOCK_MONOTONIC, &now);
@ -862,39 +846,6 @@ void wlr_output_attach_buffer(struct wlr_output *output,
wlr_output_state_set_buffer(&output->pending, buffer);
}
void wlr_output_send_frame(struct wlr_output *output) {
output->frame_pending = false;
if (output->enabled) {
wl_signal_emit_mutable(&output->events.frame, output);
}
}
static void schedule_frame_handle_idle_timer(void *data) {
struct wlr_output *output = data;
output->idle_frame = NULL;
if (!output->frame_pending) {
wlr_output_send_frame(output);
}
}
void wlr_output_schedule_frame(struct wlr_output *output) {
// Make sure the compositor commits a new frame. This is necessary to make
// clients which ask for frame callbacks without submitting a new buffer
// work.
// TODO(rose): figure out why
wlr_output_update_needs_frame(output);
if (output->frame_pending || output->idle_frame != NULL) {
return;
}
// We're using an idle timer here in case a buffer swap happens right after
// this function is called
struct wl_event_loop *ev = wl_display_get_event_loop(output->display);
output->idle_frame =
wl_event_loop_add_idle(ev, schedule_frame_handle_idle_timer, output);
}
void wlr_output_send_present(struct wlr_output *output,
struct wlr_output_event_present *event) {
assert(event);