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 007792836B1 for ; Tue, 13 Jan 2026 16:19:13 +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=1768321155; cv=none; b=PHZGQR1gbrUdp6NIkS4yKqc1R1mJ/FhV1/s7bm0P8D4snXDBAm6rGED6OquyAZ7bJstx94VA2seTf2FFLClW+5+/EYgbAZmFTMWbkNmUmNKdFc9X9QdF5ebKgxO2TA48k+xPJpTEtsBmhzAQ10Xv8M9P5gznI4C8w3yHmx5d6p8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768321155; c=relaxed/simple; bh=5Zd516jlMdZ9k/ZdmyxYmyDCnAdbWqAAEuijzcESTo4=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=FjldQjDSusRSAtenjmViY6fD462g2u1g8a+oruyI0WmcKycG2r7/2yel4t/91bpNbLdCH1ez6+csUOA5QXt+11EhLOiFGdRc+N3x3915+nzRcOJ7+9RqUiI4QDh160rSKCVZoal5SR2wnrlgIh0SBbDciTdVcUWgGziQE5eePtQ= 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=Hth9sqS0; 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="Hth9sqS0" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1768321152; bh=5Zd516jlMdZ9k/ZdmyxYmyDCnAdbWqAAEuijzcESTo4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Hth9sqS0tpiFuR8Np1P1rgknT//yN5AeK2k5bmW+3IUOOQTKGSWB5y9rOxCEfkyTh kU7CXr42sTLLdpbiIl/WjO0XzJaZ5XmMhalLtefnZ8MbdE0stL0kxsHUbxFHKKoyNs 7AQTAiRknWzilD3/sG5G2wnZfkp6LtHMGu+rQmw2n7394FbjSxUn8ijAm5y6V825we AQ4UStpahsVdt66wzIl1B7fh4tXgSolx1TxJYbUEUBHOi/O9vlJM7aNrk7hMy5Iuvw ZkzH7ES9WhkbgtRgEtjbpuJTf1FL6Z7YpuiQPYv2Ef1NXpnfSaKrn/zjPWXU5Aevku ZAwm5LQFsGHUg== 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 D158417E13E0; Tue, 13 Jan 2026 17:19:11 +0100 (CET) Date: Tue, 13 Jan 2026 17:19:07 +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 5/7] drm/panthor: Implement the counter sampler and sample handling Message-ID: <20260113171907.02623198@fedora> In-Reply-To: <20251215171453.2506348-6-lukas.zapolskas@arm.com> References: <20251215171453.2506348-1-lukas.zapolskas@arm.com> <20251215171453.2506348-6-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:51 +0000 Lukas Zapolskas wrote: > +#define BLK_MASK(x) GENMASK_ULL((x) - 1, 0) > + > +static u64 get_sc_mask(struct panthor_device *ptdev) > +{ > + const u64 sc_mask = ptdev->gpu_info.shader_present; Hm, so I've just merged a change to allow overriding this shader_present with a value loaded from an nvmem cell, meaning the value returned to userspace no longer matches the number of cores known by the GPU. I have a local hack to apply such overrides late and keep panthor_device::gpu_info as the HW state, but this forces us to be careful about which variant of shader_present we want depending on the context (in panthor_{fw,sched}.c we want the user value, in panthor_perf.c, it we want the user value in get_sc_mask(), and the HW value in get_reserved_sc_blocks()). > + > + return BLK_MASK(hweight64(sc_mask)); I believe this should be sc_mask on v13-, and BLK_MASK(hweight64(sc_mask)) on v14+. > +}