All of lore.kernel.org
 help / color / mirror / Atom feed
From: priyanka.dandamudi@intel.com
To: igt-dev@lists.freedesktop.org, arjun.melkaveri@intel.com,
	priyanka.dandamudi@intel.com, ashutosh.dixit@intel.com,
	John.C.Harrison@Intel.com, saurabhg.gupta@intel.com
Subject: [igt-dev] [PATCH i-g-t v2 1/2] lib/igt_gt: Check for shared reset domain
Date: Mon, 10 Jan 2022 11:41:40 +0530	[thread overview]
Message-ID: <20220110061141.1655017-2-priyanka.dandamudi@intel.com> (raw)
In-Reply-To: <20220110061141.1655017-1-priyanka.dandamudi@intel.com>

From: Priyanka Dandamudi <priyanka.dandamudi@intel.com>

Function to check if a platform has shared reset domain.

v2: Some minor fixes (Ashutosh)

Signed-off-by: Priyanka Dandamudi <priyanka.dandamudi@intel.com>
Cc: John Harrison <John.C.Harrison@Intel.com>
Cc: Melkaveri, Arjun <arjun.melkaveri@intel.com>
---
 lib/igt_gt.c | 17 +++++++++++++++++
 lib/igt_gt.h |  2 ++
 2 files changed, 19 insertions(+)

diff --git a/lib/igt_gt.c b/lib/igt_gt.c
index 7c7df95e..daec5c0c 100644
--- a/lib/igt_gt.c
+++ b/lib/igt_gt.c
@@ -637,3 +637,20 @@ int gem_execbuf_flags_to_engine_class(unsigned int flags)
 		igt_assert(0);
 	}
 }
+
+bool has_shared_reset_domain(int fd, const intel_ctx_t *ctx)
+{
+	const struct intel_execution_engine2 *e;
+	bool rcs0 = false;
+	bool ccs0 = false;
+
+	for_each_ctx_engine(fd, ctx, e) {
+		if (rcs0 && ccs0)
+			break;
+		else if (e->class == I915_ENGINE_CLASS_RENDER)
+			rcs0 = true;
+		else if (e->class == I915_ENGINE_CLASS_COMPUTE)
+			ccs0 = true;
+	}
+	return (rcs0 && ccs0);
+}
diff --git a/lib/igt_gt.h b/lib/igt_gt.h
index c5059817..f0340552 100644
--- a/lib/igt_gt.h
+++ b/lib/igt_gt.h
@@ -84,4 +84,6 @@ extern const struct intel_execution_engine2 {
 
 int gem_execbuf_flags_to_engine_class(unsigned int flags);
 
+bool has_shared_reset_domain(int fd, const intel_ctx_t *ctx);
+
 #endif /* IGT_GT_H */
-- 
2.25.1

  reply	other threads:[~2022-01-10  6:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-10  6:11 [igt-dev] [PATCH i-g-t v2 0/2] Shared reset domain priyanka.dandamudi
2022-01-10  6:11 ` priyanka.dandamudi [this message]
2022-01-13 22:14   ` [igt-dev] [PATCH i-g-t v2 1/2] lib/igt_gt: Check for shared " Matt Roper
2022-01-10  6:11 ` [igt-dev] [PATCH i-g-t v2 2/2] tests/i915/gem_ctx_exec: Skip test " priyanka.dandamudi
2022-01-13 22:17   ` Matt Roper
2022-01-10  7:16 ` [igt-dev] ✗ GitLab.Pipeline: warning for Shared reset domain (rev2) Patchwork
2022-01-10  7:20 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2022-01-10  8:37 ` [igt-dev] ✓ Fi.CI.IGT: " 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=20220110061141.1655017-2-priyanka.dandamudi@intel.com \
    --to=priyanka.dandamudi@intel.com \
    --cc=John.C.Harrison@Intel.com \
    --cc=arjun.melkaveri@intel.com \
    --cc=ashutosh.dixit@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=saurabhg.gupta@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.