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 11/11] drm/i915/perf: Wa_14017512683: Disable OAM if media C6 is enabled in BIOS
Date: Sun, 19 Mar 2023 20:56:00 -0700 [thread overview]
Message-ID: <87v8iwt6sv.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <20230317231641.2815418-12-umesh.nerlige.ramappa@intel.com>
On Fri, 17 Mar 2023 16:16:41 -0700, Umesh Nerlige Ramappa wrote:
>
Hi Umesh,
Please read from bottom to top. Mostly nits but let's see what you think.
> OAM does not work with media C6 enabled on some steppings of MTL.
> Disable OAM if we detect that media C6 was enabled in bios.
>
> v2: (Ashutosh)
> - Remove drm_notice from the driver load path
> - Log a drm_err when opening an OAM stream on affected steppings
>
> Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
> ---
> drivers/gpu/drm/i915/i915_perf.c | 41 ++++++++++++++++++++++++++++++++
> 1 file changed, 41 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
> index 18afa76653b7..823379d63caf 100644
> --- a/drivers/gpu/drm/i915/i915_perf.c
> +++ b/drivers/gpu/drm/i915/i915_perf.c
> @@ -209,6 +209,7 @@
> #include "gt/intel_gt_regs.h"
> #include "gt/intel_lrc.h"
> #include "gt/intel_lrc_reg.h"
> +#include "gt/intel_rc6.h"
> #include "gt/intel_ring.h"
> #include "gt/uc/intel_guc_slpc.h"
>
> @@ -4216,6 +4217,20 @@ static int read_properties_unlocked(struct i915_perf *perf,
> return -EINVAL;
> }
>
> + /*
> + * Wa_14017512683: mtl[a0..c0): Use of OAM must be preceded with Media
> + * C6 disable in BIOS. Fail if Media C6 is enabled on steppings where OAM
> + * does not work as expected.
> + */
> + if (IS_MTL_MEDIA_STEP(props->engine->i915, STEP_A0, STEP_C0) &&
> + props->engine->gt->type == GT_MEDIA &&
Instead of gt type I think it's better to check perf_group->type. That is
why as I said below maybe better to have a valid perf_group even in this
case.
> + intel_check_bios_c6_setup(&props->engine->gt->rc6)) {
> + drm_dbg(&perf->i915->drm,
> + "OAM requires media C6 to be disabled in BIOS\n");
> + return -EINVAL;
> + }
So now we can change this check to something like:
if (engine->perf_group->type == OAM && i915_perf->mtl_bios_mc6_enabled)
> +
> +
> if (!engine_supports_oa(props->engine)) {
> drm_dbg(&perf->i915->drm,
> "Engine not supported by OA %d:%d\n",
> @@ -4897,6 +4912,15 @@ static u32 num_perf_groups_per_gt(struct intel_gt *gt)
>
> static u32 __oam_engine_group(struct intel_engine_cs *engine)
> {
> + /*
> + * Wa_14017512683: mtl[a0..c0): Use of OAM must be preceded with Media
> + * C6 disable in BIOS. To disable use of OAM with media engines, set the
> + * oa_group to PERF_GROUP_INVALID.
> + */
> + if (IS_MTL_MEDIA_STEP(engine->i915, STEP_A0, STEP_C0) &&
> + intel_check_bios_c6_setup(&engine->gt->rc6))
> + return PERF_GROUP_INVALID;
I think we should just remove this. Let the perf group be valid in this
case too since we cannot support OA for a different reason. Then we can use
the OAM perf group above.
Though if we drop this we have only 2 instances of the checks instead of 3
so maybe ok to not have i915_perf->mtl_bios_mc6_enabled?
> +
> if (GRAPHICS_VER_FULL(engine->i915) >= IP_VER(12, 70)) {
> /*
> * There's 1 SAMEDIA gt and 1 OAM per SAMEDIA gt. All media slices
> @@ -5316,6 +5340,23 @@ int i915_perf_ioctl_version(struct drm_i915_private *i915)
> *
> * 7: Add support for video decode and enhancement classes.
> */
> +
> + /*
> + * Wa_14017512683: mtl[a0..c0): Use of OAM must be preceded with Media
> + * C6 disable in BIOS. If Media C6 is enabled in BIOS, return version 6
> + * to indicate that OA media is not supported.
> + */
> + if (IS_MTL_MEDIA_STEP(i915, STEP_A0, STEP_C0)) {
> + struct intel_gt *gt;
> + int i;
> +
> + for_each_gt(gt, i915, i) {
> + if (gt->type == GT_MEDIA &&
> + intel_check_bios_c6_setup(>->rc6))
Rather than repeat this comment and these checks (MTL stepping and
intel_check_bios_c6_setup) 3 times, I think it will be simpler to set a
variable (say i915_perf->mtl_bios_mc6_enabled) in i915_perf_init() and
reuse that in the 3 places.
> + return 6;
> + }
> + }
> +
> return 7;
> }
Thanks.
--
Ashutosh
next prev parent reply other threads:[~2023-03-20 4:01 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
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 [this message]
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=87v8iwt6sv.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.