From: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH v4 2/9] drm/i915/perf: Add helper to check supported OA engines
Date: Tue, 7 Mar 2023 12:16:04 -0800 [thread overview]
Message-ID: <20230307201611.773103-3-umesh.nerlige.ramappa@intel.com> (raw)
In-Reply-To: <20230307201611.773103-1-umesh.nerlige.ramappa@intel.com>
With an intention to add more engines that are supported by OA, add
helper to check for supported OA engines.
v2: (Ashutosh)
- Update commit message
- Drop virtual engine check since we support only one render engine
Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
---
drivers/gpu/drm/i915/i915_perf.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
index 283a4a3c6862..b0e1acbe90fc 100644
--- a/drivers/gpu/drm/i915/i915_perf.c
+++ b/drivers/gpu/drm/i915/i915_perf.c
@@ -1570,6 +1570,16 @@ free_noa_wait(struct i915_perf_stream *stream)
i915_vma_unpin_and_release(&stream->noa_wait, 0);
}
+static bool engine_supports_oa(const struct intel_engine_cs *engine)
+{
+ enum intel_platform platform = INTEL_INFO(engine->i915)->platform;
+
+ switch (platform) {
+ default:
+ return engine->class == RENDER_CLASS;
+ }
+}
+
static void i915_oa_stream_destroy(struct i915_perf_stream *stream)
{
struct i915_perf *perf = stream->perf;
@@ -2505,7 +2515,7 @@ static int gen8_configure_context(struct i915_gem_context *ctx,
for_each_gem_engine(ce, i915_gem_context_lock_engines(ctx), it) {
GEM_BUG_ON(ce == ce->engine->kernel_context);
- if (ce->engine->class != RENDER_CLASS)
+ if (!engine_supports_oa(ce->engine))
continue;
/* Otherwise OA settings will be set upon first use */
@@ -2656,7 +2666,7 @@ oa_configure_all_contexts(struct i915_perf_stream *stream,
for_each_uabi_engine(engine, i915) {
struct intel_context *ce = engine->kernel_context;
- if (engine->class != RENDER_CLASS)
+ if (!engine_supports_oa(ce->engine))
continue;
regs[0].value = intel_sseu_make_rpcs(engine->gt, &ce->sseu);
@@ -3369,7 +3379,7 @@ void i915_oa_init_reg_state(const struct intel_context *ce,
{
struct i915_perf_stream *stream;
- if (engine->class != RENDER_CLASS)
+ if (!engine_supports_oa(engine))
return;
/* perf.exclusive_stream serialised by lrc_configure_all_contexts() */
--
2.36.1
next prev parent reply other threads:[~2023-03-07 20:16 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-07 20:16 [Intel-gfx] [PATCH v4 0/9] Add OAM support for MTL Umesh Nerlige Ramappa
2023-03-07 20:16 ` [Intel-gfx] [PATCH v4 1/9] drm/i915/perf: Drop wakeref on GuC RC error Umesh Nerlige Ramappa
2023-03-07 20:16 ` Umesh Nerlige Ramappa [this message]
2023-03-07 20:16 ` [Intel-gfx] [PATCH v4 3/9] drm/i915/perf: Validate OA sseu config outside switch Umesh Nerlige Ramappa
2023-03-07 20:16 ` [Intel-gfx] [PATCH v4 4/9] drm/i915/perf: Group engines into respective OA groups Umesh Nerlige Ramappa
2023-03-07 20:16 ` [Intel-gfx] [PATCH v4 5/9] drm/i915/perf: Fail modprobe if i915_perf_init fails on OOM Umesh Nerlige Ramappa
2023-03-07 20:16 ` [Intel-gfx] [PATCH v4 6/9] drm/i915/perf: Parse 64bit report header formats correctly Umesh Nerlige Ramappa
2023-03-07 20:16 ` [Intel-gfx] [PATCH v4 7/9] drm/i915/perf: Handle non-power-of-2 reports Umesh Nerlige Ramappa
2023-03-07 20:16 ` [Intel-gfx] [PATCH v4 8/9] drm/i915/perf: Add engine class instance parameters to perf Umesh Nerlige Ramappa
2023-03-08 1:45 ` Dixit, Ashutosh
2023-03-09 22:36 ` Umesh Nerlige Ramappa
2023-03-08 18:08 ` Dixit, Ashutosh
2023-03-09 22:34 ` Umesh Nerlige Ramappa
2023-03-10 0:24 ` Dixit, Ashutosh
2023-03-07 20:16 ` [Intel-gfx] [PATCH v4 9/9] drm/i915/perf: Add support for OA media units Umesh Nerlige Ramappa
2023-03-09 23:57 ` Dixit, Ashutosh
2023-03-10 16:39 ` Umesh Nerlige Ramappa
2023-03-10 17:36 ` Dixit, Ashutosh
2023-03-11 0:18 ` Umesh Nerlige Ramappa
2023-03-11 3:13 ` Dixit, Ashutosh
2023-03-14 9:13 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for Add OAM support for MTL 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=20230307201611.773103-3-umesh.nerlige.ramappa@intel.com \
--to=umesh.nerlige.ramappa@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).