Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
To: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [Intel-xe] [PATCH 01/10] drm/xe/oa: Introduce OA uapi
Date: Thu, 31 Aug 2023 18:07:52 -0700	[thread overview]
Message-ID: <87zg26zonr.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <87pm3gs5ni.wl-ashutosh.dixit@intel.com>

On Mon, 21 Aug 2023 09:48:33 -0700, Dixit, Ashutosh wrote:
>

Hi Umesh,

About just the 'enum drm_xe_oa_format' below:

> On Tue, 15 Aug 2023 19:14:40 -0700, Umesh Nerlige Ramappa wrote:
> > On Tue, Aug 15, 2023 at 12:29:59PM -0700, Dixit, Ashutosh wrote:
> > > On Tue, 08 Aug 2023 15:59:24 -0700, Umesh Nerlige Ramappa wrote:
> > >>
> > >> On Mon, Aug 07, 2023 at 06:31:50PM -0700, Ashutosh Dixit wrote:
> > >> > +enum drm_xe_oa_format {
> > >> > +	XE_OA_FORMAT_C4_B8 = 7,
> > >> > +
> > >> > +	/* Gen8+ */
> > >> > +	XE_OA_FORMAT_A12,
> > >> > +	XE_OA_FORMAT_A12_B8_C8,
> > >> > +	XE_OA_FORMAT_A32u40_A4u32_B8_C8,
> > >> > +
> > >> > +	/* DG2 */
> > >> > +	XE_OAR_FORMAT_A32u40_A4u32_B8_C8,
> > >> > +	XE_OA_FORMAT_A24u40_A14u32_B8_C8,
> > >> > +
> > >> > +	/* MTL OAM */
> > >> > +	XE_OAM_FORMAT_MPEC8u64_B8_C8,
> > >> > +	XE_OAM_FORMAT_MPEC8u32_B8_C8,
> > >> > +
> > >> > +	XE_OA_FORMAT_MAX	    /* non-ABI */
> > >> > +};
> > >>
> > >> If we support a query to get the supported OA formats, we can do away with
> > >> this.
> > >
> > > OK, yeah get using user_ext's.
> > >
> > >> Also thinking if we can provide the format definition in such a way
> > >> that UMD can just decode the counters from it with some generic code. That
> > >> way, we don't have to constantly keep updating UMD code for every new
> > >> platforms (may be far-fetched, but could save us a lot of
> > >> time). Thoughts?
> > >
> > > Ok, but I am not sure how to do this.
> >
> > Just a thought, we can ignore that for now.
>
> I am not sure if exposing valid counter_select values has much use since
> userland has metrics files so already knows supported counter_select
> values. How about not exposing anything at all regarding this in xe_drm.h?
> Userland can just send the counter_select values it already knows about and
> XE can just validate these. LNL etc. need a couple of other fields, so we
> can just define the bitfields XE is expecting and have userspace fill these
> in. XE will validate all of these.
>
> I think we need a little bit of encapsulation (provided the OA format) if
> we remove this, but if it causes problems in uapi updates etc. we can
> probably get rid of it.
>
> Again, assuming we'll change the python scripts etc. for this. Maybe we
> /should/ prefer a clean interface to these userspace modifications?

I think instead of including the enum above as we've been doing, it is
possible to describe the formats in terms of a few quantities. Looking at
Bspec, these would be something like:

- Format Type: OAG/OAR/OAC/OAM/PEC
- Counter Select
- Counter Size (LNL+)
- BC Report (LNL+)

