output: remove old frame scheduling

This commit is contained in:
Rose Hudson 2023-07-28 11:57:46 +01:00 committed by Kenny Levinsen
parent 0b59a49179
commit 0967873a20
8 changed files with 1 additions and 103 deletions

View file

@ -2081,10 +2081,6 @@ static void handle_page_flip(int fd, unsigned seq,
.flags = present_flags,
};
wlr_output_send_present(&conn->output, &present_event);
if (drm->session->active) {
wlr_output_send_frame(&conn->output);
}
}
int handle_drm_event(int fd, uint32_t mask, void *data) {

View file

@ -22,15 +22,6 @@ static struct wlr_headless_output *headless_output_from_output(
return output;
}
static void output_update_refresh(struct wlr_headless_output *output,
int32_t refresh) {
if (refresh <= 0) {
refresh = HEADLESS_DEFAULT_REFRESH;
}
output->frame_delay = 1000000 / refresh;
}
static bool output_test(struct wlr_output *wlr_output,
const struct wlr_output_state *state) {
uint32_t unsupported = state->committed & ~SUPPORTED_OUTPUT_STATE;
@ -55,25 +46,16 @@ static bool output_test(struct wlr_output *wlr_output,
static bool output_commit(struct wlr_output *wlr_output,
const struct wlr_output_state *state) {
struct wlr_headless_output *output =
headless_output_from_output(wlr_output);
if (!output_test(wlr_output, state)) {
return false;
}
if (state->committed & WLR_OUTPUT_STATE_MODE) {
output_update_refresh(output, state->custom_mode.refresh);
}
if (output_pending_enabled(wlr_output, state)) {
struct wlr_output_event_present present_event = {
.commit_seq = wlr_output->commit_seq + 1,
.presented = true,
};
output_defer_present(wlr_output, present_event);
wl_event_source_timer_update(output->frame_timer, output->frame_delay);
}
return true;
@ -94,7 +76,6 @@ static void output_destroy(struct wlr_output *wlr_output) {
wlr_output_finish(wlr_output);
wl_list_remove(&output->link);
wl_event_source_remove(output->frame_timer);
free(output);
}
@ -110,12 +91,6 @@ bool wlr_output_is_headless(const struct wlr_output *wlr_output) {
return wlr_output->impl == &output_impl;
}
static int signal_frame(void *data) {
struct wlr_headless_output *output = data;
wlr_output_send_frame(&output->wlr_output);
return 0;
}
struct wlr_output *wlr_headless_add_output(struct wlr_backend *wlr_backend,
unsigned int width, unsigned int height) {
struct wlr_headless_backend *backend =
@ -136,8 +111,6 @@ struct wlr_output *wlr_headless_add_output(struct wlr_backend *wlr_backend,
wlr_output_init(wlr_output, &backend->backend, &output_impl, backend->event_loop, &state);
wlr_output_state_finish(&state);
output_update_refresh(output, 0);
size_t output_num = ++last_output_num;
char name[64];
@ -148,8 +121,6 @@ struct wlr_output *wlr_headless_add_output(struct wlr_backend *wlr_backend,
snprintf(description, sizeof(description), "Headless output %zu", output_num);
wlr_output_set_description(wlr_output, description);
output->frame_timer = wl_event_loop_add_timer(backend->event_loop, signal_frame, output);
wl_list_insert(&backend->outputs, &output->link);
if (backend->started) {

View file

@ -72,8 +72,6 @@ static void surface_frame_callback(void *data, struct wl_callback *cb,
assert(output->frame_callback == cb);
wl_callback_destroy(cb);
output->frame_callback = NULL;
wlr_output_send_frame(&output->wlr_output);
}
static const struct wl_callback_listener frame_listener = {

View file

@ -795,8 +795,6 @@ void handle_x11_present_event(struct wlr_x11_backend *x11,
};
timespec_from_nsec(&present_event.when, complete_notify->ust * 1000);
wlr_output_send_present(&output->wlr_output, &present_event);
wlr_output_send_frame(&output->wlr_output);
break;
default:
wlr_log(WLR_DEBUG, "Unhandled Present event %"PRIu16, event->event_type);