xserver/hw/xfree86
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
..
common xf86: drop no longer needed entries from default driver list for Intel 2026-04-11 18:05:19 +00:00
ddc Fix typos 2026-03-03 06:50:01 -03:00
dixmods meson: give the xorg executable an actual name 2026-05-10 23:42:43 +00:00
doc meson: replace join_paths() with / operator 2026-03-28 10:02:41 -07:00
dri Fix typos 2026-03-03 06:50:01 -03:00
dri2 dri2: Deduplicate attachments in do_get_buffer 2026-06-01 08:31:59 +10:00
drivers meson: give the xorg executable an actual name 2026-05-10 23:42:43 +00:00
exa meson: give the xorg executable an actual name 2026-05-10 23:42:43 +00:00
fbdevhw meson: give the xorg executable an actual name 2026-05-10 23:42:43 +00:00
glamor_egl xorg: initialize glamor provider 2023-11-07 17:59:43 +03:00
i2c Fix typos 2026-03-03 06:50:01 -03:00
int10 treewide: fix typos 2026-03-14 16:52:19 +00:00
loader xfree86: Fix builds with gcc -Wpedantic 2026-01-25 10:40:02 -08:00
man Support XDG Base Dir Spec 0.8. 2026-02-15 10:15:19 -08:00
modes xf86: check return value of XF86_CRTC_CONFIG_PTR in xf86CompatOutput() 2026-02-15 18:34:26 +00:00
os-support xf86: fix hotplug header include in platform_noop.c 2026-04-04 15:36:26 +00:00
parser meson: replace join_paths() with / operator 2026-03-28 10:02:41 -07:00
ramdac Fix typos 2026-03-03 06:50:01 -03:00
shadowfb meson: give the xorg executable an actual name 2026-05-10 23:42:43 +00:00
utils man pages: use .BR to mark up man page references 2026-01-25 10:40:01 -08:00
vgahw Fix typos 2026-03-03 06:50:01 -03:00
x86emu Fix typos 2026-03-03 06:50:01 -03:00
xkb xkb: drop defining XKBSRV_NEED_FILE_FUNCS 2026-01-19 12:32:18 -08:00
.gitignore Xorg: Add Xorg.wrap to hw/xfree86/.gitignore 2014-04-18 11:39:16 +02:00
meson.build meson: give the xorg executable an actual name 2026-05-10 23:42:43 +00:00
sdksyms.sh include: unexport XIstubs.h 2026-01-25 10:39:56 -08:00
xorg-wrapper.c Fix various spelling errors 2019-10-01 17:05:28 +00:00
Xorg.sh.in xfree86: rename Xorg.bin to Xorg 2015-01-05 09:53:58 +10:00
xorgconf.cpp Fix typos 2026-03-03 06:50:01 -03:00