intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
To: Derek Morton <derek.j.morton@intel.com>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH i-g-t 3/4] igt/gem_ctx_param_basic: Updated to support scheduler priority interface
Date: Wed, 17 Feb 2016 13:03:12 +0000	[thread overview]
Message-ID: <56C46F90.4010100@intel.com> (raw)
In-Reply-To: <1455269934-7586-4-git-send-email-derek.j.morton@intel.com>


On 12/02/16 09:38, Derek Morton wrote:
> From: John Harrison <John.C.Harrison@Intel.com>
>
> The GPU scheduler has added an execution priority level to the context
> object. There is an IOCTL interface to allow user apps/libraries to
> set this priority. This patch updates the context paramter IOCTL test
> to include the new interface.
>
> For: VIZ-1587
> Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
> ---
>   lib/ioctl_wrappers.h        |  1 +
>   tests/gem_ctx_param_basic.c | 34 +++++++++++++++++++++++++++++++++-
>   2 files changed, 34 insertions(+), 1 deletion(-)
>
> diff --git a/lib/ioctl_wrappers.h b/lib/ioctl_wrappers.h
> index 4d913c5..f1ef739 100644
> --- a/lib/ioctl_wrappers.h
> +++ b/lib/ioctl_wrappers.h
> @@ -106,6 +106,7 @@ struct local_i915_gem_context_param {
>   #define LOCAL_CONTEXT_PARAM_BAN_PERIOD	0x1
>   #define LOCAL_CONTEXT_PARAM_NO_ZEROMAP	0x2
>   #define LOCAL_CONTEXT_PARAM_GTT_SIZE	0x3
> +#define LOCAL_CONTEXT_PARAM_PRIORITY	0x4
>   	uint64_t value;
>   };
>   void gem_context_require_ban_period(int fd);
> diff --git a/tests/gem_ctx_param_basic.c b/tests/gem_ctx_param_basic.c
> index b75800c..585a1a8 100644
> --- a/tests/gem_ctx_param_basic.c
> +++ b/tests/gem_ctx_param_basic.c
> @@ -147,10 +147,42 @@ igt_main
>   		TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM);
>   	}
>   
> +	ctx_param.param = LOCAL_CONTEXT_PARAM_PRIORITY;
> +
> +	igt_subtest("priority-root-set") {
> +		ctx_param.context = ctx;
> +		ctx_param.value = 2048;
> +		TEST_FAIL(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM, EINVAL);
> +		ctx_param.value = -2048;
> +		TEST_FAIL(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM, EINVAL);
> +		ctx_param.value = 512;
> +		TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM);
> +		ctx_param.value = -512;
> +		TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM);

in the latest scheduler patchset I've looked at the max and min priority 
values were exported through debugfs via 
i915_scheduler_priority_<min/max>, so instead of using 512 and 2048 as 
valid and invalid priority values we could use the values returned by 
the debugfs forTEST_SUCCESS and the same values +/-1 for TEST_FAIL.

The patch as it is still LGTM, so with or without my suggested change:

Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>

Regards,
Daniele

> +		ctx_param.value = 0;
> +		TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM);
> +	}
> +
> +	igt_subtest("priority-non-root-set") {
> +		igt_fork(child, 1) {
> +			igt_drop_root();
> +
> +			ctx_param.context = ctx;
> +			ctx_param.value = 512;
> +			TEST_FAIL(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM, EPERM);
> +			ctx_param.value = -512;
> +			TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM);
> +			ctx_param.value = 0;
> +			TEST_SUCCESS(LOCAL_IOCTL_I915_GEM_CONTEXT_SETPARAM);
> +		}
> +
> +		igt_waitchildren();
> +	}
> +
>   	/* NOTE: This testcase intentionally tests for the next free parameter
>   	 * to catch ABI extensions. Don't "fix" this testcase without adding all
>   	 * the tests for the new param first. */
> -	ctx_param.param = LOCAL_CONTEXT_PARAM_GTT_SIZE + 1;
> +	ctx_param.param = LOCAL_CONTEXT_PARAM_PRIORITY + 1;
>   
>   	igt_subtest("invalid-param-get") {
>   		ctx_param.context = ctx;

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-02-17 13:03 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-12  9:38 [PATCH i-g-t 0/4] Scheduler tests Derek Morton
2016-02-12  9:38 ` [PATCH i-g-t 1/4] lib/igt_bb_factory: Add igt_bb_factory library Derek Morton
2016-02-16 15:54   ` Daniel Vetter
2016-02-17  9:48   ` Daniele Ceraolo Spurio
2016-03-01 10:30     ` Morton, Derek J
2016-03-02 18:08       ` Morton, Derek J
2016-03-03 18:54         ` Dave Gordon
2016-02-12  9:38 ` [PATCH i-g-t 2/4] tests/gem_scheduler: Add gem_scheduler test Derek Morton
2016-02-17 12:37   ` Daniele Ceraolo Spurio
2016-03-01 15:49     ` Morton, Derek J
2016-02-12  9:38 ` [PATCH i-g-t 3/4] igt/gem_ctx_param_basic: Updated to support scheduler priority interface Derek Morton
2016-02-17 13:03   ` Daniele Ceraolo Spurio [this message]
2016-02-12  9:38 ` [PATCH i-g-t 4/4] tests/gem_scheduler: Add subtests to test batch priority behaviour Derek Morton
2016-02-17 13:09   ` Daniele Ceraolo Spurio
2016-03-02  9:52     ` Morton, Derek J

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=56C46F90.4010100@intel.com \
    --to=daniele.ceraolospurio@intel.com \
    --cc=derek.j.morton@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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;
as well as URLs for NNTP newsgroup(s).