From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 885B72BDC13 for ; Fri, 24 Apr 2026 15:12:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777043531; cv=none; b=bTyPHGUbCvXYuoZfsu7Bp+IsgdiHe73ub/A5AXXhEt+g+hKZig72QgZG6r9VW6IM+am5X9Hf5py0p0sMTu55D3Wb1DpteXDQOtF0sJLjmPPdVR6FZjLp0ZSKMOfPr8+HNcNzJV98RXKA+CygBEKmHVvmSg5/rB9hCv9+ZF9zZBc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777043531; c=relaxed/simple; bh=UzSwe7nNkzpB+wS6zyIpQUgsfG1m2PPOjvq+pqnFQbk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EIJpyWTsNefyPtezk7wVWR5uAaWPI+bF9Ql3OiipMXXgdzP7nGK4/4sl9PqUkfPdJTGcuXRFkopqWmhVUx1/jEwItYccNlvboHFnqMl/5YcXS9nsifHSiLP2utoJQIz/6GFbz++aubHLbYg8gVVDLGn3D2w+gxoLq0bwH9OPhYA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=Lcsx29i6; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=YkFWq7m5; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="Lcsx29i6"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="YkFWq7m5" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63OAPKhw2972227 for ; Fri, 24 Apr 2026 15:12:07 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=hqrgam/FCMU 6TRDYGic4FvNbNNuPhpsx7Cb0DIkY9Rw=; b=Lcsx29i6XWCGLkBzXoFywk57VYU CgWI1XgAfl7h6ESMlUXBOHPZH9N1NuzHYK1PybY3TbegLNfKd5ZDYZVJrwZLHB+e qx/R2rkP0z6bhyiqD00UydYh+eoXtBITE5HcJHGuaKZPswdv/NMG99BFXz9tUQXv 9RLwT3lszlGusRwv5I1doqk/xe8+ucW2Apm9mppDy6OGl3pcLsufYrB3DQD7ID1K UpGMTOflUk4y1fGV2Zz2HYj73Vfl2fVNwsBHPVn9WZM6/Wz6WiCYGbncCMdEL1aB 4IBEdLfo5S6R1p6picxGotbZiMGNsRjrKP20KJJAJjgFmtCgHdLVoj67Jag== Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dr6rk94an-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 24 Apr 2026 15:12:07 +0000 (GMT) Received: by mail-pg1-f200.google.com with SMTP id 41be03b00d2f7-c76cb2dce57so4927422a12.1 for ; Fri, 24 Apr 2026 08:12:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1777043526; x=1777648326; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hqrgam/FCMU6TRDYGic4FvNbNNuPhpsx7Cb0DIkY9Rw=; b=YkFWq7m5ZvlPjCFG9bh2Q08Aw/JuC7yms0z6yb2mtFia8ik+ZvVFCU37mEaCKSpI+H srevZ5acjYKlsUTW3Iw+56VqravJfI4Jojw+zwRjmJtuD9/U+KZTiIcpWJnVmlIBg9MD F6BwDv6iBLn12HhUJDCvpv3TxbgmmeeaZLXq/MKehmhEhv8pb/RtvHuhOfnAuWnmWhLb RdWuluOhnXjTdqFH5cXO43+OCuhjZyTaX/RP83wP2qNXh4bCZ7Kz+0SujM+tPH/ouD+h r8TgespqgugF/hvN/BCruCW20BwJDsQ0JjjS1QaxnBcL0sfm1VzXfuGmHVxtu/UqYAxX dLEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777043526; x=1777648326; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=hqrgam/FCMU6TRDYGic4FvNbNNuPhpsx7Cb0DIkY9Rw=; b=emxOkz9HYSH9CIZ6qaqOQVmGAXGUBLj86qlOUChZ6QfnBAwYftrZYZh1nF0TpGhguG BE6auvTIk3k5yHV0DGh94ufvuNLHgR98/1BqzmHccP5SRAPELBA9+A4T/qciYiEHC25f anScdmlj3eeo/WOv6LFPr0z4TI0qrUJTNCerTwQPs9LrNx2wcQ5LnRvE2lHa+0kAmZoW M5BzAFyAOEn65EQD2ITcYV/zZfw1I0sJiVZKVa4azZZh328PbF2X/6Z+t3LTTEpoQwB4 U8ft+ZDzBy4yjnmFZKebQ6UhgYYlKJp2qdSrPHhvShMW5NbJNfwHf9DK9aoBZYxp339o pv2Q== X-Forwarded-Encrypted: i=1; AFNElJ8KwzhnVRcU+E0KA0BKizX/eEk4dwJE+chDv7AqrGUypy9x6gWt70xhg/c5e1rI3S8lP4hGSrTbW+CwWCs=@vger.kernel.org X-Gm-Message-State: AOJu0Yz/UbN9cvBpBp6d6qk9A6IeD8H6/1q+W1KqoxmWAy7qc9tN91vG JrMirO0rArUljDKAa4UqoAAgOq2PsIhW9ErCQVCWGpmzHaVI6VeMOKba9Ad6jMN8wrRhlsaZdsD 0DDwWnpTpnHLLRt26d3lGfMq+hsTBks0HYxhfpzz3223VEdGX38+UnbQ5BHYb9JHMYp0= X-Gm-Gg: AeBDievcBQRCA9TollJ/86+cQdUrSIQP5tUfNnl7ICFzq/yqy1uRGLAzEjfqAZL4WDX j9vH8MmunrVvH3j2FGZO4i8mBxKltIw3WZvq6DhfJwL333fSwdhgz573lpJtjxdImDa5j2QbnBF 1B0I+ETiMdvQdnhoGG0/eX863p5VQDy2+LF4fT3e3pYLoecHvl72jn6pdC+56q2A4sM/wyTCO8B Pe+N5NjLraduQ3iQVDKmaqeSHjh1S/V9IrQoSf2Z/fxH0DCfdVK8LSM+ISndlyRZ6RfEaSnAL7I ckecExjNaShTzfF0zQA+hv2IpazEPIyWEsH5AFSe4bUOTt4p2iQh4U5HgNdnGyplJPLcqLLEG6L C9eAbkty3Hu+0i429Uo3NgD0vDyEscJKxIrBMug41k88= X-Received: by 2002:a05:6a20:7fa5:b0:398:a76e:4ad4 with SMTP id adf61e73a8af0-3a08d76d92fmr36814971637.21.1777043526273; Fri, 24 Apr 2026 08:12:06 -0700 (PDT) X-Received: by 2002:a05:6a20:7fa5:b0:398:a76e:4ad4 with SMTP id adf61e73a8af0-3a08d76d92fmr36814927637.21.1777043525796; Fri, 24 Apr 2026 08:12:05 -0700 (PDT) Received: from localhost ([2601:1c0:5000:d5c:4ec8:83f5:8254:6891]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c797702faaesm17883136a12.23.2026.04.24.08.12.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Apr 2026 08:12:05 -0700 (PDT) From: Rob Clark To: dri-devel@lists.freedesktop.org Cc: linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, Akhil P Oommen , Rob Clark , Sean Paul , Konrad Dybcio , Dmitry Baryshkov , Abhinav Kumar , Jessica Zhang , Marijn Suijten , David Airlie , Simona Vetter , linux-kernel@vger.kernel.org (open list) Subject: [PATCH v2 06/16] drm/msm: Add a6xx+ perfcntr tables Date: Fri, 24 Apr 2026 08:10:41 -0700 Message-ID: <20260424151140.104093-7-robin.clark@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260424151140.104093-1-robin.clark@oss.qualcomm.com> References: <20260424151140.104093-1-robin.clark@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Authority-Analysis: v=2.4 cv=AfWB2XXG c=1 sm=1 tr=0 ts=69eb8847 cx=c_pps a=oF/VQ+ItUULfLr/lQ2/icg==:117 a=xqWC_Br6kY4A:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=EUspDBNiAAAA:8 a=UuwE4gOO9k-hs8zF27AA:9 a=3WC7DwWrALyhR5TkjVHa:22 X-Proofpoint-ORIG-GUID: 3x_hL5RUN29iRSPkbd2ZRN_x-62YBJ5f X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDI0MDE0NyBTYWx0ZWRfX5KUV9rSUMu5c yA0M7r0PPCex/p0rjn5Ib12smAJqilHbmg/1i74yafzt126nvzmG8VuUw6kipapSwNdJKE79E3E qcyInLU5DTRzxKw3IVsgsolfCx+yL92kca9PQB7AFyqACOGlRNEK29rv41G5/7zfEhDRsMTszk7 YS9Bzh8/WJZleL9OPeiht1TaQhlnMTdEVfG+/nPiL3QocwZ/z2LL2mVGVNBdf7GHjHhS4QoMCfu Av9lzv347QvXpxY+tguXwhW/r+Bg9kzoyDzIK2BDBULhQxRhFO/XGIwnA1HeU8ejztYoJDi2Gwa IIQRYgKIVI+AJ+T+xwncdYWjHak9uH+B5hPqk2saY1DF3Rmb5pr4Q9ECgjUOCtbLr3vPd+PajLo rUrs6IM+vTASYtebEGbumxwS3Nd91K6+SK0mp/2be22owNHQxrGj0gW93/TMGyZaQHU3EjeKnZg SkxlwOQIyiVvlEQFVcg== X-Proofpoint-GUID: 3x_hL5RUN29iRSPkbd2ZRN_x-62YBJ5f X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-24_01,2026-04-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 priorityscore=1501 clxscore=1015 spamscore=0 adultscore=0 suspectscore=0 impostorscore=0 malwarescore=0 lowpriorityscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2604240147 Wire up the generated perfcntr tables for a6xx+. The PERFCNTR_CONFIG ioctl will use this information to assign counters. Signed-off-by: Rob Clark --- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 15 +++++++++++++++ drivers/gpu/drm/msm/msm_gpu.h | 4 ++++ drivers/gpu/drm/msm/msm_perfcntr.h | 9 +++++++++ 3 files changed, 28 insertions(+) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c index e578417a4949..727281fbef36 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c @@ -5,6 +5,7 @@ #include "msm_gem.h" #include "msm_mmu.h" #include "msm_gpu_trace.h" +#include "msm_perfcntr.h" #include "a6xx_gpu.h" #include "a6xx_gmu.xml.h" @@ -2637,6 +2638,20 @@ static struct msm_gpu *a6xx_gpu_init(struct drm_device *dev) adreno_gpu = &a6xx_gpu->base; gpu = &adreno_gpu->base; + if ((ADRENO_6XX_GEN1 <= config->info->family) && + (config->info->family <= ADRENO_6XX_GEN4)) { + gpu->perfcntr_groups = a6xx_perfcntr_groups; + gpu->num_perfcntr_groups = a6xx_num_perfcntr_groups; + } else if ((ADRENO_7XX_GEN1 <= config->info->family) && + (config->info->family <= ADRENO_7XX_GEN3)) { + gpu->perfcntr_groups = a7xx_perfcntr_groups; + gpu->num_perfcntr_groups = a7xx_num_perfcntr_groups; + } else if ((ADRENO_8XX_GEN1 <= config->info->family) && + (config->info->family <= ADRENO_8XX_GEN2)) { + gpu->perfcntr_groups = a8xx_perfcntr_groups; + gpu->num_perfcntr_groups = a8xx_num_perfcntr_groups; + } + mutex_init(&a6xx_gpu->gmu.lock); spin_lock_init(&a6xx_gpu->aperture_lock); diff --git a/drivers/gpu/drm/msm/msm_gpu.h b/drivers/gpu/drm/msm/msm_gpu.h index 78e1478669be..8c08dc065372 100644 --- a/drivers/gpu/drm/msm/msm_gpu.h +++ b/drivers/gpu/drm/msm/msm_gpu.h @@ -24,6 +24,7 @@ struct msm_gem_submit; struct msm_gem_vm_log_entry; struct msm_gpu_state; struct msm_context; +struct msm_perfcntr_group; struct msm_gpu_config { const char *ioname; @@ -262,6 +263,9 @@ struct msm_gpu { bool allow_relocs; struct thermal_cooling_device *cooling; + + const struct msm_perfcntr_group *perfcntr_groups; + unsigned num_perfcntr_groups; }; static inline struct msm_gpu *dev_to_gpu(struct device *dev) diff --git a/drivers/gpu/drm/msm/msm_perfcntr.h b/drivers/gpu/drm/msm/msm_perfcntr.h index 305dcde15c5e..64a5d29feba1 100644 --- a/drivers/gpu/drm/msm/msm_perfcntr.h +++ b/drivers/gpu/drm/msm/msm_perfcntr.h @@ -35,6 +35,15 @@ struct msm_perfcntr_group { const struct msm_perfcntr_counter *counters; }; +extern const struct msm_perfcntr_group a6xx_perfcntr_groups[]; +extern const unsigned a6xx_num_perfcntr_groups; + +extern const struct msm_perfcntr_group a7xx_perfcntr_groups[]; +extern const unsigned a7xx_num_perfcntr_groups; + +extern const struct msm_perfcntr_group a8xx_perfcntr_groups[]; +extern const unsigned a8xx_num_perfcntr_groups; + #define GROUP(_name, _pipe, _counters, _countables) { \ .name = _name, \ .pipe = _pipe, \ -- 2.53.0