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 A16BAECAAD8 for ; Thu, 22 Sep 2022 03:45:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5918310E012; Thu, 22 Sep 2022 03:45:02 +0000 (UTC) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by gabe.freedesktop.org (Postfix) with ESMTPS id 207E010E012 for ; Thu, 22 Sep 2022 03:44:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663818299; x=1695354299; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=OAr+xTTTD0+4Mw1TyHvZnKRe3X6NExzOv8hFCwIHKlw=; b=L47ru1L7xbAovxjG+vRCFMWF1crGjJE0C0PFS3X1Zt/7yt99WrQranWV gIu9h0976KAAhOE/8fJNjuRjD9x366BvtpgUBHSQbxknisQwmPyWkPLDs 4S2d5zDeQoOhVTaUGyf711EZiz7vU5m8yU3zeGSPzX2+G0PTBTN/Lbrir cEI4xqFhl++BEqfp+ofayRbgf3X/SIEns3aNkQOC7SZCOFvpp32PTyIwJ KHR9JJGbZoLvcE6NqYELRKf1qEWaEgMKuKfZPuFIX+Y8HfB526WM0TwW9 hxe2nL1hfsN9RpiwW77vkq31Yjf8fQEvTQrzKQBoJ3FmDfI2Ah1aMqjMX g==; X-IronPort-AV: E=McAfee;i="6500,9779,10477"; a="283238172" X-IronPort-AV: E=Sophos;i="5.93,335,1654585200"; d="scan'208";a="283238172" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Sep 2022 20:44:58 -0700 X-IronPort-AV: E=Sophos;i="5.93,335,1654585200"; d="scan'208";a="723486701" Received: from jrluquin-mobl.amr.corp.intel.com (HELO adixit-arch.intel.com) ([10.212.181.182]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Sep 2022 20:44:57 -0700 Date: Wed, 21 Sep 2022 20:44:57 -0700 Message-ID: <87edw4m5s6.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Umesh Nerlige Ramappa In-Reply-To: <87mtb85cvb.wl-ashutosh.dixit@intel.com> References: <20220823204155.8178-1-umesh.nerlige.ramappa@intel.com> <20220823204155.8178-2-umesh.nerlige.ramappa@intel.com> <87mtb85cvb.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.1 (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 01/19] drm/i915/perf: Fix OA filtering logic for GuC mode 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, 09 Sep 2022 16:47:36 -0700, Dixit, Ashutosh wrote: > > On Tue, 23 Aug 2022 13:41:37 -0700, Umesh Nerlige Ramappa wrote: > > > > +/* > > + * For execlist mode of submission, pick an unused context id > > + * 0 - (NUM_CONTEXT_TAG -1) are used by other contexts > > + * XXX_MAX_CONTEXT_HW_ID is used by idle context > > + * > > + * For GuC mode of submission read context id from the upper dword of the > > + * EXECLIST_STATUS register. > > + */ > > +static int gen12_get_render_context_id(struct i915_perf_stream *stream) > > +{ > > + u32 ctx_id, mask; > > + int ret; > > + > > + if (intel_engine_uses_guc(stream->engine)) { > > + ret = gen12_guc_sw_ctx_id(stream->pinned_ctx, &ctx_id); > > + if (ret) > > + return ret; > > + > > + mask = ((1U << GEN12_GUC_SW_CTX_ID_WIDTH) - 1) << > > + (GEN12_GUC_SW_CTX_ID_SHIFT - 32); > > + } else if (GRAPHICS_VER_FULL(stream->engine->i915) >= IP_VER(12, 50)) { > > + ctx_id = (XEHP_MAX_CONTEXT_HW_ID - 1) << > > + (XEHP_SW_CTX_ID_SHIFT - 32); > > + > > + mask = ((1U << XEHP_SW_CTX_ID_WIDTH) - 1) << > > + (XEHP_SW_CTX_ID_SHIFT - 32); > > + } else { > > + ctx_id = (GEN12_MAX_CONTEXT_HW_ID - 1) << > > + (GEN11_SW_CTX_ID_SHIFT - 32); > > + > > + mask = ((1U << GEN11_SW_CTX_ID_WIDTH) - 1) << > > + (GEN11_SW_CTX_ID_SHIFT - 32); > > Previously I missed that these ctx_id's for non-GuC cases are just > constants. How does it work in these cases? For the record, offline reply from Umesh for this question: Looks like the SW context id is set to a unique value by the KMD for execlist mode here - __execlists_schedule_in() as ccid. Later it is written to the execlist port here (as lrc.desc) - execlists_submit_ports(). It's just a unique value that the kmd determines. For OA we are setting a ce->tag when OA use case is active and it used by the __execlists_schedule_in(). Related commit from Chris - 2935ed5339c49 I think the reason why OA is setting it is because this value is not assigned until __execlists_schedule_in() is called. For OA context, this may happen much later. The code that Chris has added, just assigns a value in OA and then uses it later in the __execlists_schedule_in() path.