[igt-dev] [PATCH i-g-t v3 2/5] lib/intel_blt: Add visible vram flag if object needs to be mapped
Zbigniew Kempczyński
zbigniew.kempczynski at intel.com
Thu Oct 19 19:33:18 UTC 2023
For objects with blitter helper in vram which needs to be mapped
add visible vram flag to ensure it will be placed in mappable
vram region.
Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
Cc: Matthew Auld <matthew.auld at intel.com>
---
lib/intel_blt.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/lib/intel_blt.c b/lib/intel_blt.c
index 3c5e97963d..c2ae986fbf 100644
--- a/lib/intel_blt.c
+++ b/lib/intel_blt.c
@@ -1618,8 +1618,13 @@ blt_create_object(const struct blt_copy_data *blt, uint32_t region,
obj->size = size;
if (blt->driver == INTEL_DRIVER_XE) {
+ uint64_t flags = region;
+
+ if (create_mapping && region != system_memory(blt->fd))
+ flags |= XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM;
+
size = ALIGN(size, xe_get_default_alignment(blt->fd));
- handle = xe_bo_create_flags(blt->fd, 0, size, region);
+ handle = xe_bo_create_flags(blt->fd, 0, size, flags);
} else {
igt_assert(__gem_create_in_memory_regions(blt->fd, &handle,
&size, region) == 0);
--
2.34.1
More information about the igt-dev
mailing list