Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

export-dmabuf: provide driverUUID and deviceUUID #4

Open
i509VCB opened this issue Aug 14, 2022 · 1 comment
Open

export-dmabuf: provide driverUUID and deviceUUID #4

i509VCB opened this issue Aug 14, 2022 · 1 comment

Comments

@i509VCB
Copy link

i509VCB commented Aug 14, 2022

The export dmabuf protocol should provide the driver and device uuid along side the drm node of the device.

The driver and device uuids are defined in the following Vulkan/EGL extensions:

For vulkan in particular, knowing if the dmabuf is from the same driver and device can be used to optimize memory barriers (The driver uuid would differ if two different versions of Mesa are used across the Wayland socket).

If the driver and device uuids match, the implementation can perform queue family ownership transfer from the sentinel "external" queue family instead of having to use the sentinel "foreign" queue family. Testing by Nvidia's driver team showed that the more optimized memory barrier can lead to a 50% performance improvement in some cases.

Now this all sounds great, are there any protocol considerations that need to be made?

Well, using the external queue family on a dmabuf which is infact foreign leads to undefined behavior in Vulkan. This means the protocol MUST mandate that implementations provide the correct device and driver uuid.

The driver and device uuid fields must be optional. In that case clients must assume the worst and use the most conservative memory barriers.

If a compositor supports the driver and device uuid, the implementation must report both (probably by transmitting both in one event).

Anyways I hope that one day this protocol is standardized in Wayland protocols :)

@Drakulix
Copy link
Member

Drakulix commented Nov 4, 2022

We are going to deprecate the export-dmabuf protocol, but I guess the same applies to the buffer_info event of the screencopy protocol.

While I generally agree with this (and would like to be able to optimize this use-case), we want to switch to ext-screencopy as soon as it lands. So I am not adding any additional fields, which aren't strictly required for our functionality and not present in it's current draft: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/124
I guess this discussion is better had over at wayland-protocols?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants