[igt-dev] [PATCH] tests/xe: Set syncs pointer in drm_xe_exec correctly

Christoph Manszewski christoph.manszewski at intel.com
Tue Apr 11 13:53:58 UTC 2023


Drop the 'address-of' operator as xe_exec_ioctl expects a pointer
to 'struct drm_xe_sync' array.

Signed-off-by: Christoph Manszewski <christoph.manszewski at intel.com>
---
 tests/xe/xe_dma_buf_sync.c      |  2 +-
 tests/xe/xe_evict.c             |  4 ++--
 tests/xe/xe_exec_balancer.c     |  6 +++---
 tests/xe/xe_exec_basic.c        |  2 +-
 tests/xe/xe_exec_compute_mode.c |  2 +-
 tests/xe/xe_exec_fault_mode.c   |  4 ++--
 tests/xe/xe_exec_reset.c        |  8 ++++----
 tests/xe/xe_exec_threads.c      |  6 +++---
 tests/xe/xe_guc_pc.c            |  2 +-
 tests/xe/xe_pm.c                |  2 +-
 tests/xe/xe_vm.c                | 12 ++++++------
 11 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/tests/xe/xe_dma_buf_sync.c b/tests/xe/xe_dma_buf_sync.c
index 8b97480a..8920b141 100644
--- a/tests/xe/xe_dma_buf_sync.c
+++ b/tests/xe/xe_dma_buf_sync.c
@@ -152,7 +152,7 @@ test_export_dma_buf(struct drm_xe_engine_class_instance *hwe0,
 		};
 		struct drm_xe_exec exec = {
 			.num_batch_buffer = 1,
-			.syncs = to_user_pointer(&sync),
+			.syncs = to_user_pointer(sync),
 		};
 		uint32_t syncobj;
 		int b = 0;
