vulkan/wsi/wayland: ensure drm modifiers stored in chain are immutable
authorYiwei Zhang <zzyiwei@chromium.org>
Sat, 9 Dec 2023 23:31:05 +0000 (23:31 +0000)
committerEric Engestrom <eric@engestrom.ch>
Sun, 17 Dec 2023 23:48:01 +0000 (23:48 +0000)
commit25f02192a5ef95985dcf08a62bff8d6c56df3755
treecc365a117e3a7d29ac4c2a198bd2de1d74ea90cb
parent79b2605743e40b4fb99bd79e8de6bf53647a59ba
vulkan/wsi/wayland: ensure drm modifiers stored in chain are immutable

Chain stored modifiers point to the mapping of the current feedback
shmem of the surface. The surface tracked feedback mapping will be gone
and replaced with new mapping during surface_dmabuf_feedback_done. There
are two issues here:
1. One issue is that the existing mapping is closed before been used to
   compare against new modifiers in sets_of_modifiers_are_the_same.
2. The other issue is that when the chain is still optimal, the chain
   persists while the mapping is still replaced with the one from the
   new format table shmem.

This change makes a deep copy of the modifiers to store in the chain to
ensure the modifiers used for the current chain are immutable through
the chain lifecycle.

Cc: mesa-stable
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26618>
(cherry picked from commit ddf2ca4faffdd309638aa0ebfcba2c43b4fc439d)
.pick_status.json
src/vulkan/wsi/wsi_common_wayland.c