Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Brost <matthew.brost@intel.com>
To: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH 1/2 i-g-t] tests/intel/xe_engine_property: Add engine set property tests
Date: Thu, 9 Nov 2023 09:18:24 +0000	[thread overview]
Message-ID: <ZUyj4AgzeobrFCuE@DUT025-TGLU.fm.intel.com> (raw)
In-Reply-To: <20231109160710.6tfhmeqpvhwu7o7z@kamilkon-desk.igk.intel.com>

On Thu, Nov 09, 2023 at 05:07:10PM +0100, Kamil Konieczny wrote:
> Hi Priyanka,
> 
> On 2023-11-09 at 20:43:46 +0530, priyanka.dandamudi@intel.com wrote:
> > From: Priyanka Dandamudi <priyanka.dandamudi@intel.com>
> > 
> > Added tests to check engine set properties.

s/engine/exec_queue

> > It tests basic positive and invalid values for priority and persistence.
> > 
> > Cc: Janga Rahul Kumar <janga.rahul.kumar@intel.com>
> > Signed-off-by: Priyanka Dandamudi <priyanka.dandamudi@intel.com>
> > ---
> >  tests/intel/xe_engine_property.c | 102 +++++++++++++++++++++++++++++++

s/xe_engine_property/xe_exec_queue_property/

Matt

