[igt-dev] [PATCH i-g-t 1/2] lib/xe_query: fix vram_memory()

Matthew Auld matthew.auld at intel.com
Tue Apr 4 12:00:41 UTC 2023


It looks like this is meant to return VRAM if supported. If we call this
on igpu it should return zero. There is at least one user relying on
this in xe_mmap at vram, where we want to skip if the mask here is zero.

Reported-by: Gwan-gyeong Mun <gwan-gyeong.mun at intel.com>
Signed-off-by: Matthew Auld <matthew.auld at intel.com>
Cc: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
Cc: Matthew Brost <matthew.brost at intel.com>
---
 lib/xe/xe_query.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/xe/xe_query.c b/lib/xe/xe_query.c
index 24a258a5e..253164d6b 100644
--- a/lib/xe/xe_query.c
+++ b/lib/xe/xe_query.c
@@ -380,7 +380,7 @@ uint64_t vram_memory(int fd, int gt)
 	igt_assert(xe_dev);
 	igt_assert(gt >= 0 && gt < xe_dev->number_gt);
 
-	return native_region_for_gt(xe_dev->gts, gt);
+	return native_region_for_gt(xe_dev->gts, gt) & (~0x1);
 }
 
 /**
-- 
2.39.2



More information about the igt-dev mailing list