anv: No compression on host memory allocation (xe2)

The Xe kernel driver doesn't allow vm_bind on compressed bo
if it has user pointer. And we probably shouldn't enable CCS
compression on memory in any case.

This change is necessary to prevent failures once we adjust the
priority of compression PAT entries in a following commit:

Vulkan CTS:
dEQP-VK.api.buffer_marker.compute.external_host_mem.top_of_pipe.
memory_dep.buffer_copy

dEQP-VK.memory.external_memory_host.simple_allocation.
minImportedHostPointerAlignment_x3

anv_kmd_backend.c:308: xe_vm_bind_op: Assertion
`errno_ != EINVAL' failed.

Signed-off-by: Jianxun Zhang <jianxun.zhang@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36275>
(cherry picked from commit c766586957)
This commit is contained in:
Jianxun Zhang 2025-07-14 14:02:11 -07:00 committed by Eric Engestrom
parent b6e59297f7
commit cbd43cd9f8
3 changed files with 5 additions and 2 deletions

View file

@ -23594,7 +23594,7 @@
"description": "anv: No compression on host memory allocation (xe2)",
"nominated": false,
"nomination_type": 0,
"resolution": 4,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -1886,6 +1886,7 @@ anv_device_import_bo_from_host_ptr(struct anv_device *device,
ANV_BO_ALLOC_HOST_COHERENT |
ANV_BO_ALLOC_AUX_CCS |
ANV_BO_ALLOC_PROTECTED |
ANV_BO_ALLOC_COMPRESSED |
ANV_BO_ALLOC_FIXED_ADDRESS)));
assert(alloc_flags & ANV_BO_ALLOC_EXTERNAL);

View file

@ -1811,8 +1811,10 @@ VkResult anv_GetMemoryHostPointerPropertiesEXT(
switch (handleType) {
case VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT:
/* Host memory can be imported as any memory type. */
pMemoryHostPointerProperties->memoryTypeBits =
device->info->ver >= 20 ?
device->physical->memory.default_buffer_mem_types :
(1ull << device->physical->memory.type_count) - 1;
return VK_SUCCESS;