[igt-dev] [PATCH i-g-t 5/5] RFC: tests/intel/xe_create: example for useing macro for multi-gpu testing
Kamil Konieczny
kamil.konieczny at linux.intel.com
Fri Oct 13 18:57:32 UTC 2023
Sample code extends existing create-massive-size subtest to run
on multi-GPUs boards with the help of new functions and macros,
this should work without --drivers or IGT_DRIVERS options
but have some limitations that it will not display opened device
at proper child.
Cc: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
Signed-off-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>
---
tests/intel/xe_create.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/tests/intel/xe_create.c b/tests/intel/xe_create.c
index 8d845e5c8..0ea890467 100644
--- a/tests/intel/xe_create.c
+++ b/tests/intel/xe_create.c
@@ -12,6 +12,8 @@
#include <string.h>
#include "igt.h"
+#include "igt_device_scan.h"
+#include "lib/i915/gem_multigpu.c"
#include "xe_drm.h"
#include "xe/xe_ioctl.h"
#include "xe/xe_query.h"
@@ -191,6 +193,13 @@ static void create_execqueues(int fd, enum exec_queue_destroy ed)
* Test category: functionality test
* Description: Verifies xe bo create returns expected error code on massive
* buffer sizes.
+ *
+ * SUBTEST: multigpu-create-massive-size
+ * Functionality: ioctl
+ * Test category: functionality test
+ * Feature: multigpu
+ * Description: Verifies xe bo create with massive buffer sizes runs correctly
+ * on two or more GPUs.
*/
static void create_massive_size(int fd)
{
@@ -228,6 +237,17 @@ igt_main
create_massive_size(xe);
}
+ igt_subtest("multigpu-create-massive-size") {
+ int gpu_count = gem_multigpu_count_class(DRIVER_XE);
+
+ igt_require(xe > 0);
+ igt_require(gpu_count >= 2);
+ igt_multi_fork_foreach_gpu(gpu_fd, DRIVER_XE)
+ create_massive_size(gpu_fd);
+
+ igt_waitchildren();
+ }
+
igt_fixture
drm_close_driver(xe);
}
--
2.42.0
More information about the igt-dev
mailing list