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 18D3DC74A5B for ; Fri, 17 Mar 2023 06:06:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 064B610E286; Fri, 17 Mar 2023 06:06:17 +0000 (UTC) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7C1A410E096 for ; Fri, 17 Mar 2023 06:06:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679033170; x=1710569170; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=4PGLwOANIdf8IYjG7BZUczbjKpooADnPyyjwK+ZpyL4=; b=iPmRscKkZE2lQgx5mw/cuidYLxzmTq1ZsHR4mBJ4JwlIK2ZNYa2srN1G BZNEM2xs0HiljZHB62uPfsGjp9BKSolQ46SSvwA5rcf5aEoPNQ9i7ukAx TbnIAAO3tztpGtGBsJzAHzflXIU/Z2fsghqCC7beNV5fggwb1qD85rJbc Bz4BiMfUic7EiXr0r91+v+g1FRd3PrU5TX1G9Jw8SoN0X9kv69EalWpvy 6N6FJNEBZswZhce39xYXqF40vY2vs1MaIZFN/diAavHTBVDZT1yoBFpIe l8OSpIY8syWq8nOy25/w0OjMRPgN2yzV+ggb8iXlBFPreTueZja5uG/AD A==; X-IronPort-AV: E=McAfee;i="6600,9927,10651"; a="403063165" X-IronPort-AV: E=Sophos;i="5.98,268,1673942400"; d="scan'208";a="403063165" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Mar 2023 23:06:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10651"; a="790608765" X-IronPort-AV: E=Sophos;i="5.98,268,1673942400"; d="scan'208";a="790608765" 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 23:06:09 -0700 Date: Thu, 16 Mar 2023 23:06:08 -0700 Message-ID: <87cz57x67j.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Umesh Nerlige Ramappa In-Reply-To: <87fsa4vu0j.wl-ashutosh.dixit@intel.com> References: <20230316010101.2590309-1-umesh.nerlige.ramappa@intel.com> <20230316010101.2590309-13-umesh.nerlige.ramappa@intel.com> <87fsa4vu0j.wl-ashutosh.dixit@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 Thu, 16 Mar 2023 22:14:52 -0700, Dixit, Ashutosh wrote: > > 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? Another idea: there is a drm_notice in Patch 2 when C6 is disabled, maybe we could just change it to "C6 disabled by BIOS, OAM availbable\n" or something like that and just remove the notice from here. I think we should avoid the notice when C6 is enabled since that is likely to be the default mode. > > > + 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