[igt-dev] [PATCH i-g-t 2/3] lib/igt_v3d: Add PAGE_SIZE macro to V3D

Maíra Canal mcanal at igalia.com
Sat Sep 24 16:51:41 UTC 2022


Some V3D tests use the page memory size, so create a macro to define the
page size as 4096 and replace this value for the macro in the V3D tests.

Signed-off-by: Maíra Canal <mcanal at igalia.com>
---
 lib/igt_v3d.h             | 2 ++
 tests/v3d_get_bo_offset.c | 6 ++----
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/igt_v3d.h b/lib/igt_v3d.h
index 20429951..202c5e22 100644
--- a/lib/igt_v3d.h
+++ b/lib/igt_v3d.h
@@ -26,6 +26,8 @@
 
 #include "v3d_drm.h"
 
+#define PAGE_SIZE 4096
+
 struct v3d_bo {
 	int handle;
 	uint32_t offset;
diff --git a/tests/v3d_get_bo_offset.c b/tests/v3d_get_bo_offset.c
index 0923dc85..bbe39361 100644
--- a/tests/v3d_get_bo_offset.c
+++ b/tests/v3d_get_bo_offset.c
@@ -33,8 +33,6 @@
 #include <sys/stat.h>
 #include <sys/ioctl.h>
 #include <poll.h>
-#include "v3d_drm.h"
-#include "igt_v3d.h"
 
 igt_main
 {
@@ -45,8 +43,8 @@ igt_main
 
 	igt_subtest("create-get-offsets") {
 		struct v3d_bo *bos[2] = {
-			igt_v3d_create_bo(fd, 4096),
-			igt_v3d_create_bo(fd, 4096),
+			igt_v3d_create_bo(fd, PAGE_SIZE),
+			igt_v3d_create_bo(fd, PAGE_SIZE),
 		};
 		uint32_t offsets[2] = {
 			igt_v3d_get_bo_offset(fd, bos[0]->handle),
-- 
2.37.3



More information about the igt-dev mailing list