From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Intel-gfx@lists.freedesktop.org,
Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Subject: [igt-dev] [PATCH i-g-t] lib/i915: Fix test enumeration on legacy kernels
Date: Thu, 23 May 2019 09:39:29 +0100 [thread overview]
Message-ID: <20190523083929.6015-1-tvrtko.ursulin@linux.intel.com> (raw)
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Where engine discovery and context engine map are not supported we must
not call the asserting gem_class_instance_to_eb_flags from the engine
list initalizer. (Since not all engines can be addressed using the legacy
execbuf API.)
Instead extract the code into lower level __gem_class_instance_to_eb_flags
helper which can return errors the caller can manually handle then.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Andi Shyti <andi.shyti@intel.com>
---
lib/i915/gem_engine_topology.c | 17 +++++++++++++----
lib/igt_gt.c | 28 +++++++++++++++++++---------
lib/igt_gt.h | 5 +++++
3 files changed, 37 insertions(+), 13 deletions(-)
diff --git a/lib/i915/gem_engine_topology.c b/lib/i915/gem_engine_topology.c
index d0c8bd5aaeac..1748231a1de0 100644
--- a/lib/i915/gem_engine_topology.c
+++ b/lib/i915/gem_engine_topology.c
@@ -222,15 +222,24 @@ struct intel_engine_data intel_init_engine_list(int fd, uint32_t ctx_id)
__for_each_static_engine(e2) {
struct intel_execution_engine2 *__e2 =
&engine_data.engines[engine_data.nengines];
+ int flags;
+
+ flags = __gem_class_instance_to_eb_flags(fd,
+ e2->class,
+ e2->instance);
+
+ __e2->flags = flags;
if (!igt_only_list_subtests()) {
- __e2->flags = gem_class_instance_to_eb_flags(fd,
- e2->class, e2->instance);
+ /*
+ * Skip engines not suported with legacy
+ * execbuf.
+ */
+ if (flags < 0)
+ continue;
if (!gem_has_ring(fd, __e2->flags))
continue;
- } else {
- __e2->flags = -1; /* 0xfff... */
}
__e2->name = e2->name;
diff --git a/lib/igt_gt.c b/lib/igt_gt.c
index 6b7c037e6d10..1a81a1fb405f 100644
--- a/lib/igt_gt.c
+++ b/lib/igt_gt.c
@@ -611,15 +611,13 @@ int gem_execbuf_flags_to_engine_class(unsigned int flags)
}
}
-unsigned int
-gem_class_instance_to_eb_flags(int gem_fd,
- enum drm_i915_gem_engine_class class,
- unsigned int instance)
+int
+__gem_class_instance_to_eb_flags(int gem_fd,
+ enum drm_i915_gem_engine_class class,
+ unsigned int instance)
{
- if (class != I915_ENGINE_CLASS_VIDEO)
- igt_assert(instance == 0);
- else
- igt_assert(instance >= 0 && instance <= 1);
+ if (instance > 1 || (class != I915_ENGINE_CLASS_VIDEO && instance > 0))
+ return -1;
switch (class) {
case I915_ENGINE_CLASS_RENDER:
@@ -640,10 +638,22 @@ gem_class_instance_to_eb_flags(int gem_fd,
return I915_EXEC_VEBOX;
case I915_ENGINE_CLASS_INVALID:
default:
- igt_assert(0);
+ return -1;
};
}
+unsigned int
+gem_class_instance_to_eb_flags(int gem_fd,
+ enum drm_i915_gem_engine_class class,
+ unsigned int instance)
+{
+ int flags = __gem_class_instance_to_eb_flags(gem_fd, class, instance);
+
+ igt_assert(flags >= 0);
+
+ return flags;
+}
+
bool gem_has_engine(int gem_fd,
enum drm_i915_gem_engine_class class,
unsigned int instance)
diff --git a/lib/igt_gt.h b/lib/igt_gt.h
index 77318e2a82b8..189b9bf70a8b 100644
--- a/lib/igt_gt.h
+++ b/lib/igt_gt.h
@@ -102,6 +102,11 @@ extern const struct intel_execution_engine2 {
int gem_execbuf_flags_to_engine_class(unsigned int flags);
+int
+__gem_class_instance_to_eb_flags(int gem_fd,
+ enum drm_i915_gem_engine_class class,
+ unsigned int instance);
+
unsigned int
gem_class_instance_to_eb_flags(int gem_fd,
enum drm_i915_gem_engine_class class,
--
2.20.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
WARNING: multiple messages have this Message-ID (diff)
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Intel-gfx@lists.freedesktop.org
Subject: [PATCH i-g-t] lib/i915: Fix test enumeration on legacy kernels
Date: Thu, 23 May 2019 09:39:29 +0100 [thread overview]
Message-ID: <20190523083929.6015-1-tvrtko.ursulin@linux.intel.com> (raw)
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Where engine discovery and context engine map are not supported we must
not call the asserting gem_class_instance_to_eb_flags from the engine
list initalizer. (Since not all engines can be addressed using the legacy
execbuf API.)
Instead extract the code into lower level __gem_class_instance_to_eb_flags
helper which can return errors the caller can manually handle then.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Andi Shyti <andi.shyti@intel.com>
---
lib/i915/gem_engine_topology.c | 17 +++++++++++++----
lib/igt_gt.c | 28 +++++++++++++++++++---------
lib/igt_gt.h | 5 +++++
3 files changed, 37 insertions(+), 13 deletions(-)
diff --git a/lib/i915/gem_engine_topology.c b/lib/i915/gem_engine_topology.c
index d0c8bd5aaeac..1748231a1de0 100644
--- a/lib/i915/gem_engine_topology.c
+++ b/lib/i915/gem_engine_topology.c
@@ -222,15 +222,24 @@ struct intel_engine_data intel_init_engine_list(int fd, uint32_t ctx_id)
__for_each_static_engine(e2) {
struct intel_execution_engine2 *__e2 =
&engine_data.engines[engine_data.nengines];
+ int flags;
+
+ flags = __gem_class_instance_to_eb_flags(fd,
+ e2->class,
+ e2->instance);
+
+ __e2->flags = flags;
if (!igt_only_list_subtests()) {
- __e2->flags = gem_class_instance_to_eb_flags(fd,
- e2->class, e2->instance);
+ /*
+ * Skip engines not suported with legacy
+ * execbuf.
+ */
+ if (flags < 0)
+ continue;
if (!gem_has_ring(fd, __e2->flags))
continue;
- } else {
- __e2->flags = -1; /* 0xfff... */
}
__e2->name = e2->name;
diff --git a/lib/igt_gt.c b/lib/igt_gt.c
index 6b7c037e6d10..1a81a1fb405f 100644
--- a/lib/igt_gt.c
+++ b/lib/igt_gt.c
@@ -611,15 +611,13 @@ int gem_execbuf_flags_to_engine_class(unsigned int flags)
}
}
-unsigned int
-gem_class_instance_to_eb_flags(int gem_fd,
- enum drm_i915_gem_engine_class class,
- unsigned int instance)
+int
+__gem_class_instance_to_eb_flags(int gem_fd,
+ enum drm_i915_gem_engine_class class,
+ unsigned int instance)
{
- if (class != I915_ENGINE_CLASS_VIDEO)
- igt_assert(instance == 0);
- else
- igt_assert(instance >= 0 && instance <= 1);
+ if (instance > 1 || (class != I915_ENGINE_CLASS_VIDEO && instance > 0))
+ return -1;
switch (class) {
case I915_ENGINE_CLASS_RENDER:
@@ -640,10 +638,22 @@ gem_class_instance_to_eb_flags(int gem_fd,
return I915_EXEC_VEBOX;
case I915_ENGINE_CLASS_INVALID:
default:
- igt_assert(0);
+ return -1;
};
}
+unsigned int
+gem_class_instance_to_eb_flags(int gem_fd,
+ enum drm_i915_gem_engine_class class,
+ unsigned int instance)
+{
+ int flags = __gem_class_instance_to_eb_flags(gem_fd, class, instance);
+
+ igt_assert(flags >= 0);
+
+ return flags;
+}
+
bool gem_has_engine(int gem_fd,
enum drm_i915_gem_engine_class class,
unsigned int instance)
diff --git a/lib/igt_gt.h b/lib/igt_gt.h
index 77318e2a82b8..189b9bf70a8b 100644
--- a/lib/igt_gt.h
+++ b/lib/igt_gt.h
@@ -102,6 +102,11 @@ extern const struct intel_execution_engine2 {
int gem_execbuf_flags_to_engine_class(unsigned int flags);
+int
+__gem_class_instance_to_eb_flags(int gem_fd,
+ enum drm_i915_gem_engine_class class,
+ unsigned int instance);
+
unsigned int
gem_class_instance_to_eb_flags(int gem_fd,
enum drm_i915_gem_engine_class class,
--
2.20.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next reply other threads:[~2019-05-23 8:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-23 8:39 Tvrtko Ursulin [this message]
2019-05-23 8:39 ` [PATCH i-g-t] lib/i915: Fix test enumeration on legacy kernels Tvrtko Ursulin
2019-05-23 8:52 ` [Intel-gfx] " Andi Shyti
2019-05-23 8:52 ` Andi Shyti
2019-05-23 9:30 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-05-24 5:11 ` [igt-dev] ✗ Fi.CI.IGT: failure " 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=20190523083929.6015-1-tvrtko.ursulin@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=Intel-gfx@lists.freedesktop.org \
--cc=igt-dev@lists.freedesktop.org \
--cc=tvrtko.ursulin@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 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.