-
Notifications
You must be signed in to change notification settings - Fork 341
Stop importing DMA-BUFs on wl_surface.commit #2664
Comments
Well, apparently re-importing the DMA-BUFs is necessary on some drivers to see the changes to the underlying buffer. |
However, when we use external EGL textures, the underlying changes are guaranteed to be visible without re-importing. Also, it seems like to see the external changes for a regular texture (not external), we don't need to re-import the DMA-BUF as an EGLImage -- we can just re-create the texture from the same EGLImage. |
This proposal sounds like it can potentially fix #2636? |
I don't think so. Before the regression we were already importing DMA-BUFs on each commit. |
We could add a With the GLES2 renderer and a DMA-BUF texture:
With the GLES2 renderer and a shm texture:
With the Pixman renderer and a shm texture:
|
Previously, the same struct was used for linux-dmabuf-v1 params and buffer. This made the whole logic a little bit awkward, because a wlr_dmabuf_v1_buffer could either be still being constructed, or be a complete buffer. Introduce a separate wlr_linux_buffer_params_v1 struct for buffer params still being constructed. Once the params are complete (ie. once the create request is sent), the params struct is destroyed and the buffer struct is created. This will help with [1] as well. [1]: swaywm#2664
#2851 tries to address this issue by passing a This does require us to always have a |
Previously, the same struct was used for linux-dmabuf-v1 params and buffer. This made the whole logic a little bit awkward, because a wlr_dmabuf_v1_buffer could either be still being constructed, or be a complete buffer. Introduce a separate wlr_linux_buffer_params_v1 struct for buffer params still being constructed. Once the params are complete (ie. once the create request is sent), the params struct is destroyed and the buffer struct is created. This will help with [1] as well. [1]: #2664
Fixed in #2851 |
Right now, we create
wlr_client_buffer
objects on surface commit. This works fine forwl_shm
buffers (especially when we can just update the previous buffer), however this imports DMA-BUFs via EGL too often. We'd only need to import them once when thewl_buffer
is created, and then we could re-use the sameEGLImage
for all subsequent commits.Some drivers are known to have slow DMA-BUF import paths. This also makes us import too often the DMA-BUFs to KMS when using direct scan-out.
The text was updated successfully, but these errors were encountered: