dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Robert Bragg <robert@sixbynine.org>
To: Matthew Auld <matthew.william.auld@gmail.com>
Cc: ML dri-devel <dri-devel@lists.freedesktop.org>,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
	Sourab Gupta <sourab.gupta@intel.com>,
	Daniel Vetter <daniel.vetter@intel.com>
Subject: Re: [PATCH v7 06/11] drm/i915: Enable i915 perf stream for Haswell OA unit
Date: Wed, 26 Oct 2016 22:53:18 +0100	[thread overview]
Message-ID: <CAMou1-0yDeYFgstiM-h7pROxOJ0XTEn2=CwLQ8nUdFZ6h-RF-w@mail.gmail.com> (raw)
In-Reply-To: <CAMou1-1=shpCAFa1-j5XnPjTRZpQveh5smEow4vnWQ48damRbw@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 4784 bytes --]

On Wed, Oct 26, 2016 at 4:03 PM, Robert Bragg <robert.bragg@gmail.com>
wrote:

> On 26 Oct 2016 11:08 a.m., "Matthew Auld" <matthew.william.auld@gmail.com>
> wrote:
> >
> > On 26 October 2016 at 00:51, Robert Bragg <robert@sixbynine.org> wrote:
> > >
> > >
> > > On Tue, Oct 25, 2016 at 10:35 PM, Matthew Auld
> > > <matthew.william.auld@gmail.com> wrote:
> > >>
> > >> On 25 October 2016 at 00:19, Robert Bragg <robert@sixbynine.org>
> wrote:
> > >
> > >
> > >>
> > >>
> > >> > diff --git a/drivers/gpu/drm/i915/i915_drv.h
> > >> > b/drivers/gpu/drm/i915/i915_drv.h
> > >> > index 3448d05..ea24814 100644
> > >> > --- a/drivers/gpu/drm/i915/i915_drv.h
> > >> > +++ b/drivers/gpu/drm/i915/i915_drv.h
> > >> > @@ -1764,6 +1764,11 @@ struct intel_wm_config {
> > >>
> > >> >
> > >> >  struct drm_i915_private {
> > >> > @@ -2149,16 +2164,46 @@ struct drm_i915_private {
> > >> >
> > >> >         struct {
> > >> >                 bool initialized;
> > >> > +
> > >> >                 struct mutex lock;
> > >> >                 struct list_head streams;
> > >> >
> > >> > +               spinlock_t hook_lock;
> > >> > +
> > >> >                 struct {
> > >> > -                       u32 metrics_set;
> > >> > +                       struct i915_perf_stream *exclusive_stream;
> > >> > +
> > >> > +                       u32 specific_ctx_id;
> > >> Can we just get rid of this, now that the vma remains pinned we can
> > >> simply get the ggtt address at the time of configuring the OA_CONTROL
> > >> register ?
> > >
> > >
> > > I considered that, but would ideally prefer to keep it considering the
> gen8+
> > > patches to come. For gen8+ (with execlists) the context ID isn't a gtt
> > > offset.
> > >
> > >>
> > >>
> > >> > +
> > >> > +                       struct hrtimer poll_check_timer;
> > >> > +                       wait_queue_head_t poll_wq;
> > >> > +                       atomic_t pollin;
> > >> > +
> > >>
> > >
> > >>
> > >> > +/* The maximum exponent the hardware accepts is 63 (essentially it
> > >> > selects one
> > >> > + * of the 64bit timestamp bits to trigger reports from) but there's
> > >> > currently
> > >> > + * no known use case for sampling as infrequently as once per 47
> > >> > thousand years.
> > >> > + *
> > >> > + * Since the timestamps included in OA reports are only 32bits it
> seems
> > >> > + * reasonable to limit the OA exponent where it's still possible to
> > >> > account for
> > >> > + * overflow in OA report timestamps.
> > >> > + */
> > >> > +#define OA_EXPONENT_MAX 31
> > >> > +
> > >> > +#define INVALID_CTX_ID 0xffffffff
> > >> We shouldn't need this anymore.
> > >
> > >
> > > yeah I removed it and then added it back, just for the sake of
> explicitly
> > > setting the specific_ctx_id to an invalid ID when closing the exclusive
> > > stream - though resetting the value isn't strictly necessary.
> > Can we not make the specific_ctx_id per-stream, the gem context
> > already is, then we don't need to be concerned with resetting it ?
>
> Hmm, I'm not sure about that, conceptually to me it's global OA unit state.
>
> Currently the driver only supports a single exclusive stream, while Sourab
> later relaxes that to a per-engine stream and that could be relaxed further
> with non-oa metric stream types.
>
> With multiple streams we'll still only be able to programmer a single ctx
> id in oacontol.
>
> Conceptually to me, other stream types could be associated with different
> contexts (if they don't depend on the OA unit) so to me stream->ctx isn't
> necessarily OA unit state.
>
> It probably could be played around with, but right now we don't track OA
> specific state in the stream. For the ID it's just semantics to say it's OA
> state, and we could consider that it's maybe generally useful to track the
> ID, even for future non-oa streams. That might mean potentially redundantly
> pinning state for the sake of tracking the ID for streams that don't end up
> needing it.
>

I started to try out moving the specific_ctx_id and vma pointer (new) to
the stream, and also looked at initializing them together with the
stream->ctx reference, but I'm not really happy with how it's looking.

The specific_ctx_id and pinning are only for the render context, since the
OA unit is only well integrated with the render engine, which makes me more
inclined to consider them OA stream specific, not something we want/need
for all streams (considering that Sourab enables multiple streams in his
series).

Btw, for reference, my patches for gen8+ can also end up making use of the
INVALID_CTX_ID define (when overwriting the undefined ctx_id field in HW
reports when the report's ctx-id is flagged as invalid by the OA unit.) so
we maybe don't want to worry to much about removing the need for it here.

- Robert

[-- Attachment #1.2: Type: text/html, Size: 6777 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2016-10-26 21:53 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-24 23:19 [PATCH v7 00/11] Enable i915 perf stream for Haswell OA unit Robert Bragg
2016-10-24 23:19 ` [PATCH v7 01/11] drm/i915: Add i915 perf infrastructure Robert Bragg
2016-10-25 15:58   ` Matthew Auld
2016-10-24 23:19 ` [PATCH v7 02/11] drm/i915: rename OACONTROL GEN7_OACONTROL Robert Bragg
2016-10-24 23:19 ` [PATCH v7 03/11] drm/i915: return EACCES for check_cmd() failures Robert Bragg
2016-10-25 21:53   ` Matthew Auld
2016-10-24 23:19 ` [PATCH v7 04/11] drm/i915: don't whitelist oacontrol in cmd parser Robert Bragg
2016-10-25 22:02   ` Matthew Auld
2016-10-24 23:19 ` [PATCH v7 05/11] drm/i915: Add 'render basic' Haswell OA unit config Robert Bragg
2016-10-24 23:19 ` [PATCH v7 06/11] drm/i915: Enable i915 perf stream for Haswell OA unit Robert Bragg
2016-10-25 21:35   ` Matthew Auld
2016-10-25 23:51     ` Robert Bragg
2016-10-26  8:54       ` Chris Wilson
2016-10-26 15:17         ` Robert Bragg
2016-10-26 15:37           ` [Intel-gfx] " Ville Syrjälä
2016-10-26 16:42             ` Robert Bragg
2016-10-26 16:52               ` Daniel Vetter
2016-10-26 16:54               ` [Intel-gfx] " Ville Syrjälä
     [not found]                 ` <CAMou1-2j1FTGSCGh=0nq3BokVNe2U308M4STK-G6iz5-n5Gtfg@mail.gmail.com>
2016-10-26 18:53                   ` Robert Bragg
2016-10-26 10:08       ` Matthew Auld
2016-10-26 15:03         ` Robert Bragg
2016-10-26 21:53           ` Robert Bragg [this message]
2016-10-25 23:05   ` Chris Wilson
2016-10-25 23:12     ` Chris Wilson
2016-10-24 23:19 ` [PATCH v7 07/11] drm/i915: advertise available metrics via sysfs Robert Bragg
2016-10-24 23:19 ` [PATCH v7 08/11] drm/i915: Add dev.i915.perf_stream_paranoid sysctl option Robert Bragg
2016-10-24 23:19 ` [PATCH v7 09/11] drm/i915: add oa_event_min_timer_exponent sysctl Robert Bragg
2016-10-24 23:19 ` [PATCH v7 10/11] drm/i915: Add more Haswell OA metric sets Robert Bragg
2016-10-24 23:19 ` [PATCH v7 11/11] drm/i915: Add a kerneldoc summary for i915_perf.c Robert Bragg

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='CAMou1-0yDeYFgstiM-h7pROxOJ0XTEn2=CwLQ8nUdFZ6h-RF-w@mail.gmail.com' \
    --to=robert@sixbynine.org \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=matthew.william.auld@gmail.com \
    --cc=sourab.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 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).