[igt-dev] [PATCH i-g-t 1/2] xe/xe_create: Use system configuration page size

Zbigniew Kempczyński zbigniew.kempczynski at intel.com
Mon Apr 3 10:33:58 UTC 2023


During the review Maarten asked to use _SC_PAGESIZE, unfortunately
this left on branch I didn't merge. Fix this to be page size
independent.

Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
---
 tests/xe/xe_create.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/xe/xe_create.c b/tests/xe/xe_create.c
index ae841f8092..74833639f4 100644
--- a/tests/xe/xe_create.c
+++ b/tests/xe/xe_create.c
@@ -50,6 +50,7 @@ static void create_invalid_size(int fd)
 {
 	struct drm_xe_query_mem_region *memregion;
 	uint64_t memreg = all_memory_regions(fd), region;
+	const uint32_t page_size = sysconf(_SC_PAGESIZE);
 	uint32_t vm;
 	uint32_t handle;
 	int ret;
@@ -72,9 +73,9 @@ static void create_invalid_size(int fd)
 		 * second try, add page size to min page size if it is
 		 * bigger than page size.
 		 */
-		if (memregion->min_page_size > PAGE_SIZE) {
+		if (memregion->min_page_size > page_size) {
 			ret = __create_bo(fd, vm,
-					  memregion->min_page_size + PAGE_SIZE,
+					  memregion->min_page_size + page_size,
 					  region, &handle);
 			if (!ret) {
 				gem_close(fd, handle);
-- 
2.34.1



More information about the igt-dev mailing list