diff --git a/tests/xe/xe_evict.c b/tests/xe/xe_evict.c
index eddbbd6f..5687cce3 100644
--- a/tests/xe/xe_evict.c
+++ b/tests/xe/xe_evict.c
@@ -44,7 +44,7 @@ test_evict(int fd, struct drm_xe_engine_class_instance *eci,
 	struct drm_xe_exec exec = {
 		.num_batch_buffer = 1,
 		.num_syncs = 2,
-		.syncs = to_user_pointer(&sync),
+		.syncs = to_user_pointer(sync),
 	};
 	uint32_t engines[MAX_N_ENGINES];
 	uint32_t syncobjs[MAX_N_ENGINES];
@@ -220,7 +220,7 @@ test_evict_cm(int fd, struct drm_xe_engine_class_instance *eci,
 	struct drm_xe_exec exec = {
 		.num_batch_buffer = 1,
 		.num_syncs = 1,
-		.syncs = to_user_pointer(&sync),
+		.syncs = to_user_pointer(sync),
 	};
 	uint32_t engines[MAX_N_ENGINES];
 	uint32_t *bo;
diff --git a/tests/xe/xe_exec_balancer.c b/tests/xe/xe_exec_balancer.c
index f3341a99..2018c810 100644
--- a/tests/xe/xe_exec_balancer.c
+++ b/tests/xe/xe_exec_balancer.c
@@ -44,7 +44,7 @@ static void test_all_active(int fd, int gt, int class)
 	struct drm_xe_exec exec = {
 		.num_batch_buffer = 1,
 		.num_syncs = 2,
-		.syncs = to_user_pointer(&sync),
+		.syncs = to_user_pointer(sync),
 	};
 	uint32_t engines[MAX_INSTANCE];
 	uint32_t syncobjs[MAX_INSTANCE];
@@ -186,7 +186,7 @@ test_exec(int fd, int gt, int class, int n_engines, int n_execs,
 	};
 	struct drm_xe_exec exec = {
 		.num_syncs = 2,
-		.syncs = to_user_pointer(&sync),
+		.syncs = to_user_pointer(sync),
 	};
 	uint32_t engines[MAX_N_ENGINES];
 	uint32_t syncobjs[MAX_N_ENGINES];
@@ -407,7 +407,7 @@ test_cm(int fd, int gt, int class, int n_engines, int n_execs,
 	struct drm_xe_exec exec = {
 		.num_batch_buffer = 1,
 		.num_syncs = 1,
-		.syncs = to_user_pointer(&sync),
+		.syncs = to_user_pointer(sync),
 	};
 	uint32_t engines[MAX_N_ENGINES];
 	size_t bo_size;
diff --git a/tests/xe/xe_exec_basic.c b/tests/xe/xe_exec_basic.c
index 2a3cebd3..2a176a5b 100644
--- a/tests/xe/xe_exec_basic.c
+++ b/tests/xe/xe_exec_basic.c
@@ -86,7 +86,7 @@ test_exec(int fd, struct drm_xe_engine_class_instance *eci,
 	struct drm_xe_exec exec = {
 		.num_batch_buffer = 1,
 		.num_syncs = 2,
-		.syncs = to_user_pointer(&sync),
+		.syncs = to_user_pointer(sync),
 	};
 	uint64_t addr[MAX_N_ENGINES];
 	uint32_t vm[MAX_N_ENGINES];
diff --git a/tests/xe/xe_exec_compute_mode.c b/tests/xe/xe_exec_compute_mode.c
index 60713a95..68519399 100644
--- a/tests/xe/xe_exec_compute_mode.c
+++ b/tests/xe/xe_exec_compute_mode.c
@@ -98,7 +98,7 @@ test_exec(int fd, struct drm_xe_engine_class_instance *eci,
 	struct drm_xe_exec exec = {
 		.num_batch_buffer = 1,
 		.num_syncs = 1,
-		.syncs = to_user_pointer(&sync),
+		.syncs = to_user_pointer(sync),
 	};
 	uint32_t engines[MAX_N_ENGINES];
 	uint32_t bind_engines[MAX_N_ENGINES];
diff --git a/tests/xe/xe_exec_fault_mode.c b/tests/xe/xe_exec_fault_mode.c
index b5d924a3..a3ab1727 100644
--- a/tests/xe/xe_exec_fault_mode.c
+++ b/tests/xe/xe_exec_fault_mode.c
@@ -118,7 +118,7 @@ test_exec(int fd, struct drm_xe_engine_class_instance *eci,
 	struct drm_xe_exec exec = {
 		.num_batch_buffer = 1,
 		.num_syncs = 1,
-		.syncs = to_user_pointer(&sync),
+		.syncs = to_user_pointer(sync),
 	};
 	uint32_t engines[MAX_N_ENGINES];
 	uint32_t bind_engines[MAX_N_ENGINES];
@@ -360,7 +360,7 @@ test_atomic(int fd, struct drm_xe_engine_class_instance *eci,
 	struct drm_xe_exec exec = {
 		.num_batch_buffer = 1,
 		.num_syncs = 1,
-		.syncs = to_user_pointer(&sync),
+		.syncs = to_user_pointer(sync),
 	};
 	uint32_t engine;
 	size_t bo_size;
diff --git a/tests/xe/xe_exec_reset.c b/tests/xe/xe_exec_reset.c
index 57dc90dd..0d72a3f2 100644
--- a/tests/xe/xe_exec_reset.c
+++ b/tests/xe/xe_exec_reset.c
@@ -38,7 +38,7 @@ static void test_spin(int fd, struct drm_xe_engine_class_instance *eci)
 	struct drm_xe_exec exec = {
 		.num_batch_buffer = 1,
 		.num_syncs = 2,
-		.syncs = to_user_pointer(&sync),
+		.syncs = to_user_pointer(sync),
 	};
 	uint32_t engine;
 	uint32_t syncobj;
@@ -160,7 +160,7 @@ test_balancer(int fd, int gt, int class, int n_engines, int n_execs,
 	};
 	struct drm_xe_exec exec = {
 		.num_syncs = 2,
-		.syncs = to_user_pointer(&sync),
+		.syncs = to_user_pointer(sync),
 	};
 	uint32_t engines[MAX_N_ENGINES];
 	uint32_t syncobjs[MAX_N_ENGINES];
@@ -372,7 +372,7 @@ test_legacy_mode(int fd, struct drm_xe_engine_class_instance *eci,
 	struct drm_xe_exec exec = {
 		.num_batch_buffer = 1,
 		.num_syncs = 2,
-		.syncs = to_user_pointer(&sync),
+		.syncs = to_user_pointer(sync),
 	};
 	uint32_t engines[MAX_N_ENGINES];
 	uint32_t syncobjs[MAX_N_ENGINES];
@@ -549,7 +549,7 @@ test_compute_mode(int fd, struct drm_xe_engine_class_instance *eci,
 	struct drm_xe_exec exec = {
 		.num_batch_buffer = 1,
 		.num_syncs = 1,
-		.syncs = to_user_pointer(&sync),
+		.syncs = to_user_pointer(sync),
 	};
 	uint32_t engines[MAX_N_ENGINES];
 	size_t bo_size;
diff --git a/tests/xe/xe_exec_threads.c b/tests/xe/xe_exec_threads.c
index c34d8aec..3f2c2de9 100644
--- a/tests/xe/xe_exec_threads.c
+++ b/tests/xe/xe_exec_threads.c
@@ -53,7 +53,7 @@ test_balancer(int fd, int gt, uint32_t vm, uint64_t addr, uint64_t userptr,
 	struct drm_xe_sync sync_all[MAX_N_ENGINES];
 	struct drm_xe_exec exec = {
 		.num_syncs = 2,
-		.syncs = to_user_pointer(&sync),
+		.syncs = to_user_pointer(sync),
 	};
 	uint32_t engines[MAX_N_ENGINES];
 	uint32_t syncobjs[MAX_N_ENGINES];
@@ -262,7 +262,7 @@ test_compute_mode(int fd, uint32_t vm, uint64_t addr, uint64_t userptr,
 	struct drm_xe_exec exec = {
 		.num_batch_buffer = 1,
 		.num_syncs = 1,
-		.syncs = to_user_pointer(&sync),
+		.syncs = to_user_pointer(sync),
 	};
 	uint32_t engines[MAX_N_ENGINES];
 	size_t bo_size;
@@ -471,7 +471,7 @@ test_legacy_mode(int fd, uint32_t vm, uint64_t addr, uint64_t userptr,
 	struct drm_xe_exec exec = {
 		.num_batch_buffer = 1,
 		.num_syncs = 2,
-		.syncs = to_user_pointer(&sync),
+		.syncs = to_user_pointer(sync),
 	};
 	uint32_t engines[MAX_N_ENGINES];
 	uint32_t bind_engines[MAX_N_ENGINES];
diff --git a/tests/xe/xe_guc_pc.c b/tests/xe/xe_guc_pc.c
index 39a755d7..5c71ae14 100644
--- a/tests/xe/xe_guc_pc.c
+++ b/tests/xe/xe_guc_pc.c
@@ -42,7 +42,7 @@ static void exec_basic(int fd, struct drm_xe_engine_class_instance *eci,
 	struct drm_xe_exec exec = {
 		.num_batch_buffer = 1,
 		.num_syncs = 2,
-		.syncs = to_user_pointer(&sync),
+		.syncs = to_user_pointer(sync),
 	};
 	uint32_t engines[MAX_N_ENGINES];
 	uint32_t bind_engines[MAX_N_ENGINES];
diff --git a/tests/xe/xe_pm.c b/tests/xe/xe_pm.c
index 23b8246e..44154143 100644
--- a/tests/xe/xe_pm.c
+++ b/tests/xe/xe_pm.c
@@ -216,7 +216,7 @@ test_exec(device_t device, struct drm_xe_engine_class_instance *eci,
 	struct drm_xe_exec exec = {
 		.num_batch_buffer = 1,
 		.num_syncs = 2,
-		.syncs = to_user_pointer(&sync),
+		.syncs = to_user_pointer(sync),
 	};
 	uint32_t engines[MAX_N_ENGINES];
 	uint32_t bind_engines[MAX_N_ENGINES];
diff --git a/tests/xe/xe_vm.c b/tests/xe/xe_vm.c
index c09b9714..d4cec104 100644
--- a/tests/xe/xe_vm.c
+++ b/tests/xe/xe_vm.c
@@ -529,7 +529,7 @@ shared_pte_page(int fd, struct drm_xe_engine_class_instance *eci, int n_bo,
 	struct drm_xe_exec exec = {
 		.num_batch_buffer = 1,
 		.num_syncs = 2,
-		.syncs = to_user_pointer(&sync),
+		.syncs = to_user_pointer(sync),
 	};
 	uint32_t engines[MAX_N_ENGINES];
 	uint32_t syncobjs[MAX_N_ENGINES];
@@ -701,7 +701,7 @@ test_bind_engines_independent(int fd, struct drm_xe_engine_class_instance *eci)
 	struct drm_xe_exec exec = {
 		.num_batch_buffer = 1,
 		.num_syncs = 2,
-		.syncs = to_user_pointer(&sync),
+		.syncs = to_user_pointer(sync),
 	};
 #define N_ENGINES	2
 	uint32_t engines[N_ENGINES];
@@ -857,7 +857,7 @@ test_bind_array(int fd, struct drm_xe_engine_class_instance *eci, int n_execs,
 	};
 	struct drm_xe_exec exec = {
 		.num_batch_buffer = 1,
-		.syncs = to_user_pointer(&sync),
+		.syncs = to_user_pointer(sync),
 	};
 	uint32_t engine, bind_engine = 0;
 #define BIND_ARRAY_MAX_N_EXEC	16
@@ -1029,7 +1029,7 @@ test_large_binds(int fd, struct drm_xe_engine_class_instance *eci,
 	struct drm_xe_exec exec = {
 		.num_batch_buffer = 1,
 		.num_syncs = 2,
-		.syncs = to_user_pointer(&sync),
+		.syncs = to_user_pointer(sync),
 	};
 	uint64_t addr = 0x1ull << 30, base_addr = 0x1ull << 30;
 	uint32_t vm;
@@ -1184,7 +1184,7 @@ static void *hammer_thread(void *tdata)
 	struct drm_xe_exec exec = {
 		.num_batch_buffer = 1,
 		.num_syncs = 1,
-		.syncs = to_user_pointer(&sync),
+		.syncs = to_user_pointer(sync),
 	};
 	struct {
 		uint32_t batch[16];
@@ -1303,7 +1303,7 @@ test_munmap_style_unbind(int fd, struct drm_xe_engine_class_instance *eci,
 	struct drm_xe_exec exec = {
 		.num_batch_buffer = 1,
 		.num_syncs = 2,
-		.syncs = to_user_pointer(&sync),
+		.syncs = to_user_pointer(sync),
 	};
 	uint64_t addr = 0x1a0000, base_addr = 0x1a0000;
 	uint32_t vm;
-- 
2.39.2

---------------------------------------------------------------------
Intel Technology Poland sp. z o.o.
ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.
Spolka oswiadcza, ze posiada status duzego przedsiebiorcy w rozumieniu ustawy z dnia 8 marca 2013 r. o przeciwdzialaniu nadmiernym opoznieniom w transakcjach handlowych.

Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.



More information about the igt-dev mailing list