All of 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 v4 8/9] drm/i915/perf: Add engine class instance parameters to perf
Date: Tue, 07 Mar 2023 17:45:48 -0800	[thread overview]
Message-ID: <87lek8m2wj.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <20230307201611.773103-9-umesh.nerlige.ramappa@intel.com>

On Tue, 07 Mar 2023 12:16:10 -0800, Umesh Nerlige Ramappa wrote:
>

Hi Umesh,

> +	/* Defaults when class:instance is not passed */
> +	class = I915_ENGINE_CLASS_RENDER;
> +	instance = 0;
> +
>	for (i = 0; i < n_props; i++) {
>		u64 oa_period, oa_freq_hz;
>		u64 id, value;
> @@ -4174,7 +4156,13 @@ static int read_properties_unlocked(struct i915_perf *perf,
>			}
>			props->poll_oa_period = value;
>			break;
> -		case DRM_I915_PERF_PROP_MAX:
> +		case DRM_I915_PERF_PROP_OA_ENGINE_CLASS:
> +			class = (u8)value;
> +			break;
> +		case DRM_I915_PERF_PROP_OA_ENGINE_INSTANCE:
> +			instance = (u8)value;
> +			break;

I am wondering since this is uapi we should make it robust. So if the user
passes either class or instance he must pass both and we should check for
that. If only one is passed we should not implicitly assume the other as we
are doing here (if only instance is passed here we will assume RCS and if
only class is passed we will assume instance 0). I think making this
explicit will avoid confusion later. Thoughts?

> +		default:
>			MISSING_CASE(id);
>			return -EINVAL;
>		}
> @@ -4182,6 +4170,21 @@ static int read_properties_unlocked(struct i915_perf *perf,
>		uprop += 2;
>	}
>
> +	props->engine = intel_engine_lookup_user(perf->i915, class, instance);
> +	if (!props->engine) {
> +		drm_dbg(&perf->i915->drm,
> +			"OA engine class and instance invalid %d:%d\n",
> +			class, instance);
> +		return -EINVAL;
> +	}

Thanks.
--
Ashutosh

  reply	other threads:[~2023-03-08  1:45 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 [this message]
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=87lek8m2wj.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.