wlroots
wlroots copied to clipboard
dmabuf: Support splitting up multi planar formats into single plane dmabufs
I thought I had filed a bug to not forget about this when working on dmabuf import but it seems I haven't:
Some of the dmabuf formats (YUV) are split up by weston from multiple planes to single plane dmabufs:
https://gitlab.freedesktop.org/wayland/weston/blob/master/libweston/gl-renderer.c#L2084
This is not implemented in wlroots yet. This breaks NV12 with weston's simple-dmabuf when using the proposed gbm patches:
https://lists.freedesktop.org/archives/wayland-devel/2018-July/039036.html
Related to #54
wlroots has migrated to gitlab.freedesktop.org. This issue has been moved to:
https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/1151
Thanks for keeping up with Weston patches :)
Any idea how to deal with this? Should we have a list of multiplanar formats and how they're split up?
I've asked the same question on wayland-devel. Weston's current way of lets try multiplanar first and if that fails split things up looks suboptimal. But I think we just don't know beforehand for what formats we need to split up and for which we don't (e.g. when NV12 comes in two buffers via gbm we need to split but not when it comes in a single buffer (but still two fds) allocated via drm_intel_bo_alloc_tiled.
Apart from that we need to add support for handling multiple EGLImges coming out from of one dmabuf first. The decision how to import the dmabuf is then just one thing we need to decide on when that's in place.
I'll put that on my todo list but might not be able to put much time into this during the next weeks.
Stumbled over this problem as well (basically the same for vulkan). The problem boils down to checking whether the given fds for multiple planes refer to the same dma buffer object, correct? Not sure if this works in all cases (so probably needs more research/good testing) but since in cases with only one buffer object the fds for the other planes are usually just retrieved using dup, we might be able make a decision using kcmp, at least on linux.