[PATCH i-g-t v2 16/66] tests/xe_eudebug: Introduce basic exec_queue testing

Piatkowski, Dominik Karol dominik.karol.piatkowski at intel.com
Thu Aug 1 12:15:03 UTC 2024


Reviewed-by: Dominik Karol Piątkowski <dominik.karol.piatkowski at intel.com>

> -----Original Message-----
> From: Manszewski, Christoph <christoph.manszewski at intel.com>
> Sent: Tuesday, July 30, 2024 1:45 PM
> To: igt-dev at lists.freedesktop.org
> Cc: Kempczynski, Zbigniew <zbigniew.kempczynski at intel.com>; Kamil
> Konieczny <kamil.konieczny at linux.intel.com>; Grzegorzek, Dominik
> <dominik.grzegorzek at intel.com>; Patelczyk, Maciej
> <maciej.patelczyk at intel.com>; Piatkowski, Dominik Karol
> <dominik.karol.piatkowski at intel.com>; Sikora, Pawel
> <pawel.sikora at intel.com>; Hajda, Andrzej <andrzej.hajda at intel.com>;
> Kolanupaka Naveena <kolanupaka.naveena at intel.com>; Kuoppala, Mika
> <mika.kuoppala at intel.com>; Mun, Gwan-gyeong <gwan-
> gyeong.mun at intel.com>
> Subject: [PATCH i-g-t v2 16/66] tests/xe_eudebug: Introduce basic
> exec_queue testing
> 
> From: Dominik Grzegorzek <dominik.grzegorzek at intel.com>
> 
> Exercise events send by the debugger on exec_queue create/destroy.
> 
> Signed-off-by: Dominik Grzegorzek <dominik.grzegorzek at intel.com>
> Cc: Christoph Manszewski <christoph.manszewski at intel.com>
> ---
>  tests/intel/xe_eudebug.c | 64
> +++++++++++++++++++++++++++++++++++++---
>  1 file changed, 60 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/intel/xe_eudebug.c b/tests/intel/xe_eudebug.c index
> d97e7914e..4051eac53 100644
> --- a/tests/intel/xe_eudebug.c
> +++ b/tests/intel/xe_eudebug.c
> @@ -17,13 +17,16 @@
> 
>  #include "igt.h"
>  #include "xe/xe_eudebug.h"
> +#include "xe/xe_query.h"
> 
>  #define CREATE_VMS	(1 << 0)
> +#define CREATE_EXEC_QUEUES	(1 << 1)
>  static void run_basic_client(struct xe_eudebug_client *c)  {
>  	int fd, i;
> 
>  	fd = xe_eudebug_client_open_driver(c);
> +	xe_device_get(fd);
> 
>  	if (c->flags & CREATE_VMS) {
>  		const uint32_t flags[] = {
> @@ -39,6 +42,51 @@ static void run_basic_client(struct xe_eudebug_client
> *c)
>  			xe_eudebug_client_vm_destroy(c, fd, vms[i]);
>  	}
> 
> +	if (c->flags & CREATE_EXEC_QUEUES) {
> +		struct drm_xe_exec_queue_create *create;
> +		struct drm_xe_engine_class_instance *hwe;
> +		struct drm_xe_engine_class_instance bind_sync = {
> +			.engine_class = DRM_XE_ENGINE_CLASS_VM_BIND,
> +			.engine_instance = 0,
> +		};
> +		struct drm_xe_engine_class_instance bind_async = {
> +			.engine_class = DRM_XE_ENGINE_CLASS_VM_BIND,
> +			.engine_instance = 0,
> +		};
> +		uint32_t vm;
> +
> +		create = calloc((xe_number_engines(fd) + 2), sizeof(*create));
> +
> +		vm = xe_eudebug_client_vm_create(c, fd, 0, 0);
> +
> +		i = 0;
> +		xe_for_each_engine(fd, hwe) {
> +			create[i].instances = to_user_pointer(hwe);
> +			create[i].vm_id = vm;
> +			create[i].width = 1;
> +			create[i].num_placements = 1;
> +			xe_eudebug_client_exec_queue_create(c, fd,
> &create[i++]);
> +		}
> +
> +		create[i].instances = to_user_pointer(&bind_sync),
> +		create[i].vm_id = vm;
> +		create[i].width = 1,
> +		create[i].num_placements = 1,
> +		xe_eudebug_client_exec_queue_create(c, fd, &create[i++]);
> +
> +		create[i].instances = to_user_pointer(&bind_async),
> +		create[i].vm_id = vm;
> +		create[i].width = 1,
> +		create[i].num_placements = 1,
> +		xe_eudebug_client_exec_queue_create(c, fd, &create[i]);
> +
> +		for (; i >= 0; i--)
> +			xe_eudebug_client_exec_queue_destroy(c, fd,
> &create[i]);
> +
> +		xe_eudebug_client_vm_destroy(c, fd,  vm);
> +	}
> +
> +	xe_device_put(fd);
>  	xe_eudebug_client_close_driver(c, fd);  }
> 
> @@ -253,11 +301,16 @@ static void test_read_event(int fd)
>   * SUBTEST: multiple-sessions
>   * Description:
>   *	Simultaneously attach many debuggers to many processes.
> - *	Each process opens and closes xe drm client.
> + *	Each process opens and closes xe drm client and creates few
> resources.
>   *
> - * SUBTEST: basic-vms
> + * SUBTEST: basic-%s
>   * Description:
> - *	Attach the debugger to process which creates and destroys a few vms.
> + *	Attach the debugger to process which creates and destroys a few
> %arg[1].
> + *
> + * arg[1]:
> + *
> + * @vms: vms
> + * @exec-queues: exec queues
>   */
> 
>  static void test_basic_sessions(int fd, unsigned int flags, int count) @@ -
> 548,11 +601,14 @@ igt_main
>  		test_basic_sessions(fd, 0, 1);
> 
>  	igt_subtest("multiple-sessions")
> -		test_basic_sessions(fd, CREATE_VMS, 4);
> +		test_basic_sessions(fd, CREATE_VMS |
> CREATE_EXEC_QUEUES, 4);
> 
>  	igt_subtest("basic-vms")
>  		test_basic_sessions(fd, CREATE_VMS, 1);
> 
> +	igt_subtest("basic-exec-queues")
> +		test_basic_sessions(fd, CREATE_EXEC_QUEUES, 1);
> +
>  	igt_subtest("discovery-race")
>  		test_race_discovery(fd, 0, 4);
> 
> --
> 2.34.1



More information about the igt-dev mailing list