> >  tests/meson.build                |   1 +
> >  2 files changed, 103 insertions(+)
> >  create mode 100644 tests/intel/xe_engine_property.c
> > 
> > diff --git a/tests/intel/xe_engine_property.c b/tests/intel/xe_engine_property.c
> > new file mode 100644
> > index 000000000..18e050f96
> > --- /dev/null
> > +++ b/tests/intel/xe_engine_property.c
> > @@ -0,0 +1,102 @@
> > +// SPDX-License-Identifier: MIT
> > +/*
> > + * Copyright © 2023 Intel Corporation
> > + */
> > +
> > +/**
> > + * TEST: Basic tests to check engine set property functionality
> > + * Category: Software building block
> > + * Run type: FULL
> ----- ^^^^^^^^^^^^^^
> No need for specifing this anymore.
> 
> > + * Sub-category: engine property
> > + * Functionality: engine set property
> > + * Test category: functionality test
> > + * SUBTEST: priority-set-property
> > + * Description: tests basic priority property by setting invalid values and positive values.
> > + * SUBTEST: persistence-set-property
> > + * Description: tests basic persistence property by setting positive values
> > + */
> > +
> > +#include <dirent.h>
> > +#include <fcntl.h>
> > +#include <string.h>
> > +#include <sys/stat.h>
> > +#include <sys/types.h>
> > +
> > +#include "igt.h"
> > +#include "xe_drm.h"
> ------------ ^^^^
> Move this after "lib/..."
> 
> Regards,
> Kamil
> 
> > +#include "lib/igt_syncobj.h"
> > +#include "lib/intel_reg.h"
> > +#include "xe/xe_ioctl.h"
> > +#include "xe/xe_query.h"
> > +
> > +#define DRM_SCHED_PRIORITY_HIGH  2
> > +#define DRM_SCHED_PRIORITY_NORMAL 1
> > +
> > +static void test_set_property(int xe, int property_name,
> > +			      int property_value, int err_val)
> > +{
> > +	struct drm_xe_engine_class_instance instance = {
> > +			.engine_class = DRM_XE_ENGINE_CLASS_VM_BIND_SYNC,
> > +	};
> > +	struct drm_xe_ext_set_property ext = {
> > +		.base.next_extension = 0,
> > +		.base.name = XE_EXEC_QUEUE_EXTENSION_SET_PROPERTY,
> > +		.property = property_name,
> > +		.value = property_value,
> > +	};
> > +
> > +	struct drm_xe_exec_queue_create create = {
> > +		.extensions = to_user_pointer(&ext),
> > +		.width = 1,
> > +		.num_placements = 1,
> > +		.instances = to_user_pointer(&instance),
> > +		.vm_id = xe_vm_create(xe, 0, 0),
> > +	};
> > +	int ret = 0;
> > +
> > +	if (igt_ioctl(xe, DRM_IOCTL_XE_EXEC_QUEUE_CREATE, &create)) {
> > +		ret = -errno;
> > +		errno = 0;
> > +	}
> > +	igt_assert_eq(ret, err_val);
> > +}
> > +
> > +igt_main
> > +{
> > +	int xe;
> > +
> > +	igt_fixture {
> > +		xe = drm_open_driver(DRIVER_XE);
> > +	}
> > +
> > +	igt_subtest("priority-set-property") {
> > +		/* Tests priority property by setting positive values. */
> > +		test_set_property(xe, XE_EXEC_QUEUE_SET_PROPERTY_PRIORITY,
> > +				  DRM_SCHED_PRIORITY_NORMAL, 0);
> > +
> > +		/* Tests priority property by setting invalid value. */
> > +		test_set_property(xe, XE_EXEC_QUEUE_SET_PROPERTY_PRIORITY,
> > +				  DRM_SCHED_PRIORITY_HIGH + 1, -EINVAL);
> > +		igt_fork(child, 1) {
> > +			igt_drop_root();
> > +
> > +			/* Tests priority property by dropping root permissions. */
> > +			test_set_property(xe, XE_EXEC_QUEUE_SET_PROPERTY_PRIORITY,
> > +					  DRM_SCHED_PRIORITY_HIGH, -EPERM);
> > +			test_set_property(xe, XE_EXEC_QUEUE_SET_PROPERTY_PRIORITY,
> > +					  DRM_SCHED_PRIORITY_NORMAL, 0);
> > +		}
> > +		igt_waitchildren();
> > +	}
> > +
> > +	igt_subtest("persistence-set-property") {
> > +		/* Tests persistence property by setting positive values. */
> > +		test_set_property(xe, XE_EXEC_QUEUE_SET_PROPERTY_PERSISTENCE, 1, 0);
> > +
> > +	}
> > +
> > +	igt_fixture {
> > +		xe_device_put(xe);
> > +		drm_close_driver(xe);
> > +	}
> > +}
> > diff --git a/tests/meson.build b/tests/meson.build
> > index 62721157d..1b7cd6544 100644
> > --- a/tests/meson.build
> > +++ b/tests/meson.build
> > @@ -281,6 +281,7 @@ intel_xe_progs = [
> >  	'xe_dma_buf_sync',
> >  	'xe_debugfs',
> >  	'xe_drm_fdinfo',
> > +	'xe_engine_property',
> >  	'xe_evict',
> >  	'xe_evict_ccs',
> >  	'xe_exec_balancer',
> > -- 
> > 2.25.1
> > 

  reply	other threads:[~2023-11-09 16:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-09 15:13 [igt-dev] [PATCH 0/2 i-g-t] Tests for engine set property priyanka.dandamudi
2023-11-09 15:13 ` [igt-dev] [PATCH 1/2 i-g-t] tests/intel/xe_engine_property: Add engine set property tests priyanka.dandamudi
2023-11-09 16:07   ` Kamil Konieczny
2023-11-09  9:18     ` Matthew Brost [this message]
2023-11-09 15:13 ` [igt-dev] [PATCH 2/2 i-g-t] tests/intel/xe_engine_property: Add scheduler engine set property priyanka.dandamudi
2023-11-09 20:25   ` Kumar, Janga Rahul
2023-11-09 18:04 ` [igt-dev] ✗ Fi.CI.BAT: failure for Tests for " Patchwork
2023-11-09 19:09 ` [igt-dev] ✗ CI.xeBAT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZUyj4AgzeobrFCuE@DUT025-TGLU.fm.intel.com \
    --to=matthew.brost@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=kamil.konieczny@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox