xserver/hw
Michel Dänzer f0b8e6e1d9 dri2: Deduplicate attachments in do_get_buffer
It was always the intention of the DRI2 protocol that there's at most
one instance of each attachment, and that's how it was implemented in
Mesa.

Since that wasn't enforced though, there might be other clients in the
wild which (e.g. accidentally) request the same attachment multiple
times. So starting to a raise a protocol error in this case now risks
breaking such clients.

Instead, just deduplicate the attachments using a bit-set.

This has a couple of desirable side effects:

* destroy_buffer cannot be called multiple times for the same
  DRI2BufferPtr.
* The client cannot cause the server to allocate a buffers array with
  more entries than there are attachments (currently 11).

Signed-off-by: Michel Dänzer <mdaenzer@redhat.com>
(cherry picked from commit 339c279514)

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2229>
2026-06-02 09:47:55 +10:00
..
kdrive ephyr: Fix incompatible pointer type build error 2024-05-12 08:00:00 +00:00
vfb mi: List extensions in usage message 2021-01-29 12:52:09 +00:00
xfree86 dri2: Deduplicate attachments in do_get_buffer 2026-06-02 09:47:55 +10:00
xnest Xnest: fix broken exposure events 2024-10-12 00:46:34 +00:00
xquartz xquartz: Bump copyrights in Info.plist to 2026 2026-03-25 23:47:59 -07:00
xwin XWin.man: fix typos in font change escapes 2025-06-12 18:10:31 -07:00
Makefile.am Drop XWayland DDX 2021-09-15 21:49:17 +03:00
meson.build Drop XWayland DDX 2021-09-15 21:49:17 +03:00