From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E47D7C6FD1D for ; Fri, 17 Mar 2023 05:14:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1F0C010E064; Fri, 17 Mar 2023 05:14:59 +0000 (UTC) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id 328A210E064 for ; Fri, 17 Mar 2023 05:14:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679030094; x=1710566094; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=TQ894GY4TthhrfndU4nUDJ4fUSk85njnO6mxJ58TJ3A=; b=I73E9JmVDcn147rhtLTgHBBioxFKgD4YWW+hgmdbW/z3AwVUwOsACtBx Web1juXTjps6uTTNpTFXkCA22cpm4/DAdCmhVPfnx8UTjrcMO+AYLbPqX SgWIZErMkoLbltFkMTF8N2KbGlDU42wiI95LHcH++Q/TDYnZC0Z3qIY0I n0/qCXwpGz+qzUITOHN+57e6rrjIGA7AscwKmxzj6YXzHCylbjbXUGSq9 7jWJ0F9060PUJLTV/Tq2kyBA5h67cfXMQdpthBMS/kSOfdzB0F01601K1 20sRhg2A8E9d7PJOvSUO7pbKtHRrErlwY/xTS7USJh7bMzQe60M1ADFBK g==; X-IronPort-AV: E=McAfee;i="6600,9927,10651"; a="365879583" X-IronPort-AV: E=Sophos;i="5.98,268,1673942400"; d="scan'208";a="365879583" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Mar 2023 22:14:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10651"; a="790598039" X-IronPort-AV: E=Sophos;i="5.98,267,1673942400"; d="scan'208";a="790598039" Received: from adixit-mobl.amr.corp.intel.com (HELO adixit-arch.intel.com) ([10.209.119.150]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Mar 2023 22:14:53 -0700 Date: Thu, 16 Mar 2023 22:14:52 -0700 Message-ID: <87fsa4vu0j.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Umesh Nerlige Ramappa In-Reply-To: <20230316010101.2590309-13-umesh.nerlige.ramappa@intel.com> References: <20230316010101.2590309-1-umesh.nerlige.ramappa@intel.com> <20230316010101.2590309-13-umesh.nerlige.ramappa@intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Subject: Re: [Intel-gfx] [PATCH v6 12/12] drm/i915/perf: Wa_14017512683: Disable OAM if media C6 is enabled in BIOS X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: intel-gfx@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Wed, 15 Mar 2023 18:01:01 -0700, Umesh Nerlige Ramappa wrote: > Hi Umesh, Mostly looks good but one nit below. > 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. > > Signed-off-by: Umesh Nerlige Ramappa > --- > drivers/gpu/drm/i915/i915_perf.c | 30 ++++++++++++++++++++++++++++++ > 1 file changed, 30 insertions(+) > > diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c > index 77fae3d80128..4ac6535a0356 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" > > @@ -4898,6 +4899,18 @@ 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. Do not enable OA for media classes if MC6 is > + * enabled in BIOS. > + */ > + if (IS_MTL_MEDIA_STEP(engine->i915, STEP_A0, STEP_C0) && > + intel_check_bios_c6_setup(&engine->gt->rc6)) { > + drm_notice_once(&engine->i915->drm, > + "OAM requires media C6 to be disabled in BIOS\n"); I think the typical mode of working with MTL would be to enable C6 unless OA is needed. But this will print out this notice on every MTL system. So IMO we should print this out only when a OAM perf stream is opened and that fails. Though not sure if it's ok to add a line to an already cluttered dmesg? The default console log level is 4 (WARNING) so maybe ok? https://linuxconfig.org/introduction-to-the-linux-kernel-log-levels Though if we fail the opening of an OAM stream we could make it a drm_warn? > + return PERF_GROUP_INVALID; > + } > + > if (GRAPHICS_VER_FULL(engine->i915) >= IP_VER(12, 70)) { > /* > * There's 1 SAMEDIA gt and 1 OAM per SAMEDIA gt. All media slices > @@ -5317,6 +5330,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. Do not enable OA for media classes if MC6 is > + * enabled in BIOS. Maybe add something like "Return version 6 to indicate non-support for OAM." just to make clear. > + */ > + 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)) > + return 6; > + } > + } > + > return 7; > } > > -- > 2.36.1 > Thanks. -- Ashutosh