xserver/hw
Michel Dänzer 339c279514 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>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2228>
2026-06-01 08:31:59 +10:00
..
kdrive treewide: fix typos 2026-03-14 16:52:19 +00:00
vfb vfb: use snprintf when writing XWD window name 2026-04-15 23:38:29 +00:00
xfree86 dri2: Deduplicate attachments in do_get_buffer 2026-06-01 08:31:59 +10:00
xnest Xnest: use authorative declarations from X11/XKBlib.h 2026-01-25 10:40:01 -08:00
xquartz meson: replace join_paths() with / operator 2026-03-28 10:02:41 -07:00
xwayland xwayland: Add have_clipboard flag in pkgconfig file 2026-05-27 10:04:50 +00:00
xwin meson: replace join_paths() with / operator 2026-03-28 10:02:41 -07:00
meson.build meson.build: print a summary of the DDX to build 2026-01-25 10:40:01 -08:00