[PATCH i-g-t 2/2] tests/intel/xe_exec_compute_mode: Use xe_find_engine_by_class
Zbigniew Kempczyński
zbigniew.kempczynski at intel.com
Tue Oct 22 10:29:51 UTC 2024
On Mon, Oct 21, 2024 at 05:40:57PM +0200, Kamil Konieczny wrote:
> Hi Pravalika,
> On 2024-10-16 at 15:49:33 +0530, Pravalika Gurram wrote:
> > Use 'xe_find_engine_by_class' helper to get the engine info with the
> > required engine class. Stop assuming engine id is equal to 1
> >
> > 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 | 5 ++++-
> > 1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/tests/intel/xe_exec_compute_mode.c b/tests/intel/xe_exec_compute_mode.c
> > index 82e607848..b238503ea 100644
> > --- a/tests/intel/xe_exec_compute_mode.c
> > +++ b/tests/intel/xe_exec_compute_mode.c
> > @@ -461,7 +461,10 @@ static void lr_mode_workload(int fd)
> > 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);
> > +
> > + engine = xe_find_engine_by_class(fd, DRM_XE_ENGINE_CLASS_COPY);
> > + igt_assert(engine);
>
> Instead of igt_assert it could be better to use
> igt_skip_on(!engine, "message...\n")
>
> also move that to begin of this function (before vm_create or other inits)
>
> Regards,
> Kamil
There's no possibility there's no COPY engine. So assert is fine for me
here.
--
Zbigniew
>
> > +
> > 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