[PATCH i-g-t 2/2] tests/intel/xe_exec_compute_mode: LR mode should use command or render
Zbigniew Kempczyński
zbigniew.kempczynski at intel.com
Wed Oct 16 06:24:54 UTC 2024
On Tue, Oct 15, 2024 at 07:48:26PM +0530, Pravalika Gurram wrote:
> Spinner which has to run in LR mode should be
> executed on compute or render command streamer.
> Stop assuming engine id is equal to 1
> and use 'xe_find_engine_by_class'
> helper to find engine by its class.
> use 'xe_find_engine_by_class' with required engine class
> to get the engine info.
>
> Cc: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
> Signed-off-by: Pravalika Gurram <pravalika.gurram at intel.com>
> ---
> tests/intel/xe_exec_compute_mode.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/tests/intel/xe_exec_compute_mode.c b/tests/intel/xe_exec_compute_mode.c
> index 82e607848..f62859689 100644
> --- a/tests/intel/xe_exec_compute_mode.c
> +++ b/tests/intel/xe_exec_compute_mode.c
> @@ -457,11 +457,18 @@ static void lr_mode_workload(int fd)
> uint64_t ahnd;
> uint32_t bo;
> uint32_t ts_1, ts_2;
> + uint32_t num_engines;
>
> vm = xe_vm_create(fd, DRM_XE_VM_CREATE_FLAG_LR_MODE, 0);
> ahnd = intel_allocator_open(fd, 0, INTEL_ALLOCATOR_RELOC);
> bo_size = xe_bb_size(fd, sizeof(*spin));
> - engine = xe_engine(fd, 1);
I've checked this on ADL and for me bcs is fine so I don't think
we should merge this change in this form.
However as engines may be on different indices on different platforms
I would at least pick engine via:
engine = xe_find_engine_by_class(fd, DRM_XE_ENGINE_CLASS_COPY);
We'll avoid issue whereindex for bcs will be different than 1 in this case.
--
Zbigniew
> +
> + num_engines = xe_number_engines(fd);
> + engine = xe_find_engine_by_class(fd, DRM_XE_ENGINE_CLASS_COMPUTE);
> + if (engine == NULL)
> + engine = xe_find_engine_by_class(fd, DRM_XE_ENGINE_CLASS_RENDER);
> + igt_skip_on_f((engine == NULL), "num_engines %d\n", num_engines);
> +
> bo = xe_bo_create(fd, vm, bo_size, vram_if_possible(fd, engine->instance.gt_id), 0);
> spin = xe_bo_map(fd, bo, bo_size);
>
> --
> 2.34.1
>
More information about the igt-dev
mailing list