aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authorIlia Mirkin <imirkin@alum.mit.edu>2021-01-21 05:15:06 -0500
committerSimon Ser <contact@emersion.fr>2021-01-21 12:35:52 +0100
commitbb92fd4c9082bb9630164b14feaf4d4181399747 (patch)
treede403c109488a0a398420b733c98d20583d0ca0c /backend
parent7c995b78b2f74a0a2e4c96c6be1736702d3733c7 (diff)
backend/x11: add support for scanout mode
This makes full-screen with weston-terminal work.
Diffstat (limited to 'backend')
-rw-r--r--backend/x11/output.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/backend/x11/output.c b/backend/x11/output.c
index 3ca4a235..e34b9913 100644
--- a/backend/x11/output.c
+++ b/backend/x11/output.c
@@ -218,12 +218,24 @@ 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->back_buffer != NULL);
+ struct wlr_buffer *buffer = NULL;
+ switch (output->wlr_output.pending.buffer_type) {
+ case WLR_OUTPUT_STATE_BUFFER_RENDER:
+ assert(output->back_buffer != NULL);
- wlr_renderer_bind_buffer(x11->renderer, NULL);
+ wlr_renderer_bind_buffer(x11->renderer, NULL);
+
+ buffer = output->back_buffer;
+ output->back_buffer = NULL;
+ break;
+ case WLR_OUTPUT_STATE_BUFFER_SCANOUT:
+ buffer = wlr_buffer_lock(output->wlr_output.pending.buffer);
+ break;
+ }
+ assert(buffer != NULL);
struct wlr_x11_buffer *x11_buffer =
- get_or_create_x11_buffer(output, output->back_buffer);
+ get_or_create_x11_buffer(output, buffer);
if (!x11_buffer) {
goto error;
}
@@ -267,8 +279,7 @@ static bool output_commit_buffer(struct wlr_x11_output *output) {
xcb_xfixes_destroy_region(x11->xcb, region);
}
- wlr_buffer_unlock(output->back_buffer);
- output->back_buffer = NULL;
+ wlr_buffer_unlock(buffer);
wlr_swapchain_set_buffer_submitted(output->swapchain, x11_buffer->buffer);
@@ -276,8 +287,7 @@ static bool output_commit_buffer(struct wlr_x11_output *output) {
error:
destroy_x11_buffer(x11_buffer);
- wlr_buffer_unlock(output->back_buffer);
- output->back_buffer = NULL;
+ wlr_buffer_unlock(buffer);
return false;
}