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 7FA60C61DA4 for ; Thu, 9 Mar 2023 23:57:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 02A7910E2BD; Thu, 9 Mar 2023 23:57:52 +0000 (UTC) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id CC33710E2BD for ; Thu, 9 Mar 2023 23:57:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678406269; x=1709942269; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=OQ2uYhBl+WI6ZenMtCCQxp5ZMXD0/pZvMxrjRKpZ0OU=; b=GVou8O12KMgVC0MBc6YRIO4QOnmrtonR5bWL+C9JU18X2N8bAl7GZBtg ltHAvgToqWXVtKVlaW27kRrxrDAjAYUq95fdc8jhcZn818AYt02/OXXjN q3W1aAoZB0qxtBnlNHUM/w64j3w3npwD869yXQKBPYZrlYGccbGPAwLUv DNNr1J72ptUvu4ot0/AOp0w6P0fiONZLm7ssK/CTNJ4iUrPn0W75GabsN ueTE17QtVAtKg6mr1b2G8DLahzDDxzB+8q7kkGvXCgvNoN/EWWsAIDmI0 8uH3ZgNscYKcXeAgeCRjt4Iq653vufbJ3Q3W3d1YhCFThQ0W3K5fxY9nN Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10644"; a="399203722" X-IronPort-AV: E=Sophos;i="5.98,248,1673942400"; d="scan'208";a="399203722" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Mar 2023 15:57:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10644"; a="707822224" X-IronPort-AV: E=Sophos;i="5.98,248,1673942400"; d="scan'208";a="707822224" Received: from adixit-mobl.amr.corp.intel.com (HELO adixit-arch.intel.com) ([10.212.215.176]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Mar 2023 15:57:49 -0800 Date: Thu, 09 Mar 2023 15:57:48 -0800 Message-ID: <87a60lmq9v.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Umesh Nerlige Ramappa In-Reply-To: <20230307201611.773103-10-umesh.nerlige.ramappa@intel.com> References: <20230307201611.773103-1-umesh.nerlige.ramappa@intel.com> <20230307201611.773103-10-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 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 Tue, 07 Mar 2023 12:16:11 -0800, Umesh Nerlige Ramappa wrote: > Hi Umesh, > -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_gem_context *ctx, > for_each_gem_engine(ce, i915_gem_context_lock_engines(ctx), it) { > GEM_BUG_ON(ce == ce->engine->kernel_context); > > - if (!engine_supports_oa(ce->engine)) > + if (!engine_supports_oa(ce->engine) || > + ce->engine->class != stream->engine->class) > continue; > > /* Otherwise OA settings will be set upon first use */ > @@ -2704,7 +2726,7 @@ oa_configure_all_contexts(struct i915_perf_stream *stream, > > spin_unlock(&i915->gem.contexts.lock); > > - err = gen8_configure_context(ctx, regs, num_regs); > + err = 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_stream *stream, > for_each_uabi_engine(engine, i915) { > struct intel_context *ce = engine->kernel_context; > > - if (!engine_supports_oa(ce->engine)) > + if (!engine_supports_oa(ce->engine) || > + ce->engine->class != stream->engine->class) > continue; > > regs[0].value = intel_sseu_make_rpcs(engine->gt, &ce->sseu); > @@ -2749,6 +2772,9 @@ gen12_configure_all_contexts(struct i915_perf_stream *stream, > }, > }; > > + if (stream->engine->class != 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. Thanks. -- Ashutosh