public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Andi Shyti <andi.shyti@intel.com>
To: IGT dev <igt-dev@lists.freedesktop.org>
Cc: Andi Shyti <andi@etezian.org>
Subject: [igt-dev] [PATCH] lib/i915: gem_engine_topology: get eb flags from engine's coordiantes
Date: Thu, 20 Jun 2019 01:19:11 +0300	[thread overview]
Message-ID: <20190619221911.2684-1-andi.shyti@intel.com> (raw)

The execution buffer flag value has now the engine index as it is
mapped in the context. Retrieve its mapped index from the
class/instance coordinate.

Return -EINVAL if the engine is not mapped in the given context.

Suggested-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Andi Shyti <andi.shyti@intel.com>
Cc: Ramalingam C <ramalingam.c@intel.com>
---
 lib/i915/gem_engine_topology.c | 12 ++++++++++++
 lib/i915/gem_engine_topology.h |  3 +++
 2 files changed, 15 insertions(+)

diff --git a/lib/i915/gem_engine_topology.c b/lib/i915/gem_engine_topology.c
index fdd1b951672b..23208102021f 100644
--- a/lib/i915/gem_engine_topology.c
+++ b/lib/i915/gem_engine_topology.c
@@ -270,6 +270,18 @@ int gem_context_lookup_engine(int fd, uint64_t engine, uint32_t ctx_id,
 	return 0;
 }
 
+int64_t gem_context_get_eb_flags(int fd, uint32_t ctx_id,
+				 int class, int instance)
+{
+	struct intel_execution_engine2 *e;
+
+	for_each_context_engine(fd, ctx_id, e)
+		if (class == e->class && instance == e->instance)
+			return e->flags;
+
+	return -EINVAL;
+}
+
 void gem_context_set_all_engines(int fd, uint32_t ctx)
 {
 	DEFINE_CONTEXT_ENGINES_PARAM(engines, param, ctx, GEM_MAX_ENGINES);
diff --git a/lib/i915/gem_engine_topology.h b/lib/i915/gem_engine_topology.h
index 2415fd1e379b..f575b8968476 100644
--- a/lib/i915/gem_engine_topology.h
+++ b/lib/i915/gem_engine_topology.h
@@ -53,6 +53,9 @@ int gem_context_lookup_engine(int fd, uint64_t engine, uint32_t ctx_id,
 
 void gem_context_set_all_engines(int fd, uint32_t ctx);
 
+int64_t gem_context_get_eb_flags(int fd, uint32_t ctx_id,
+				  int class, int instance);
+
 #define __for_each_static_engine(e__) \
 	for ((e__) = intel_execution_engines2; (e__)->name; (e__)++)
 
-- 
2.20.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

             reply	other threads:[~2019-06-19 22:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-19 22:19 Andi Shyti [this message]
2019-06-19 23:33 ` [igt-dev] ✓ Fi.CI.BAT: success for lib/i915: gem_engine_topology: get eb flags from engine's coordiantes Patchwork
2019-06-20  5:59 ` [igt-dev] [PATCH] " Tvrtko Ursulin
2019-06-20  7:52   ` Andi Shyti
2019-06-20  8:12     ` Tvrtko Ursulin
2019-06-20  8:26       ` Chris Wilson
2019-06-20 14:38 ` [igt-dev] ✓ Fi.CI.IGT: success for " 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=20190619221911.2684-1-andi.shyti@intel.com \
    --to=andi.shyti@intel.com \
    --cc=andi@etezian.org \
    --cc=igt-dev@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