From 44b1f98c4a15ba2eeb8ba62659e7a383d79dffa9 Mon Sep 17 00:00:00 2001 From: Julian Orth Date: Fri, 31 May 2024 15:00:59 +0200 Subject: [PATCH] protocol: buffer storage must not be destroyed while in use wl_surface.attach already specifies that this causes the contents of surfaces using the buffer to become undefined. However, if the underlying storage is destroyed (e.g. by truncating a memfd which leads to SIGBUS in the compostior), then it is desirable that the compositor can treat this as a fatal client error. This also addresses the case where a client destroys a GBM BO while the compositor is using it. A client that is aware of this paragraph knows that it can destroy the wl_buffer but must keep the BO alive while the compositor is using it. Signed-off-by: Julian Orth --- protocol/wayland.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/protocol/wayland.xml b/protocol/wayland.xml index 9418c62f..f72c1d95 100644 --- a/protocol/wayland.xml +++ b/protocol/wayland.xml @@ -487,6 +487,9 @@ Note, because wl_buffer objects are created from multiple independent factory interfaces, the wl_buffer interface is frozen at version 1. + + If the client destroys the underlying storage of a wl_buffer while the + compositor is using the buffer, the behavior is unspecified.