Received: by 2002:a05:7208:1509:b0:82:bbfa:f723 with SMTP id o9csp216362rbf; Tue, 23 Apr 2024 23:49:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVakUG7Dn3USUY5Z/bmjL5zUvbFu4L5wtSJSZcwii70fktOEOuFHVjBvA5tFCNsOhBWr0nqzDyh9oX1A06TwfdYBMp3IH+ZFiLJ/5Ptiw== X-Google-Smtp-Source: AGHT+IH9E4cFNInbtjilcYJa7tLWTpL5mDvdqRZmDsIpYqceiSC772C2IOEMb7iNDlxysqnFvQdg X-Received: by 2002:a17:90a:5143:b0:2ac:a7fd:8737 with SMTP id k3-20020a17090a514300b002aca7fd8737mr1317859pjm.41.1713941344217; Tue, 23 Apr 2024 23:49:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713941344; cv=pass; d=google.com; s=arc-20160816; b=BcjR6Nmw0SbLDxJlGXRpjheVMWIjwc5WJXYmLHuLt6+IMs2bZ0VmtWjAUlK3iHyBbd 22npV10F3jfYKOGej/TQDHUd0k0NEaUZ81XHyomAbDjIvPafjkvdae7yQIbXBrQCCrlo vENxdoN+RpQPCmgAQGpX1eQ56W5qaJ0BTOIl9p1Mrem8eIA8kJT3Efj06B1PBxkuqMAF kLy6t5HuSK2lGvRox+Qf/VO5ewoLN7/RVNgJI3fp596EW3MLXAuRFCm6vDEuxquH2mEG NN0rSF6SkZn/oHHIquQorjRYNjqZBs56Hf9UDn1U+rd/C7ea7VomyiH+11WlFPUHsYSW CDqA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:organization:references :in-reply-to:message-id:subject:cc:to:from:date:dkim-signature; bh=TYWS1mKx8H8fPX39e2MqiHYXd8qrosUSPemh60VkEvs=; fh=W+65GDrk8Lina61QH7thggC7MBi4W3OsVz/L3AnedWk=; b=WkMlAqr9aBKrWDPlbKY9ZmdXo17JO5Vsmdji/Lc/XAS+o+DeGBd5rv5F6J/85PqsrF LsWJkYsQ/ZE+qoCr+gAcBzmzfGibycN8jyEmbLNyGOjPhQNRD+b/MMGp1b9bAsUn/Rk1 Ws62FBKRDHnhZ5aSbIqM3fRzDvGWZ/AerpLIp5XlsCfJGiFxdynZh1GKjWSLTSPNgHzV vIueYalS4FSqINAV7tKgnnOpfU7f9X/nlhLNRBksSaJEwobqbopOC6JdNg9l/qz8DKCV oubzuXVUCe5ilXxTD2lZemQ7Qp+Xj/L88u8aoQ1iFDXofnaB+sLezCz5gS68bvSE6JcH mZdQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=tgVqusFl; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-156406-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-156406-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id q14-20020a17090a68ce00b002a7f5fa1732si12704472pjj.111.2024.04.23.23.49.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 23:49:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-156406-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=tgVqusFl; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-156406-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-156406-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 9841E283F2D for ; Wed, 24 Apr 2024 06:49:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 601A3157E69; Wed, 24 Apr 2024 06:48:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="tgVqusFl" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (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 0811015687C for ; Wed, 24 Apr 2024 06:48:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713941330; cv=none; b=qwQIAbe5lzQEJ8N7XRIrlU1YdDQq+Lfe7vTuYBMxtj0g5C7p1YHJzULG8N1d5xxEV5DOZwpzTqt/p6If/nXQykDdX6y6Y3jPq6pdc6FwzV2KNhZ2BanI++XQ4DPMS7bDnFwfJu1/riGpwskXYZdoJvYvJU2R4OuQQhoBUTgYwrs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713941330; c=relaxed/simple; bh=MCbQ8rAHzB39hXl89cji/rkdiQatKGWYGWSwFnCGjP8=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=lLeyuWwLgb9dB3SLcsSfN2fVsNc4n+lYptIc4fGCAycsAULqEuF+Tfza25jXZDZEQ2XqkzotIozEMADGHUyEdF1hlLAdlQyk9MmRwC9WDar7D5RXI8XD007+gqyKeQ4TOlUmuGfxVHUpMDkexND/dwsZiN8+WFfYxFnwZloro28= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=tgVqusFl; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1713941326; bh=MCbQ8rAHzB39hXl89cji/rkdiQatKGWYGWSwFnCGjP8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=tgVqusFlVX5FZN6PlqVOsyQikYjC5hrQ2VCM/5ibvt0MptDvKLWSUx88lPTk+4Fqd mgKxcWC0X/Z2DxjMjROS7TGnZyJPW1jYvvwbNyeUXGnad8k1VAmpfi3U+1kUlfGwer oQ8w8BczM2vICB9TWN93JmFWjELosDlTP4TKMpOGRYx+gQlY8RyCzBU+33WdU1Qwou CfAZzuNv3BYxePp19MmEn2d9ICl13ZpHkLM01CkGRN30jmDjq+ra2e+Pv2+Cv8Eteh sBvwMDC4om7n41mdMVzw00Wa5Uoy/7Sf7WNd56fY096lMXtSFRXyx+EHzwnczLg+cJ Nwb1BuNR8tmHg== Received: from localhost (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bbrezillon) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 12529378212B; Wed, 24 Apr 2024 06:48:46 +0000 (UTC) Date: Wed, 24 Apr 2024 08:48:43 +0200 From: Boris Brezillon To: =?UTF-8?B?QWRyacOhbg==?= Larumbe Cc: Steven Price , Liviu Dudau , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , kernel@collabora.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/3] drm/panthor: introduce job cycle and timestamp accounting Message-ID: <20240424084843.57f095df@collabora.com> In-Reply-To: <20240423213240.91412-2-adrian.larumbe@collabora.com> References: <20240423213240.91412-1-adrian.larumbe@collabora.com> <20240423213240.91412-2-adrian.larumbe@collabora.com> Organization: Collabora X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; 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=UTF-8 Content-Transfer-Encoding: quoted-printable On Tue, 23 Apr 2024 22:32:34 +0100 Adri=C3=A1n Larumbe wrote: > Enable calculations of job submission times in clock cycles and wall > time. This is done by expanding the boilerplate command stream when runni= ng > a job to include instructions that compute said times right before an aft= er > a user CS. >=20 > Those numbers are stored in the queue's group's sync objects BO, right > after them. Because the queues in a group might have a different number of > slots, one must keep track of the overall slot tally when reckoning the > offset of a queue's time sample structs, one for each slot. >=20 > NUM_INSTRS_PER_SLOT had to be increased to 32 because of adding new FW > instructions for storing and subtracting the cycle counter and timestamp > register, and it must always remain a power of two. >=20 > This commit is done in preparation for enabling DRM fdinfo support in the > Panthor driver, which depends on the numbers calculated herein. >=20 > Signed-off-by: Adri=C3=A1n Larumbe > --- > drivers/gpu/drm/panthor/panthor_sched.c | 158 ++++++++++++++++++++---- > 1 file changed, 134 insertions(+), 24 deletions(-) >=20 > diff --git a/drivers/gpu/drm/panthor/panthor_sched.c b/drivers/gpu/drm/pa= nthor/panthor_sched.c > index b3a51a6de523..320dfa0388ba 100644 > --- a/drivers/gpu/drm/panthor/panthor_sched.c > +++ b/drivers/gpu/drm/panthor/panthor_sched.c > @@ -93,6 +93,9 @@ > #define MIN_CSGS 3 > #define MAX_CSG_PRIO 0xf > =20 > +#define NUM_INSTRS_PER_SLOT 32 > +#define SLOTSIZE (NUM_INSTRS_PER_SLOT * sizeof(u64)) Given everyone agreed on the profiling sysfs knob for Panfrost, I'm tempted to make the profiling optional here as well, so we can save space on the CS ring buffers when profiling is disabled. This means adjusting the 'credits' parameter we pass to drm_sched_job_init() accordingly, with one credit counting for an instruction (or a block of 16 instructions to keep things naturally cache-line aligned). You'll also need to change the 'credit_limit' passed to drm_sched_init(). > =20