anv: Fix vm bind of imported buffers
authorJosé Roberto de Souza <jose.souza@intel.com>
Tue, 11 Apr 2023 15:36:42 +0000 (08:36 -0700)
committerMarge Bot <emma+marge@anholt.net>
Wed, 12 Apr 2023 10:05:32 +0000 (10:05 +0000)
commitb1299f42ff9790dd1bbb5169a3d9357734e5fba9
treeda5ccdff46e254a68d72aad7a970012a643949cb
parent87978c39334045b6e998e62f7353c4c98e588f53
anv: Fix vm bind of imported buffers

Imported buffers may be created in a device with different
memory alignment and this can cause vm bind to fail because bo
size can be smaller than the calculated vm bind range using the
importer device memory alignment.

So here adding actual_size to anv_bo, this will be set with the actual
size of the bo allocated by kmd for bos allocate in the current device.
For other bo the lseek or the Vulkan API size will be used.

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/22219>
src/intel/vulkan/anv_allocator.c
src/intel/vulkan/anv_gem_stubs.c
src/intel/vulkan/anv_kmd_backend.h
src/intel/vulkan/anv_private.h
src/intel/vulkan/i915/anv_kmd_backend.c
src/intel/vulkan/xe/anv_kmd_backend.c