Intel-GFX 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-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH v7 09/11] drm/i915/perf: Add support for OA media units
Date: Sun, 19 Mar 2023 19:06:17 -0700	[thread overview]
Message-ID: <87wn3ctbvq.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <20230317231641.2815418-10-umesh.nerlige.ramappa@intel.com>

On Fri, 17 Mar 2023 16:16:39 -0700, Umesh Nerlige Ramappa wrote:
>

Hi Umesh,

> +static void oa_init_groups(struct intel_gt *gt)
> +{
> +	int i, num_groups = gt->perf.num_perf_groups;
> +
> +	for (i = 0; i < num_groups; i++) {
> +		struct i915_perf_group *g = &gt->perf.group[i];
> +
> +		/* Fused off engines can result in a group with num_engines == 0 */
> +		if (g->num_engines == 0)
> +			continue;
> +
> +		if (i == PERF_GROUP_OAG && gt->type != GT_MEDIA) {
> +			g->regs = __oag_regs();
> +			g->type = TYPE_OAG;
> +		} else if (GRAPHICS_VER_FULL(gt->i915) >= IP_VER(12, 70)) {
> +			g->regs = __oam_regs(mtl_oa_base[i]);
> +			g->type = TYPE_OAM;
> +		}

This if/else statement, rather the whole business of gt->perf.group array
with PERF_GROUP_OAG and PERF_GROUP_OAM_SAMEDIA_0 both having the same value
0 is definitely a little klunky. Not too sure but a idr based approach
might have been cleaner (so not allocate an array at all but just kmalloc
each i915_perf_group entry independently and associate with an idr). It
might also have been good to just drop num_perf_groups for now and use a
value 1 (that is get rid of any num_perf_groups loops) and introduce
num_perf_groups later when we had a platform with num_perf_groups > 1.

Anyway since I said earlier let's keep it, let's do that and merge this
first (there is already too much code here) and revisit afterwards and see
if we can improve anything.

Rest looks good now:

Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>

  reply	other threads:[~2023-03-20  2:06 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-17 23:16 [Intel-gfx] [PATCH v7 00/11] Add OAM support for MTL Umesh Nerlige Ramappa
2023-03-17 23:16 ` [Intel-gfx] [PATCH v7 01/11] drm/i915/perf: Drop wakeref on GuC RC error Umesh Nerlige Ramappa
2023-03-20 10:16   ` Jani Nikula
2023-03-20 19:24     ` Umesh Nerlige Ramappa
2023-03-21  9:59       ` Jani Nikula
2023-03-17 23:16 ` [Intel-gfx] [PATCH v7 02/11] drm/i915/mtl: Synchronize i915/BIOS on C6 enabling Umesh Nerlige Ramappa
2023-03-17 23:16 ` [Intel-gfx] [PATCH v7 03/11] drm/i915/perf: Validate OA sseu config outside switch Umesh Nerlige Ramappa
2023-03-17 23:16 ` [Intel-gfx] [PATCH v7 04/11] drm/i915/perf: Group engines into respective OA groups Umesh Nerlige Ramappa
2023-03-17 23:16 ` [Intel-gfx] [PATCH v7 05/11] drm/i915/perf: Fail modprobe if i915_perf_init fails on OOM Umesh Nerlige Ramappa
2023-03-17 23:16 ` [Intel-gfx] [PATCH v7 06/11] drm/i915/perf: Parse 64bit report header formats correctly Umesh Nerlige Ramappa
2023-03-17 23:16 ` [Intel-gfx] [PATCH v7 07/11] drm/i915/perf: Handle non-power-of-2 reports Umesh Nerlige Ramappa
2023-03-17 23:16 ` [Intel-gfx] [PATCH v7 08/11] drm/i915/perf: Add engine class instance parameters to perf Umesh Nerlige Ramappa
2023-03-17 23:16 ` [Intel-gfx] [PATCH v7 09/11] drm/i915/perf: Add support for OA media units Umesh Nerlige Ramappa
2023-03-20  2:06   ` Dixit, Ashutosh [this message]
2023-03-17 23:16 ` [Intel-gfx] [PATCH v7 10/11] drm/i915/perf: Pass i915 object to perf revision helper Umesh Nerlige Ramappa
2023-03-17 23:16 ` [Intel-gfx] [PATCH v7 11/11] drm/i915/perf: Wa_14017512683: Disable OAM if media C6 is enabled in BIOS Umesh Nerlige Ramappa
2023-03-20  3:56   ` Dixit, Ashutosh
2023-03-21  0:27     ` Umesh Nerlige Ramappa
2023-03-21  0:30       ` Dixit, Ashutosh
2023-03-18  0:10 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Add OAM support for MTL Patchwork
2023-03-18  0:10 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-03-18  0:10 ` [Intel-gfx] ✗ Fi.CI.DOCS: " Patchwork
2023-03-18  0:27 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-03-18  1:35 ` [Intel-gfx] ✓ 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=87wn3ctbvq.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox