From: Derek Morton <derek.j.morton@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: daniel.vetter@ffwll.com
Subject: [PATCH i-g-t v3 4/6] igt/gem_ctx_param_basic: Updated to support scheduler priority interface
Date: Thu, 10 Mar 2016 11:03:32 +0000 [thread overview]
Message-ID: <1457607814-18751-5-git-send-email-derek.j.morton@intel.com> (raw)
In-Reply-To: <1457607814-18751-1-git-send-email-derek.j.morton@intel.com>
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 e095c41..9e6337e 100644
--- a/lib/ioctl_wrappers.h
+++ b/lib/ioctl_wrappers.h
@@ -107,6 +107,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);
+ 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;
--
1.9.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-03-10 11:04 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-10 11:03 [PATCH i-g-t v3 0/6] Scheduler tests Derek Morton
2016-03-10 11:03 ` [PATCH i-g-t v3 1/6] ioctl_wrappers: make gem_has_ring non static Derek Morton
2016-03-14 12:29 ` Daniele Ceraolo Spurio
2016-03-29 13:08 ` Morton, Derek J
2016-03-10 11:03 ` [PATCH i-g-t v3 2/6] lib/intel_batchbuffer: Add functions to be used in the scheduler test Derek Morton
2016-03-14 12:16 ` Daniele Ceraolo Spurio
2016-03-29 15:04 ` Morton, Derek J
2016-03-10 11:03 ` [PATCH i-g-t v3 3/6] tests/gem_scheduler: Add gem_scheduler test Derek Morton
2016-03-17 8:49 ` Daniele Ceraolo Spurio
2016-03-17 10:33 ` Daniele Ceraolo Spurio
2016-03-10 11:03 ` Derek Morton [this message]
2016-03-10 11:03 ` [PATCH i-g-t v3 5/6] tests/gem_scheduler: Add subtests to test batch priority behaviour Derek Morton
2016-03-17 8:58 ` Daniele Ceraolo Spurio
2016-03-30 8:19 ` Morton, Derek J
2016-03-10 11:03 ` [PATCH i-g-t v3 6/6] gem_scheduler: Added subtests to test priority bumping Derek Morton
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=1457607814-18751-5-git-send-email-derek.j.morton@intel.com \
--to=derek.j.morton@intel.com \
--cc=daniel.vetter@ffwll.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.