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 378A2C64EC4 for ; Fri, 10 Mar 2023 17:37:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7F3C910E21B; Fri, 10 Mar 2023 17:37:05 +0000 (UTC) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by gabe.freedesktop.org (Postfix) with ESMTPS id E287E10E21B for ; Fri, 10 Mar 2023 17:37:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678469823; x=1710005823; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version:content-transfer-encoding; bh=GItCc3wjZtLNVxZdQmfpHrR556MpaiRLQGBYEZqYSqY=; b=TkwPl/q4r363Iodh8Cwl7gfRvTEdwtQllIPKZud7azqtli6H3EvAgIGc 6SuIx347kJDh4MQjOtlfATGhVVjMknD0prADR7MnUtEh6dmQBXCFrr9E3 EihBKrTO90U4hoPuUrU3CTUyDbD8Ej0MhR8q4WwNIWX/fX9mupjOopjfH fBx3zxGz+zAXPSFfsK2Wu08ZrG+I/ZlZOflz9KcK8y4z4ulA0lfxl1qtt NRq+E2toy4Bx6MnOHsvTS3h1CqpS0wg1g46lkCVxYPRaWNVlAinCycg6c v3cnmMM+eIzaB14WtIOcupUAoC1g7RWD748zZ17bmHKmdt7KAtyyJUXgL Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10645"; a="320633915" X-IronPort-AV: E=Sophos;i="5.98,250,1673942400"; d="scan'208";a="320633915" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Mar 2023 09:37:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10645"; a="671157789" X-IronPort-AV: E=Sophos;i="5.98,250,1673942400"; d="scan'208";a="671157789" Received: from adixit-mobl.amr.corp.intel.com (HELO adixit-arch.intel.com) ([10.209.71.197]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Mar 2023 09:36:57 -0800 Date: Fri, 10 Mar 2023 09:36:52 -0800 Message-ID: <87zg8kld8r.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Umesh Nerlige Ramappa In-Reply-To: References: <20230307201611.773103-1-umesh.nerlige.ramappa@intel.com> <20230307201611.773103-10-umesh.nerlige.ramappa@intel.com> <87a60lmq9v.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 Content-Transfer-Encoding: quoted-printable Subject: Re: [Intel-gfx] [PATCH v4 9/9] drm/i915/perf: Add support for OA media units 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 Fri, 10 Mar 2023 08:39:27 -0800, Umesh Nerlige Ramappa wrote: > Hi Umesh, > On Thu, Mar 09, 2023 at 03:57:48PM -0800, Dixit, Ashutosh wrote: > > On Tue, 07 Mar 2023 12:16:11 -0800, Umesh Nerlige Ramappa wrote: > >> > >> -static int gen8_configure_context(struct i915_gem_context *ctx, > >> +static int gen8_configure_context(struct i915_perf_stream *stream, > >> + struct i915_gem_context *ctx, > >> struct flex *flex, unsigned int count) > >> { > >> struct i915_gem_engines_iter it; > >> @@ -2573,7 +2594,8 @@ static int gen8_configure_context(struct i915_ge= m_context *ctx, > >> for_each_gem_engine(ce, i915_gem_context_lock_engines(ctx), it) { > >> GEM_BUG_ON(ce =3D=3D ce->engine->kernel_context); > >> > >> - if (!engine_supports_oa(ce->engine)) > >> + if (!engine_supports_oa(ce->engine) || > >> + ce->engine->class !=3D stream->engine->class) > >> continue; > >> > >> /* Otherwise OA settings will be set upon first use */ > >> @@ -2704,7 +2726,7 @@ oa_configure_all_contexts(struct i915_perf_strea= m *stream, > >> > >> spin_unlock(&i915->gem.contexts.lock); > >> > >> - err =3D gen8_configure_context(ctx, regs, num_regs); > >> + err =3D gen8_configure_context(stream, ctx, regs, num_regs); > >> if (err) { > >> i915_gem_context_put(ctx); > >> return err; > >> @@ -2724,7 +2746,8 @@ oa_configure_all_contexts(struct i915_perf_strea= m *stream, > >> for_each_uabi_engine(engine, i915) { > >> struct intel_context *ce =3D engine->kernel_context; > >> > >> - if (!engine_supports_oa(ce->engine)) > >> + if (!engine_supports_oa(ce->engine) || > >> + ce->engine->class !=3D stream->engine->class) > >> continue; > >> > >> regs[0].value =3D intel_sseu_make_rpcs(engine->gt, &ce->sseu); > >> @@ -2749,6 +2772,9 @@ gen12_configure_all_contexts(struct i915_perf_st= ream *stream, > >> }, > >> }; > >> > >> + if (stream->engine->class !=3D RENDER_CLASS) > >> + return 0; > >> + > >> return oa_configure_all_contexts(stream, > >> regs, ARRAY_SIZE(regs), > >> active); > > > > Can you please explain the above changes? Why are we checking for > > engine->class above? Should we be checking for both class and instance?= Or > > all engines connected to an OA unit (multiple classes can be connected = to > > an OA unit and be different from stream->engine->class, e.g. VDBOX and > > VEBOX)? oa_configure_all_contexts is also called from > > lrc_configure_all_contexts. > > Only render (and compute when we support it) have OA specific configurati= on > in the context image. Media engines do not have any context specific > configurations. Yes I remember you answered this previously too. My question still is why did we make the 2 instances of this change above: =46rom the original code in drm-tip: if (engine->class !=3D RENDER_CLASS) continue; To the final code (changed in two patches): if (!engine_supports_oa(ce->engine) || ce->engine->class !=3D stream->engine->class) continue; Thanks. -- Ashutosh