output: drop wlr_output_state.buffer_type

This is now unconditionally set to WLR_OUTPUT_STATE_BUFFER_SCANOUT.
This commit is contained in:
Simon Ser 2021-07-12 18:01:40 +02:00 committed by Simon Zeni
parent f211bc983a
commit 3132c0ab10
6 changed files with 3 additions and 20 deletions

View file

@ -396,7 +396,6 @@ static bool drm_connector_set_pending_fb(struct wlr_drm_connector *conn,
struct wlr_drm_plane *plane = crtc->primary;
assert(state->committed & WLR_OUTPUT_STATE_BUFFER);
assert(state->buffer_type == WLR_OUTPUT_STATE_BUFFER_SCANOUT);
struct wlr_buffer *local_buf;
if (drm->parent) {

View file

@ -261,7 +261,6 @@ static bool output_test(struct wlr_output *wlr_output) {
}
if ((wlr_output->pending.committed & WLR_OUTPUT_STATE_BUFFER) &&
wlr_output->pending.buffer_type == WLR_OUTPUT_STATE_BUFFER_SCANOUT &&
!test_buffer(output->backend, wlr_output->pending.buffer)) {
return false;
}
@ -287,9 +286,6 @@ static bool output_commit(struct wlr_output *wlr_output) {
}
if (wlr_output->pending.committed & WLR_OUTPUT_STATE_BUFFER) {
assert(wlr_output->pending.buffer_type ==
WLR_OUTPUT_STATE_BUFFER_SCANOUT);
struct wp_presentation_feedback *wp_feedback = NULL;
if (output->backend->presentation != NULL) {
wp_feedback = wp_presentation_feedback(output->backend->presentation,

View file

@ -257,9 +257,6 @@ static struct wlr_x11_buffer *get_or_create_x11_buffer(
static bool output_commit_buffer(struct wlr_x11_output *output) {
struct wlr_x11_backend *x11 = output->x11;
assert(output->wlr_output.pending.buffer_type ==
WLR_OUTPUT_STATE_BUFFER_SCANOUT);
struct wlr_buffer *buffer = output->wlr_output.pending.buffer;
struct wlr_x11_buffer *x11_buffer =
get_or_create_x11_buffer(output, buffer);

View file

@ -63,11 +63,6 @@ enum wlr_output_state_field {
WLR_OUTPUT_STATE_GAMMA_LUT = 1 << 7,
};
enum wlr_output_state_buffer_type {
WLR_OUTPUT_STATE_BUFFER_RENDER,
WLR_OUTPUT_STATE_BUFFER_SCANOUT,
};
enum wlr_output_state_mode_type {
WLR_OUTPUT_STATE_MODE_FIXED,
WLR_OUTPUT_STATE_MODE_CUSTOM,
@ -85,8 +80,7 @@ struct wlr_output_state {
bool adaptive_sync_enabled;
// only valid if WLR_OUTPUT_STATE_BUFFER
enum wlr_output_state_buffer_type buffer_type;
struct wlr_buffer *buffer; // if WLR_OUTPUT_STATE_BUFFER_SCANOUT
struct wlr_buffer *buffer;
// only valid if WLR_OUTPUT_STATE_MODE
enum wlr_output_state_mode_type mode_type;

View file

@ -721,8 +721,7 @@ static bool output_basic_test(struct wlr_output *output) {
return false;
}
if (output->pending.buffer_type == WLR_OUTPUT_STATE_BUFFER_SCANOUT &&
output->back_buffer == NULL) {
if (output->back_buffer == NULL) {
if (output->attach_render_locks > 0) {
wlr_log(WLR_DEBUG, "Direct scan-out disabled by lock");
return false;
@ -911,7 +910,6 @@ void wlr_output_attach_buffer(struct wlr_output *output,
struct wlr_buffer *buffer) {
output_state_clear_buffer(&output->pending);
output->pending.committed |= WLR_OUTPUT_STATE_BUFFER;
output->pending.buffer_type = WLR_OUTPUT_STATE_BUFFER_SCANOUT;
output->pending.buffer = wlr_buffer_lock(buffer);
}

View file

@ -52,8 +52,7 @@ static void output_handle_precommit(struct wl_listener *listener, void *data) {
if (output->pending.committed & WLR_OUTPUT_STATE_BUFFER) {
// TODO: find a better way to access this info without a precommit
// handler
output_damage->pending_attach_render = output->back_buffer != NULL ||
output->pending.buffer_type == WLR_OUTPUT_STATE_BUFFER_RENDER;
output_damage->pending_attach_render = output->back_buffer != NULL;
}
}