From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D05D0399037 for ; Wed, 14 Jan 2026 13:07:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768396034; cv=none; b=Qe3krNxF8q01gu+lCtDVfppYjJxKTj88QzOg/GYrc0efjMDUqD0g2jal/Xf9WFvVDN5MFE+6iExDME+Y5fl7PEYshGfTLGYovrMBwMQbr3jLchU/ZRSEAasZytxY86w1mamFjfudNGU76pHDOj4LehfAk64yzrC/bpxBGG7lwSY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768396034; c=relaxed/simple; bh=j6bw6zeuuahLfoAQbMI2dlZBjEcPD8A7SE2ErYP+St4=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=pLMsafVMz9SarPFtXdIvtcN0kBFic7d+TkqVhbmvfQiEuXgVjJ5tWZbPSd67VGkiw6oymn+5zD6ZGL5jw+SoOUe1mhV8zY3qFAsnb8ln6q8m/oLFYHd+Of9Jmun1Nzlcn1bbCxMGpxyFlBb0DM2u06xgALH2FA0teHXCSUs4yTs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=jrDzRtBT; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="jrDzRtBT" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1768396023; bh=j6bw6zeuuahLfoAQbMI2dlZBjEcPD8A7SE2ErYP+St4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=jrDzRtBT2KNIn85SoyHNWWDAdqqyrQ4Q2hzFcUmU5w3we4RiQlrZF9NZbRA9H1uyc qht+MJiv1MhKzY30jkbHTmmLDCxIOhuddjSmTBejEZgvB4+eP3w6ahnqHv5RSczZ9Z mxHuSPjM6GihdtuKAiM8ZJ+JRqZHvMPV/xk7L7mCIiBKoSsqlh25/gXw/KboHYiqWU AR57J7+zrMfHXQJsIBq2KBxHxxh1SzsgXerVIKu8drYBGmYjWAqis64piILILG+mvF BcbOlSswTvZ2q3bO0tqVF8xVxSv2a/EfNFMcNRkHkoOh7Xz8WB7/FUJOFUq/mLz8sR Exj+eRM5RTqmA== Received: from fedora (unknown [IPv6:2a01:e0a:2c:6930:d919:a6e:5ea1:8a9f]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bbrezillon) by bali.collaboradmins.com (Postfix) with ESMTPSA id 921FA17E10F4; Wed, 14 Jan 2026 14:07:02 +0100 (CET) Date: Wed, 14 Jan 2026 14:06:57 +0100 From: Boris Brezillon To: Lukas Zapolskas Cc: Liviu Dudau , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , =?UTF-8?B?QWRyacOhbg==?= Larumbe , nd@arm.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Mihail Atanassov Subject: Re: [PATCH v6 1/7] drm/panthor: Add performance counter uAPI Message-ID: <20260114140657.4b0392f1@fedora> In-Reply-To: <20251215171453.2506348-2-lukas.zapolskas@arm.com> References: <20251215171453.2506348-1-lukas.zapolskas@arm.com> <20251215171453.2506348-2-lukas.zapolskas@arm.com> Organization: Collabora X-Mailer: Claws Mail 4.3.1 (GTK 3.24.51; x86_64-redhat-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 15 Dec 2025 17:14:47 +0000 Lukas Zapolskas wrote: > +/** > + * enum drm_panthor_perf_block_type - Performance counter supported block types. > + */ > +enum drm_panthor_perf_block_type { > + /** @DRM_PANTHOR_PERF_BLOCK_METADATA: Internal use only. */ > + DRM_PANTHOR_PERF_BLOCK_METADATA = 0, If it's internal-use-only, it shouldn't be exposed here. That's another case of "I want an HW-agnostic uAPI so I can reconcile things up in the KMD if things change on new HW, but I want it to match the current HW mapping because it's simpler". If we really want to standardize the block types that are exposed to the user (and after discussing it with you, it seems you have valid reasons to want that), I'd rather have a tightly packed enum with only the block types visible to the user. It looks like METADATA is the only block we want to hide at the moment, so it shouldn't be too hard to special-case this block. > + > + /** @DRM_PANTHOR_PERF_BLOCK_FW: The FW counter block. */ > + DRM_PANTHOR_PERF_BLOCK_FW, Let's prefix those values with DRM_PANTHOR_PERF_BLOCK_TYPE_ to avoid the blk vs blk-type confusion. > + > + /** @DRM_PANTHOR_PERF_BLOCK_CSHW: The CSHW counter block. */ > + DRM_PANTHOR_PERF_BLOCK_CSHW, > + > + /** @DRM_PANTHOR_PERF_BLOCK_TILER: The tiler counter block. */ > + DRM_PANTHOR_PERF_BLOCK_TILER, > + > + /** @DRM_PANTHOR_PERF_BLOCK_MEMSYS: A memsys counter block. */ > + DRM_PANTHOR_PERF_BLOCK_MEMSYS, > + > + /** @DRM_PANTHOR_PERF_BLOCK_SHADER: A shader core counter block. */ > + DRM_PANTHOR_PERF_BLOCK_SHADER, > + > + /** @DRM_PANTHOR_PERF_BLOCK_FIRST: Internal use only. */ > + DRM_PANTHOR_PERF_BLOCK_FIRST = DRM_PANTHOR_PERF_BLOCK_FW, > + > + /** @DRM_PANTHOR_PERF_BLOCK_LAST: Internal use only. */ > + DRM_PANTHOR_PERF_BLOCK_LAST = DRM_PANTHOR_PERF_BLOCK_SHADER, > + > + /** @DRM_PANTHOR_PERF_BLOCK_MAX: Internal use only. */ > + DRM_PANTHOR_PERF_BLOCK_MAX = DRM_PANTHOR_PERF_BLOCK_LAST + 1, I think I'd just go for DRM_PANTHOR_PERF_BLOCK_TYPE_COUNT, and drop DRM_PANTHOR_PERF_BLOCK_{FIRST,LAST,MAX) definitions, with a comment stating that DRM_PANTHOR_PERF_BLOCK_TYPE_COUNT must stay last in this enum. > +};