anv: Fix assert in xe_gem_create()

In this assert we want to enforce that if a cached buffer is created
it is a cached+coherent as Xe KMD don't support cached+incoherent.

Did not caught this issue because it only reproduces in platforms with
GPU outside of LLC.

Fixes: 9d8d5cf8c9 ("anv: Remove block promoting non CPU mapped bos to coherent")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29826>
This commit is contained in:
José Roberto de Souza 2024-06-20 14:52:47 -07:00 committed by Marge Bot
parent c1feccdd90
commit 73ce3143a8

View file

@ -42,7 +42,8 @@ xe_gem_create(struct anv_device *device,
/* TODO: protected content */
assert((alloc_flags & ANV_BO_ALLOC_PROTECTED) == 0);
/* WB+0 way coherent not supported by Xe KMD */
assert(alloc_flags & ANV_BO_ALLOC_HOST_COHERENT);
assert((alloc_flags & ANV_BO_ALLOC_HOST_CACHED) == 0 ||
(alloc_flags & ANV_BO_ALLOC_HOST_CACHED_COHERENT) == ANV_BO_ALLOC_HOST_CACHED_COHERENT);
uint32_t flags = 0;
if (alloc_flags & ANV_BO_ALLOC_SCANOUT)