[PATCH i-g-t] lib/intel_bufops: Set NEEDS_VISIBLE_VRAM for each buf by default

Dominik Grzegorzek dominik.grzegorzek at intel.com
Thu Dec 5 10:41:34 UTC 2024


Some tests (i.e. xe_eudebug_online, xe_exec_sip) are mapping intel_buf.
If the backing storage is nvram, any access to mmaped buffer may
cause segmentation fault. Set DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM
by default as intel_bufs might be mapped and this is not harmful.

Signed-off-by: Dominik Grzegorzek <dominik.grzegorzek at intel.com>
---
Cc: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>

 lib/intel_bufops.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/intel_bufops.c b/lib/intel_bufops.c
index 619222019..49b91a171 100644
--- a/lib/intel_bufops.c
+++ b/lib/intel_bufops.c
@@ -1021,7 +1021,8 @@ static void __intel_buf_init(struct buf_ops *bops,
 				cpu_caching = DRM_XE_GEM_CPU_CACHING_WC;
 
 			bo_size = ALIGN(bo_size, xe_get_default_alignment(bops->fd));
-			buf->handle = xe_bo_create_caching(bops->fd, 0, bo_size, region, 0,
+			buf->handle = xe_bo_create_caching(bops->fd, 0, bo_size, region,
+							   DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM,
 							   cpu_caching);
 		}
 	}
-- 
2.34.1



More information about the igt-dev mailing list