From f899eff0a7da3db1e47b95c648848a50e38cc29c Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Mon, 1 Jun 2020 16:47:40 +0300 Subject: linux-dmabuf: no buffer errors on device disappearance This was prompted by the discussion from https://lists.freedesktop.org/archives/dri-devel/2020-May/266611.html which is not the final wording. When a DRM device is hot-unplugged, particularly if it is the Wayland compositor's compositing GPU, EGL may start returning errors from trying to use the client's dmabuf. Or, if the client is rendering on another GPU which gets hot-unplugged, the dmabuf the compositor already has may start failing. Hot-unplug is an abrupt global action, and there is no way a client or a compositor could ensure they clean up before things start failing. It is not the client's fault, so the client should not get disconnected if already existing wl_buffer objects start failing. This patch add the wording to the protocol to this effect. The intention is that the compositor replaces the failed buffers with some placeholder content. There is no way this could be glitch-free. In its own pace the client should discover the DRM device is gone, clean up, and perhaps use something else. How exactly that should happen depends on the rendering API the client is using. This is a tiny step towards making DRM device hot-unplug not crash applications that wish to handle the unplug gracefully. Signed-off-by: Pekka Paalanen --- unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'unstable') diff --git a/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml b/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml index 4b1dd74..85e99ba 100644 --- a/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml +++ b/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml @@ -55,6 +55,12 @@ at any time use those fds to import the dmabuf into any kernel sub-system that might accept it. + However, when the underlying graphics stack fails to deliver the + promise, because of e.g. a device hot-unplug which raises internal + errors, after the wl_buffer has been successfully created the + compositor must not raise protocol errors to the client when dmabuf + import later fails. + To create a wl_buffer from one or more dmabufs, a client creates a zwp_linux_dmabuf_params_v1 object with a zwp_linux_dmabuf_v1.create_params request. All planes required by the intended format are added with -- cgit v1.2.3