anv: Properly alloc buffers that will be promoted to framebuffer in Xe KMD
authorJosé Roberto de Souza <jose.souza@intel.com>
Fri, 3 Mar 2023 19:03:18 +0000 (11:03 -0800)
committerMarge Bot <emma+marge@anholt.net>
Wed, 15 Mar 2023 18:17:11 +0000 (18:17 +0000)
commitb2d82c25fb62749ccf472e70c7ad6a6e97d25d60
tree570969f895bd8aa4348cfb7be9da48542d3c3a0c
parenta311c031f6fd6194f315dbfdf67f60adfca5d5d2
anv: Properly alloc buffers that will be promoted to framebuffer in Xe KMD

Xe KMD does a special caching handling for buffers that will be
scanout to display, so that is why it needs a flag set during
allocation.

Checking if VK_STRUCTURE_TYPE_WSI_MEMORY_ALLOCATE_INFO_MESA
is available in AllocateMemory() and marking the buffer as scanout.

All WSI code paths but one sets
VK_STRUCTURE_TYPE_WSI_MEMORY_ALLOCATE_INFO_MESA.
The only one that doesn't requires that WSI is initialize with
wsi_device_options.sw_device = true to be executed, what is not the
case for ANV.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21885>
src/intel/vulkan/anv_device.c
src/intel/vulkan/anv_private.h
src/intel/vulkan/xe/anv_kmd_backend.c