So I think from these (together with the platform (MTL/LNL etc.) we can
figure out what the report format (the oa_formats[] array) should be.

So it is possible I think to replace 'enum drm_xe_oa_format' above with a
struct or a bitfield with these quantities.

I think this will be a little more resilient than the enum above, we won't
have to change xe_drm.h each time a new format is introduced. We will only
have to change xe_drm.h when HW format representation in the OACONTROL
register changes basically. So e.g. if we had this struct/bitfield in
i915_drm.h we would have been ok till LNL at which point we'd have to make
some changes (introduce 'Counter Size' and 'BC Report').

So what do you think? Should we switch to this way of getting the formats
through the uapi and discontinue the enum? Or do you just want to see the
patch? Or any other ideas?

Thanks.
--
Ashutosh

  reply	other threads:[~2023-09-01  1:25 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-08  1:31 [Intel-xe] [PATCH 00/10] Add OA functionality to Xe Ashutosh Dixit
2023-08-08  1:31 ` [Intel-xe] [PATCH 01/10] drm/xe/oa: Introduce OA uapi Ashutosh Dixit
2023-08-08 22:59   ` Umesh Nerlige Ramappa
2023-08-15 19:29     ` Dixit, Ashutosh
2023-08-16  2:14       ` Umesh Nerlige Ramappa
2023-08-21 16:48         ` Dixit, Ashutosh
2023-09-01  1:07           ` Dixit, Ashutosh [this message]
2023-08-15 22:03   ` Dixit, Ashutosh
2023-08-16  1:11     ` Umesh Nerlige Ramappa
2023-08-16  1:30       ` Dixit, Ashutosh
2023-08-16  2:21         ` Umesh Nerlige Ramappa
2023-08-16  3:43           ` Dixit, Ashutosh
2023-08-16 19:58             ` Umesh Nerlige Ramappa
2023-08-16 20:38               ` Dixit, Ashutosh
2023-08-16 20:58                 ` Dixit, Ashutosh
2023-08-21  4:48     ` Dixit, Ashutosh
2023-08-22  8:31   ` Francois Dugast
2023-08-31 19:55     ` Rodrigo Vivi
2023-08-31 20:12       ` Dixit, Ashutosh
2023-08-31 20:32         ` Rodrigo Vivi
2023-09-08  4:30       ` Dixit, Ashutosh
2023-08-08  1:31 ` [Intel-xe] [PATCH 02/10] drm/xe/oa: Add OA types Ashutosh Dixit
2023-08-08  1:31 ` [Intel-xe] [PATCH 03/10] drm/xe/oa: Add registers and GPU commands used by OA Ashutosh Dixit
2023-08-22 15:44   ` Umesh Nerlige Ramappa
2023-09-08  4:30     ` Dixit, Ashutosh
2023-08-08  1:31 ` [Intel-xe] [PATCH 04/10] drm/xe/oa: Module init/exit and probe/remove Ashutosh Dixit
2023-08-22 15:52   ` Umesh Nerlige Ramappa
2023-08-23 19:41     ` Umesh Nerlige Ramappa
2023-08-25  4:15       ` Dixit, Ashutosh
2023-08-08  1:31 ` [Intel-xe] [PATCH 05/10] drm/xe/oa: Add/remove config ioctl's Ashutosh Dixit
2023-08-08  1:31 ` [Intel-xe] [PATCH 06/10] drm/xe/oa: Start implementing OA stream open ioctl Ashutosh Dixit
2023-08-23 19:55   ` Umesh Nerlige Ramappa
2023-09-08  4:38     ` Dixit, Ashutosh
2023-08-08  1:31 ` [Intel-xe] [PATCH 07/10] drm/xe/oa: OA stream initialization Ashutosh Dixit
2023-08-08  1:31 ` [Intel-xe] [PATCH 08/10] drm/xe/oa: Expose OA stream fd Ashutosh Dixit
2023-08-08  1:31 ` [Intel-xe] [PATCH 09/10] drm/xe/oa: Read file_operation Ashutosh Dixit
2023-08-23 19:46   ` Umesh Nerlige Ramappa
2023-09-08  4:40     ` Dixit, Ashutosh
2023-08-08  1:31 ` [Intel-xe] [PATCH 10/10] drm/xe/oa: Implement queries Ashutosh Dixit
2023-08-22 15:55   ` Umesh Nerlige Ramappa
2023-08-08  2:04 ` [Intel-xe] ✓ CI.Patch_applied: success for Add OA functionality to Xe (rev3) Patchwork
2023-08-08  2:04 ` [Intel-xe] ✗ CI.checkpatch: warning " Patchwork
2023-08-08  2:05 ` [Intel-xe] ✓ CI.KUnit: success " Patchwork
2023-08-08  2:09 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-08-08  2:10 ` [Intel-xe] ✓ CI.Hooks: " Patchwork
2023-08-08  2:10 ` [Intel-xe] ✗ CI.checksparse: warning " Patchwork
2023-08-08  2:41 ` [Intel-xe] [PATCH 00/10] Add OA functionality to Xe Dixit, Ashutosh
2023-09-01  7:55   ` Lionel Landwerlin
2023-09-08  4:35     ` Dixit, Ashutosh
2023-08-08  2:45 ` [Intel-xe] ✗ CI.BAT: failure for Add OA functionality to Xe (rev3) Patchwork
2023-08-08  5:30 ` [Intel-xe] ✓ CI.Patch_applied: success for Add OA functionality to Xe (rev4) Patchwork
2023-08-08  5:30 ` [Intel-xe] ✗ CI.checkpatch: warning " Patchwork
2023-08-08  5:31 ` [Intel-xe] ✓ CI.KUnit: success " Patchwork
2023-08-08  5:35 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-08-08  5:35 ` [Intel-xe] ✓ CI.Hooks: " Patchwork
2023-08-08  5:36 ` [Intel-xe] ✗ CI.checksparse: warning " Patchwork
2023-08-08  6:10 ` [Intel-xe] ✗ CI.BAT: failure " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2023-07-21  2:28 [Intel-xe] [PATCH v2 00/10] Add OA functionality to Xe Ashutosh Dixit
2023-07-21  2:28 ` [Intel-xe] [PATCH 01/10] drm/xe/oa: Introduce OA uapi Ashutosh Dixit
2023-07-21  0:29 [Intel-xe] [PATCH 00/10] Add OA functionality to Xe Ashutosh Dixit
2023-07-21  0:29 ` [Intel-xe] [PATCH 01/10] drm/xe/oa: Introduce OA uapi Ashutosh Dixit

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=87zg26zonr.wl-ashutosh.dixit@intel.com \
    --to=ashutosh.dixit@intel.com \
    --cc=intel-xe@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox