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 A4ABCC001B0 for ; Thu, 10 Aug 2023 02:17:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4D6EE10E14D; Thu, 10 Aug 2023 02:17:34 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1EEE010E14D for ; Thu, 10 Aug 2023 02:17:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691633852; x=1723169852; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version:content-transfer-encoding; bh=kuU3hnL/egLDpEvFvuxDjFt2+N4DmxcUhRiBK21Gcz8=; b=OvVqtteSUMvzAjPTnybYRoiFngARy+tiaBwMKBg4OVm4Rd+yvtSAwiJf deDvjuiQVutOLoozjoDodwHWMvTfFl6aoid7AK11/2OdY1qb+z/iBNeZa dLFFXu4IBeLTsgT3OdmhtIdBP0MyM9jjdUv2NXTpJKDrv6tqtEHwYhzAe V5OIoVuBqQAqWkScE+1uFfCGzuAweEBSTtOgO4vqh7YKoZYDZGMuYwhHF WaqeVV1ORlnjawCA8c8zfwRlZwHqOtMlpPX2Ts1+ZW5NAITW2pMsRB+0b x9I2N6zcCImmxtP8chS9xS7IeO80s2/2jpNfqqhzC+lMjWnpYsBR/iYj8 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10797"; a="350856395" X-IronPort-AV: E=Sophos;i="6.01,160,1684825200"; d="scan'208";a="350856395" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Aug 2023 19:17:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10797"; a="978609386" X-IronPort-AV: E=Sophos;i="6.01,160,1684825200"; d="scan'208";a="978609386" Received: from adixit-mobl.amr.corp.intel.com (HELO adixit-arch.intel.com) ([10.212.56.194]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Aug 2023 19:17:31 -0700 Date: Wed, 09 Aug 2023 19:17:30 -0700 Message-ID: <87o7jf3akl.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: "Iddamsetty, Aravind" In-Reply-To: <714a0c1f-cf09-b102-045e-ef6ffbc29d66@intel.com> References: <20230808115436.400611-1-aravind.iddamsetty@intel.com> <20230808115436.400611-3-aravind.iddamsetty@intel.com> <877cq4y8s3.wl-ashutosh.dixit@intel.com> <714a0c1f-cf09-b102-045e-ef6ffbc29d66@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=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Intel-xe] [PATCH v3 2/2] drm/xe/pmu: Enable PMU interface 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: , Cc: Bommu Krishnaiah , intel-xe@lists.freedesktop.org, Tvrtko Ursulin Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" On Wed, 09 Aug 2023 04:39:58 -0700, Iddamsetty, Aravind wrote: Hi Aravind, > On 09-08-2023 13:16, Iddamsetty, Aravind wrote: > > On 09-08-2023 12:58, Dixit, Ashutosh wrote: > >> On Tue, 08 Aug 2023 04:54:36 -0700, Aravind Iddamsetty wrote: > >>> diff --git a/drivers/gpu/drm/xe/xe_pmu_types.h b/drivers/gpu/drm/xe/x= e_pmu_types.h > >>> new file mode 100644 > >>> index 000000000000..a950c892e364 > >>> --- /dev/null > >>> +++ b/drivers/gpu/drm/xe/xe_pmu_types.h > >>> @@ -0,0 +1,76 @@ > >>> +/* SPDX-License-Identifier: MIT */ > >>> +/* > >>> + * Copyright =A9 2023 Intel Corporation > >>> + */ > >>> + > >>> +#ifndef _XE_PMU_TYPES_H_ > >>> +#define _XE_PMU_TYPES_H_ > >>> + > >>> +#include > >>> +#include > >>> +#include > >>> + > >>> +enum { > >>> + __XE_SAMPLE_RENDER_GROUP_BUSY, > >>> + __XE_SAMPLE_COPY_GROUP_BUSY, > >>> + __XE_SAMPLE_MEDIA_GROUP_BUSY, > >>> + __XE_SAMPLE_ANY_ENGINE_GROUP_BUSY, > >>> + __XE_NUM_PMU_SAMPLERS > >>> +}; > >>> + > >>> +#define XE_MAX_GT_PER_TILE 2 > >>> + > >>> +struct xe_pmu { > >>> + /** > >>> + * @cpuhp: Struct used for CPU hotplug handling. > >>> + */ > >>> + struct { > >>> + struct hlist_node node; > >>> + unsigned int cpu; > >>> + } cpuhp; > >>> + /** > >>> + * @base: PMU base. > >>> + */ > >>> + struct pmu base; > >>> + /** > >>> + * @closed: xe is unregistering. > >>> + */ > >>> + bool closed; > >>> + /** > >>> + * @name: Name as registered with perf core. > >>> + */ > >>> + const char *name; > >>> + /** > >>> + * @lock: Lock protecting enable mask and ref count handling. > >>> + */ > >>> + spinlock_t lock; > >>> + /** > >>> + * @sample: Current and previous (raw) counters. > >>> + * > >>> + * These counters are updated when the device is awake. > >>> + * > >>> + */ > >>> + u64 sample[XE_MAX_GT_PER_TILE][__XE_NUM_PMU_SAMPLERS]; > >> > >> s/XE_MAX_GT_PER_TILE/XE_MAX_GT/ since the PMU is for the entire device= not > >> per tile, as I mentioned earlier. > > > > right, so for a device this shall be sample[XE_MAX_TILES_PER_DEVICE * > > XE_MAX_GT_PER_TILE][__XE_NUM_PMU_SAMPLERS] > > on further checking based on (d714e2b698d8 drm/xe: Introduce xe_tile) > the XE_MAX_TILES_PER_DEVICE is being considered as MAX_GT as well so > will use similar to that here. OK, but just to point out the all the code is written in terms of gt's only (not tiles) so IMO we should keep tiles out of this array definition. Also note that gt id's are unique, across tiles. That is why I am suggesting XE_MAX_GT (since gt id's would go from 0 to (XE_MAX_GT - 1)) (irrespective of the number of tiles or the tiles gt's are on). Thanks. -- Ashutosh