aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2018-03-11 19:05:11 +0100
committerGuido Günther <agx@sigxcpu.org>2018-03-15 12:40:18 +0100
commiteb4337b5eea47e5f3ec337639d2f62c2bae15797 (patch)
tree0bb80fcc44a521cb2a1e30254dd7dc2f899c4176
parent14cdb6153f4293d7e058465ab4acaebd6e1f647c (diff)
Wire up linux_dmabuf in rootston
-rw-r--r--include/rootston/desktop.h2
-rw-r--r--rootston/desktop.c3
-rw-r--r--types/wlr_linux_dmabuf.c8
3 files changed, 9 insertions, 4 deletions
diff --git a/include/rootston/desktop.h b/include/rootston/desktop.h
index 467de8ab..db8a088e 100644
--- a/include/rootston/desktop.h
+++ b/include/rootston/desktop.h
@@ -7,6 +7,7 @@
#include <wlr/types/wlr_compositor.h>
#include <wlr/types/wlr_gamma_control.h>
#include <wlr/types/wlr_idle.h>
+#include <wlr/types/wlr_linux_dmabuf.h>
#include <wlr/types/wlr_list.h>
#include <wlr/types/wlr_output_layout.h>
#include <wlr/types/wlr_output.h>
@@ -46,6 +47,7 @@ struct roots_desktop {
struct wlr_primary_selection_device_manager *primary_selection_device_manager;
struct wlr_idle *idle;
struct wlr_idle_inhibit_manager_v1 *idle_inhibit;
+ struct wlr_linux_dmabuf *linux_dmabuf;
struct wl_listener new_output;
struct wl_listener layout_change;
diff --git a/rootston/desktop.c b/rootston/desktop.c
index 3628b051..a130fe38 100644
--- a/rootston/desktop.c
+++ b/rootston/desktop.c
@@ -9,6 +9,7 @@
#include <wlr/types/wlr_cursor.h>
#include <wlr/types/wlr_gamma_control.h>
#include <wlr/types/wlr_idle.h>
+#include <wlr/types/wlr_linux_dmabuf.h>
#include <wlr/types/wlr_output_layout.h>
#include <wlr/types/wlr_idle_inhibit_v1.h>
#include <wlr/types/wlr_primary_selection.h>
@@ -729,6 +730,8 @@ struct roots_desktop *desktop_create(struct roots_server *server,
desktop->idle = wlr_idle_create(server->wl_display);
desktop->idle_inhibit = wlr_idle_inhibit_v1_create(server->wl_display);
+ struct wlr_egl *egl = wlr_backend_get_egl(server->backend);
+ desktop->linux_dmabuf = wlr_linux_dmabuf_create(server->wl_display, egl);
return desktop;
}
diff --git a/types/wlr_linux_dmabuf.c b/types/wlr_linux_dmabuf.c
index 407a5717..3b86166e 100644
--- a/types/wlr_linux_dmabuf.c
+++ b/types/wlr_linux_dmabuf.c
@@ -176,7 +176,7 @@ static void params_create_common(struct wl_client *client,
}
if ((uint64_t)buffer->attributes.offset[0] +
- (uint64_t) buffer->attributes.stride[0] * height > UINT32_MAX) {
+ (uint64_t)buffer->attributes.stride[0] * height > UINT32_MAX) {
wl_resource_post_error(params_resource,
ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_OUT_OF_BOUNDS,
"size overflow for plane");
@@ -205,15 +205,15 @@ static void params_create_common(struct wl_client *client,
wl_resource_post_error(params_resource,
ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_OUT_OF_BOUNDS,
"invalid buffer stride or height for plane");
- goto err_out;
+ goto err_out;
}
}
/* reject unknown flags */
if (buffer->attributes.flags & ~ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_Y_INVERT) {
wl_resource_post_error(params_resource,
- ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INVALID_FORMAT,
- "Unknown dmabuf flags %"PRIu32, buffer->attributes.flags);
+ ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INVALID_FORMAT,
+ "Unknown dmabuf flags %"PRIu32, buffer->attributes.flags);
goto err_out;
}