renderer: Move dmabuf setup into renderer init
We've forgotten to set this up in some backends, so let's just do it in weston_compositor_init_renderer(). The headless backend used to fail out if linux_dmabuf_setup() failed, but had no reason to do so, so just remove that to make the code common. Suggested by cwabbott on irc. Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This commit is contained in:
parent
b0d5b066c5
commit
27bf066c81
|
@ -4084,9 +4084,6 @@ drm_backend_create(struct weston_compositor *compositor,
|
|||
recorder_binding, b);
|
||||
|
||||
if (compositor->renderer->import_dmabuf) {
|
||||
if (linux_dmabuf_setup(compositor) < 0)
|
||||
weston_log("Error: initializing dmabuf "
|
||||
"support failed.\n");
|
||||
if (compositor->default_dmabuf_feedback) {
|
||||
/* We were able to create the compositor's default
|
||||
* dma-buf feedback in the renderer, that means that the
|
||||
|
|
|
@ -627,13 +627,6 @@ headless_backend_create(struct weston_compositor *compositor,
|
|||
if (ret < 0)
|
||||
goto err_input;
|
||||
|
||||
if (compositor->renderer->import_dmabuf) {
|
||||
if (linux_dmabuf_setup(compositor) < 0) {
|
||||
weston_log("Error: dmabuf protocol setup failed.\n");
|
||||
goto err_input;
|
||||
}
|
||||
}
|
||||
|
||||
/* Support zwp_linux_explicit_synchronization_unstable_v1 to enable
|
||||
* testing. */
|
||||
if (linux_explicit_synchronization_setup(compositor) < 0)
|
||||
|
|
|
@ -2989,12 +2989,6 @@ wayland_backend_create(struct weston_compositor *compositor,
|
|||
|
||||
wl_event_source_check(b->parent.wl_source);
|
||||
|
||||
if (compositor->renderer->import_dmabuf) {
|
||||
if (linux_dmabuf_setup(compositor) < 0)
|
||||
weston_log("Error: initializing dmabuf "
|
||||
"support failed.\n");
|
||||
}
|
||||
|
||||
return b;
|
||||
err_renderer:
|
||||
compositor->renderer->destroy(compositor);
|
||||
|
|
|
@ -1974,12 +1974,6 @@ x11_backend_create(struct weston_compositor *compositor,
|
|||
x11_backend_handle_event, b);
|
||||
wl_event_source_check(b->xcb_source);
|
||||
|
||||
if (compositor->renderer->import_dmabuf) {
|
||||
if (linux_dmabuf_setup(compositor) < 0)
|
||||
weston_log("Error: initializing dmabuf "
|
||||
"support failed.\n");
|
||||
}
|
||||
|
||||
if (compositor->capabilities & WESTON_CAP_EXPLICIT_SYNC) {
|
||||
if (linux_explicit_synchronization_setup(compositor) < 0)
|
||||
weston_log("Error: initializing explicit "
|
||||
|
|
|
@ -10027,6 +10027,10 @@ weston_compositor_init_renderer(struct weston_compositor *compositor,
|
|||
ret = -1;
|
||||
}
|
||||
|
||||
if (compositor->renderer->import_dmabuf)
|
||||
if (linux_dmabuf_setup(compositor) < 0)
|
||||
weston_log("Error: dmabuf protocol setup failed.\n");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue