All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH igt 1/2] lib/igt_aux: Add function to swap int64 in array
@ 2018-02-16 23:20 Chris Wilson
  2018-02-16 23:20 ` [PATCH igt 2/2] tests/gem_ctx_param: Update invalid param Chris Wilson
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Chris Wilson @ 2018-02-16 23:20 UTC (permalink / raw)
  To: intel-gfx

From: Antonio Argenziano <antonio.argenziano@intel.com>

v2: Use igt_swap()

Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Michal Winiarski <michal.winiarski@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 lib/igt_aux.c | 16 ++++++++++++++++
 lib/igt_aux.h |  1 +
 2 files changed, 17 insertions(+)

diff --git a/lib/igt_aux.c b/lib/igt_aux.c
index 8ca0b60d..a23375a4 100644
--- a/lib/igt_aux.c
+++ b/lib/igt_aux.c
@@ -577,6 +577,22 @@ void igt_exchange_int(void *array, unsigned i, unsigned j)
 	int_arr[j] = tmp;
 }
 
+/**
+ * igt_exchange_int64:
+ * @array: pointer to the array of int64_t
+ * @i: first position
+ * @j: second position
+ *
+ * Exchanges the two values at array indices @i and @j. Useful as an exchange
+ * function for igt_permute_array().
+ */
+void igt_exchange_int64(void *array, unsigned i, unsigned j)
+{
+	int64_t *a = array;
+
+	igt_swap(a[i], a[j]);
+}
+
 /**
  * igt_permute_array:
  * @array: pointer to array
diff --git a/lib/igt_aux.h b/lib/igt_aux.h
index f9c75992..43dd15fe 100644
--- a/lib/igt_aux.h
+++ b/lib/igt_aux.h
@@ -118,6 +118,7 @@ bool __igt_sigiter_continue(struct __igt_sigiter *iter, bool interrupt);
 	for (struct timespec t__={}; igt_nsec_elapsed(&t__)>>20 < (t); )
 
 void igt_exchange_int(void *array, unsigned i, unsigned j);
+void igt_exchange_int64(void *array, unsigned i, unsigned j);
 void igt_permute_array(void *array, unsigned size,
 			   void (*exchange_func)(void *array,
 						 unsigned i,
-- 
2.16.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-02-17 10:07 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-16 23:20 [PATCH igt 1/2] lib/igt_aux: Add function to swap int64 in array Chris Wilson
2018-02-16 23:20 ` [PATCH igt 2/2] tests/gem_ctx_param: Update invalid param Chris Wilson
2018-02-17  9:11   ` [PATCH igt] " Chris Wilson
2018-02-17  9:49   ` Chris Wilson
2018-02-17  9:49     ` [Intel-gfx] " Chris Wilson
2018-02-17  0:16 ` ✓ Fi.CI.BAT: success for series starting with [1/2] lib/igt_aux: Add function to swap int64 in array Patchwork
2018-02-17  1:19 ` ✓ Fi.CI.IGT: " Patchwork
2018-02-17  9:43 ` ✗ Fi.CI.BAT: failure for series starting with [1/2] lib/igt_aux: Add function to swap int64 in array (rev2) Patchwork
2018-02-17 10:07 ` [igt-dev] ✗ Fi.CI.BAT: failure for tests/gem_ctx_param: Update invalid param Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.