Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

Multiple renderers at the same time #778

Closed
emersion opened this issue Mar 30, 2018 · 1 comment
Closed

Multiple renderers at the same time #778

emersion opened this issue Mar 30, 2018 · 1 comment

Comments

@emersion
Copy link
Member

We can probably export and import dma-bufs to do this one.

@emersion
Copy link
Member Author

emersion commented Apr 25, 2018

We have multiple options to solve this issue:

  1. Always only use one renderer: that means there's only one EGL context and that textures can be shared between backends. That works if the "master" backend creates the renderer (can be DRM/X11/Wayland) and if the other "slave" backends don't need to create an EGL context. "Slave" backends could only be headless or RDP. That has the upside of being simple, allows hotplugging backends. However you can't have two "master" backends at the same time. This could be implemented very easily by adding an optional wlr_renderer argument to "slave" backends (the backend would use the parent renderer if provided, or create its own if not).
  2. Try to use DMA-BUF export ([WIP] Add DMA-BUF export support #906). A texture will be uploaded to the first available renderer, and will be exported/imported via DMA-BUF if we want to use it on another renderer. It seems that it won't always work because the Mesa implementation is poor, will investigate further. This won't work if DMA-BUF isn't supported (this will be the case on software renderers), and we'll likely run into issues with supported formats.
  3. Upload buffers to all renderers at the same time. It seems very inefficient at first because when uploading pixel buffers it means data will be duplicated. However for clients using wl-drm or the DMA-BUF protocol this won't happen, the client buffer will be directly used. This would work in all situations (even when there are mixed software/GL/Vulkan/whatever renderers). This could be implemented with e.g. a wlr_multi_renderer combining several renderers (just like wlr_multi_backend combines multiple backends).

(2) and (3) have issues with hotplugging: they change the set of supported formats. We can't change this at runtime if a client is currently connected.

Note that we could implement all options independently of each others. For instance we could use (1) when we hotplug a RDP backend, and fallback to (2) if we hotplug a X11/Wayland backend, and fallback to (3) if we can't use DMA-BUF.

Second side note: for screencasting (#709), we probably won't want to use (2), but instead use GBM export functions. See daniels' comment in the logs.

IRC logs: https://sr.ht/qMfS.txt

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging a pull request may close this issue.

1 participant