diff options
author | Mariusz Bialonczyk <manio@skyboo.net> | 2018-08-02 13:37:23 +0200 |
---|---|---|
committer | Mariusz Bialonczyk <manio@skyboo.net> | 2018-08-03 07:43:22 +0200 |
commit | 15dacebc36ffa137aefafcfbe723c7b35af5cc2b (patch) | |
tree | e6d3646ef45bccb29ae99af34a5446e1a8233594 | |
parent | eb9c9d8852bf3b82d78418796c73142054ffab99 (diff) |
multi-backend: do not expose internal renderers
backend_get_renderer() is now returning the renderer of the primary GPU, instead
of its own renderer, since that's the thing which actually does all of the "real"
rendering
wlr_multi_backend_add() is now adding all subbackends (otherwise only one GPU
is handled).
credits: @ascent12
-rw-r--r-- | backend/drm/backend.c | 7 | ||||
-rw-r--r-- | backend/multi/backend.c | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/backend/drm/backend.c b/backend/drm/backend.c index 5833d46e..1df5cdd1 100644 --- a/backend/drm/backend.c +++ b/backend/drm/backend.c @@ -51,7 +51,12 @@ static void backend_destroy(struct wlr_backend *backend) { static struct wlr_renderer *backend_get_renderer( struct wlr_backend *backend) { struct wlr_drm_backend *drm = (struct wlr_drm_backend *)backend; - return drm->renderer.wlr_rend; + + if (drm->parent) { + return drm->parent->renderer.wlr_rend; + } else { + return drm->renderer.wlr_rend; + } } static struct wlr_backend_impl backend_impl = { diff --git a/backend/multi/backend.c b/backend/multi/backend.c index f1d50347..e0038955 100644 --- a/backend/multi/backend.c +++ b/backend/multi/backend.c @@ -143,7 +143,7 @@ bool wlr_multi_backend_add(struct wlr_backend *_multi, struct wlr_renderer *multi_renderer = multi_backend_get_renderer(&multi->backend); struct wlr_renderer *backend_renderer = wlr_backend_get_renderer(backend); - if (multi_renderer != NULL && backend_renderer != NULL) { + if (multi_renderer != NULL && backend_renderer != NULL && multi_renderer != backend_renderer) { wlr_log(WLR_ERROR, "Could not add backend: multiple renderers at the " "same time aren't supported"); return false; |