From: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
To: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH v4 9/9] drm/i915/perf: Add support for OA media units
Date: Fri, 10 Mar 2023 19:13:42 -0800 [thread overview]
Message-ID: <87y1o4kmjd.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <ZAvI1jtFd0ElWVcm@orsosgc001.jf.intel.com>
On Fri, 10 Mar 2023 16:18:30 -0800, Umesh Nerlige Ramappa wrote:
>
> On Fri, Mar 10, 2023 at 09:36:52AM -0800, Dixit, Ashutosh wrote:
> > On Fri, 10 Mar 2023 08:39:27 -0800, Umesh Nerlige Ramappa wrote:
> >>
> >
> > Hi Umesh,
> >
> >> On Thu, Mar 09, 2023 at 03:57:48PM -0800, Dixit, Ashutosh wrote:
> >> > On Tue, 07 Mar 2023 12:16:11 -0800, Umesh Nerlige Ramappa wrote:
> >> >>
> >> >> -static int gen8_configure_context(struct i915_gem_context *ctx,
> >> >> +static int gen8_configure_context(struct i915_perf_stream *stream,
> >> >> + struct i915_gem_context *ctx,
> >> >> struct flex *flex, unsigned int count)
> >> >> {
> >> >> struct i915_gem_engines_iter it;
> >> >> @@ -2573,7 +2594,8 @@ 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 (!engine_supports_oa(ce->engine))
> >> >> + if (!engine_supports_oa(ce->engine) ||
> >> >> + ce->engine->class != stream->engine->class)
> >> >> continue;
> >> >>
> >> >> /* Otherwise OA settings will be set upon first use */
> >> >> @@ -2704,7 +2726,7 @@ oa_configure_all_contexts(struct i915_perf_stream *stream,
> >> >>
> >> >> spin_unlock(&i915->gem.contexts.lock);
> >> >>
> >> >> - err = gen8_configure_context(ctx, regs, num_regs);
> >> >> + err = gen8_configure_context(stream, ctx, regs, num_regs);
> >> >> if (err) {
> >> >> i915_gem_context_put(ctx);
> >> >> return err;
> >> >> @@ -2724,7 +2746,8 @@ oa_configure_all_contexts(struct i915_perf_stream *stream,
> >> >> for_each_uabi_engine(engine, i915) {
> >> >> struct intel_context *ce = engine->kernel_context;
> >> >>
> >> >> - if (!engine_supports_oa(ce->engine))
> >> >> + if (!engine_supports_oa(ce->engine) ||
> >> >> + ce->engine->class != stream->engine->class)
> >> >> continue;
> >> >>
> >> >> regs[0].value = intel_sseu_make_rpcs(engine->gt, &ce->sseu);
> >> >> @@ -2749,6 +2772,9 @@ gen12_configure_all_contexts(struct i915_perf_stream *stream,
> >> >> },
> >> >> };
> >> >>
> >> >> + if (stream->engine->class != RENDER_CLASS)
> >> >> + return 0;
> >> >> +
> >> >> return oa_configure_all_contexts(stream,
> >> >> regs, ARRAY_SIZE(regs),
> >> >> active);
> >> >
> >> > Can you please explain the above changes? Why are we checking for
> >> > engine->class above? Should we be checking for both class and instance? Or
> >> > all engines connected to an OA unit (multiple classes can be connected to
> >> > an OA unit and be different from stream->engine->class, e.g. VDBOX and
> >> > VEBOX)? oa_configure_all_contexts is also called from
> >> > lrc_configure_all_contexts.
>
> This check primarily blocks media engine use cases from entering
> oa_configure_all_contexts().
>
> lrc_configure_all_contexts applies to pre-gen12 only. On pre-gen12,
> engine_supports_oa() should return true only for render.
> >>
> >> Only render (and compute when we support it) have OA specific configuration
> >> in the context image. Media engines do not have any context specific
> >> configurations.
> >
> > Yes I remember you answered this previously too. My question still is why
> > did we make the 2 instances of this change above:
> >
> > From the original code in drm-tip:
> >
> > if (engine->class != RENDER_CLASS)
> > continue;
> >
> > To the final code (changed in two patches):
> >
> > if (!engine_supports_oa(ce->engine) ||
> > ce->engine->class != stream->engine->class)
> > continue;
>
> I think some changes are a result of incrementally supporting compute and
> then media in OA. Since we have not upstreamed the compute support, some
> lines of code remain.
>
> With compute support the "if (engine->class != RENDER_CLASS)" changed to
> "if (!engine_supports_oa(ce->engine)). Later, OAM support brought the other
> condition that checks classes because this code is under
> for_each_uabi_engine(engine, i915). When we run this for an OA use case
> where user has passed rcs0 for ex, it will still iterate over the media
> engines. Since we now support media engines, we should skip them in this
> loop.
> The other question on whether this should be class specific or span
> multiple engines, I have to check that specifically for OAG. Ideally, the
> PWR_CLK_STATE should be configured for all engines that support it (render
> and compute where available), so the above check should be
> if (!engine_supports_oa(ce->engine) ||
> !engine_has_pwr_clk_state(ce->engine))
>
> A jira will help track this and I can address that in a separate
> patch/series if it turns out to be an issue.
OK, this is my last question on this patch, everything else is fine. Since
you will post another version of the series I will review your (hopefully
final) changes about the above segment there and let's go from there.
Thanks.
--
Ashutosh
next prev parent reply other threads:[~2023-03-11 3:13 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 ` [Intel-gfx] [PATCH v4 2/9] drm/i915/perf: Add helper to check supported OA engines Umesh Nerlige Ramappa
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 [this message]
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=87y1o4kmjd.wl-ashutosh.dixit@intel.com \
--to=ashutosh.dixit@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=umesh.nerlige.ramappa@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.