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 BF5A4E7C4CE for ; Wed, 4 Oct 2023 15:22:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8834310E14E; Wed, 4 Oct 2023 15:22:40 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by gabe.freedesktop.org (Postfix) with ESMTPS id CDE0910E14E for ; Wed, 4 Oct 2023 15:22:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696432959; x=1727968959; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=fpwx2aJ9qMYO3YJxsAT74RL0vK/P5WchDVunZFwo9+w=; b=Qoe839wXt/OLrkSluGS2glIRQJEJsvpgc8jgwboHbcJXguAnQulVWtUj OG6m/ytqefldNc7DymsUcbu6O78+063kUsCU0dq8gCXSo8dlBmNKUPRJx ftjf9xhKeTbIJ0cwmqm0IiDx9M+JoaKJQH+8C/eefREa/bYZRu0R6FPbn vwEmddyM3HerjkPplzTTyTrYwQNKxZxOU7EMBjQdmzHx/GkNLWwSK2FZb uVtOTys5hrLCrbI7dpe+YdwKAw4n/pyemrMaTLkvVGrIojn7WVof19hEh XWzZ2fif1+U75Xzs3qMsoTcbp6Ub6mr9bkkrU5ZzR7GBehVsmyWRaGx+J g==; X-IronPort-AV: E=McAfee;i="6600,9927,10853"; a="4763414" X-IronPort-AV: E=Sophos;i="6.03,200,1694761200"; d="scan'208";a="4763414" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Oct 2023 08:22:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10853"; a="867427931" X-IronPort-AV: E=Sophos;i="6.03,200,1694761200"; d="scan'208";a="867427931" Received: from adixit-mobl.amr.corp.intel.com (HELO adixit-arch.intel.com) ([10.209.101.181]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Oct 2023 08:22:37 -0700 Date: Wed, 04 Oct 2023 08:22:36 -0700 Message-ID: <87wmw21kg3.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: intel-xe@lists.freedesktop.org In-Reply-To: <20230919161049.2307855-8-ashutosh.dixit@intel.com> References: <20230919161049.2307855-1-ashutosh.dixit@intel.com> <20230919161049.2307855-8-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/29.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-xe] [PATCH 07/21] drm/xe/oa: OA stream initialization X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" On Tue, 19 Sep 2023 09:10:35 -0700, Ashutosh Dixit wrote: > > +static int xe_oa_configure_oar_context(struct xe_oa_stream *stream, bool enable) > +{ > + int err; > + u32 format = stream->oa_buffer.format->format; > + u32 offset = stream->oa->ctx_oactxctrl_offset; > + struct flex regs_context[] = { > + { > + GEN8_OACTXCONTROL, > + offset + 1, > + enable ? GEN8_OA_COUNTER_RESUME : 0, > + }, > + }; > +#define GEN12_CTX_CTRL_OAR_CONTEXT_ENABLE BIT(8) > +#define GEN12_OAR_OACONTROL_OFFSET 0x5B0 > + /* Offsets in regs_lri are not used since this configuration is applied using LRI */ > + struct flex regs_lri[] = { > + { > + GEN12_OAR_OACONTROL, > + GEN12_OAR_OACONTROL_OFFSET + 1, > + (format << GEN12_OAR_OACONTROL_COUNTER_FORMAT_SHIFT) | > + (enable ? GEN12_OAR_OACONTROL_COUNTER_ENABLE : 0) > + }, > + { > + RING_CONTEXT_CONTROL(stream->hwe->mmio_base), > + CTX_CONTEXT_CONTROL, > + _MASKED_FIELD(GEN12_CTX_CTRL_OAR_CONTEXT_ENABLE, > + enable ? > + GEN12_CTX_CTRL_OAR_CONTEXT_ENABLE : > + 0) > + }, > + }; > + > + /* Modify stream hwe context image with regs_context */ > + err = xe_oa_modify_context(stream, &stream->exec_q->lrc[0], > + regs_context, ARRAY_SIZE(regs_context)); > + if (err) > + return err; > + > + /* Apply regs_lri using LRI */ > + return xe_oa_modify_self(stream, regs_lri, ARRAY_SIZE(regs_lri)); This function is incorrect. Please don't review this. Hopefully I have fixed it here (at least "gen12-unprivileged-single-ctx-counters" IGT passes with this patch): https://gitlab.freedesktop.org/adixit/kernel/-/commit/eb47df203caf259d2b0a3fc7cb9b557a78f76b8b The above patch will be included in the next rev of the series. Thanks. -- Ashutosh