From 0c4e041f640b43ed97fc1bca631b69ee7c55b4e8 Mon Sep 17 00:00:00 2001
From: Simon Ser <contact@emersion.fr>
Date: Mon, 3 Jul 2023 10:22:08 +0200
Subject: [PATCH] linux-dmabuf: require all planes to use the same modifier

The kernel enforces this. Accepting a separate modifier per-plane is
an historical artifact.

Signed-off-by: Simon Ser <contact@emersion.fr>
Closes: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/issues/29
---
 unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml b/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml
index 4ba959f5..9787ad3d 100644
--- a/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml
+++ b/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml
@@ -24,7 +24,7 @@
     DEALINGS IN THE SOFTWARE.
   </copyright>
 
-  <interface name="zwp_linux_dmabuf_v1" version="4">
+  <interface name="zwp_linux_dmabuf_v1" version="5">
     <description summary="factory for creating dmabuf-based wl_buffers">
       Following the interfaces from:
       https://www.khronos.org/registry/egl/extensions/EXT/EGL_EXT_image_dma_buf_import.txt
@@ -190,7 +190,7 @@
     </request>
   </interface>
 
-  <interface name="zwp_linux_buffer_params_v1" version="4">
+  <interface name="zwp_linux_buffer_params_v1" version="5">
     <description summary="parameters for creating a dmabuf-based wl_buffer">
       This temporary object is a collection of dmabufs and other
       parameters that together form a single logical buffer. The temporary
@@ -250,6 +250,9 @@
         Starting from version 4, the invalid_format protocol error is sent if
         the format + modifier pair was not advertised as supported.
 
+        Starting from version 5, the invalid_format protocol error is sent if
+        all planes don't use the same modifier.
+
         This request raises the PLANE_IDX error if plane_idx is too large.
         The error PLANE_SET is raised if attempting to set a plane that
         was already set.
@@ -397,7 +400,7 @@
     </request>
   </interface>
 
-  <interface name="zwp_linux_dmabuf_feedback_v1" version="4">
+  <interface name="zwp_linux_dmabuf_feedback_v1" version="5">
     <description summary="dmabuf feedback">
       This object advertises dmabuf parameters feedback. This includes the
       preferred devices and the supported formats/modifiers.
-- 
GitLab