From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 7EDBA3655EA for ; Fri, 22 May 2026 17:34:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779471291; cv=none; b=INnQOIQSpP6/TEkpSkUgk+xg4PGC1/DKlLAf02sL/hHiVxdbrpYhAButBOzwjl2EJlgwj9LkQLLDIWilTrEgcx6/bHg6jJkf1Y5VB4OfxY2CeCqxh9ax7Tu9pVldJtphAi3hDvRjOX8sAO6NCC/2aV9KevXqv/OkGoDxpmLebgQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779471291; c=relaxed/simple; bh=A6F5qReJDJgGgECAx/he/Gp+PHKgzH5mAl7LkVSzXqw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QYvmVdAGf32/Pnqm7jvCoOXN2mYHpSG2op/YNbj6B3enH2h8Zfzhe+gA55ioGOPRKvDS82kfzLO8mOSYfYnodgA/+D7yBDOqNwhazggewk97dW22jjtN0MSpr2xWz7AMm6IpcB8gEDHVrtDX8C2IGSHZYZaAE4jUaRGga84x9h8= 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=air3kRtD; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=U0hc4Wwz; arc=none smtp.client-ip=205.220.168.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="air3kRtD"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="U0hc4Wwz" Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 64MBKONI1298128 for ; Fri, 22 May 2026 17:34:47 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=Uh+8YeArH5l xuIrq/0DkppLWphYU2zvQ1bZwgrXCWVs=; b=air3kRtDA09Uyrt7IzbcPzQktN0 kG6T/kwCP8BohzLfrNGshaB2Tj39ogphVQDFxhFyb0927MiL0dB3UPIB8PgpF7AZ sYWu0L8jVbACAYIpD4VGDPN8JUeKOl4VvQ/7mLoeOlQJq0IHpE+LPKvOb53QQO7k icUWQlb4hpwktDGNiBf5aEBhX+cS/5MPDBc3dNCAU9NhKgXqzOmnIWGPK0H+z81J 2l2AJm7SapDSBzvjHnHAQahMw2Ap4snWuYzDRKy3hOvnjX9t7GtiiXLdlGx0eOry gwgch9R49yjlqkP50XMbiNGzpeg5w8ljB1KeUgvnKIbxYuQGXyQ3Zw7anIQ== Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4eaah0c7hg-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 22 May 2026 17:34:47 +0000 (GMT) Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-2b99eb06178so177562095ad.2 for ; Fri, 22 May 2026 10:34:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1779471287; x=1780076087; 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=Uh+8YeArH5lxuIrq/0DkppLWphYU2zvQ1bZwgrXCWVs=; b=U0hc4Wwzpiz2eDG+E+bGuKNEXAAelC8kY5lH1STL8HjPmCIIsbcag2sfI7iackSKz7 aurSumbjdd356txHn/PQGnAw2xYUht3pGKKp8mduigjKZXnwLlxAIepTmyi4LCJ0nxqO qePi1TaUmGRHhDjPUCmTPuTlol7S5J3fmzoT+xFX7Mn/6CIGt8gx6dMvY/iE/KE15wVk jYv2sIgqwFc1N2Z1olohWCZZfeetGZzlnu3d5ZQ/wqNFTjCRHRRgaG6HRzv6ksveIkxJ i1XycJ8e6uRasR+juWkRczDHK7SiAVGjwV8DfW68busn2eamaqjpiqWrGA6Qj67QuVIj qCCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779471287; x=1780076087; 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=Uh+8YeArH5lxuIrq/0DkppLWphYU2zvQ1bZwgrXCWVs=; b=NcltOd2TxZ/2eEZfuIHxbStIiImoNgyMBCaL64TQCa6qQHOupJ+ummPiCOgQPiAxz5 ZJIJXpcHSJl1tefPaM3/lOGfDtQHU9lPSUWBRPqKsUc/3Hcit45HgK4o8U1IEyKK9df3 7xjYZO9OnJyRBr9EOs+RyoqkhS3Kpfu7pmKwkgxed5A+huKwhiKxvm3vpG1XhrgtE3nq 41M802QR68q0gjQAVcvFTHT+PjDEG1yOMRuptux+LNIL/G4lfvRBvfoU10ARv2TrKNiP 1DtNCgf8D9Ahgi9UmdGbCeRTh0D8/XUmShISreWVSRC9Va8z5DRF0DNbHL0HJbEBviAr 8BCQ== X-Forwarded-Encrypted: i=1; AFNElJ+w0tMXVfzRQJFwh6zy8Ag9bkROU1C4DwZQ2Cyr10Hw8SEChU3bh1QW1nhXiw7eFpvfBzbA2pdgU0x3Qzc=@vger.kernel.org X-Gm-Message-State: AOJu0YxW3PnwoTnjb7RG0XlVaruavEHFItjFFxv+gQdi7U/TuK6POxnl E1Yd7QD+LJ9MIUNvAVS7stqaLgy7p8pxTOOiKCeqa7EHuXgVaPCJN+wH+jlihmvsjESEIw7QQq5 7ZOXSgLy54KvaF33Q800PwdVWPJlxeqctrKgBiBrgW1d2eETAMUXWYfD9/n8Qglz7NXw= X-Gm-Gg: Acq92OESIBaCrDuIE6kYuIjYu4oCuOG5aqfXkfOu1MZLrDLEWoB/ie56yDMRrZnFM1v wDJlilR0UjsIKDbaaSlswtriW/DXpnzbnsCp8T54c9FBxWJtnwhRJupfK85GetY67WAIYJPj7t1 e21B2xeh9qPovcI7hx3luxvn60J+5ErWkt0v1BKVi6Qnks98Ba1um20vdpsDBOL5H1mm3fIwM1z jT9uav1kSXlSGWnjyJwDxioop3Wp5YstlGb3QtulCSm/vIZ29GEupHx9QzcUpH4GycWJopPWcFG E3tHk2QGUwn4SDF3lPfraVDcUQvGi28gZGCss/igFQDx3b2rQ6ANbRAxVh5NgTfg4Y/e7+JCJ23 0CEMGs0QTy26KTrWuBCpvSjfEanL+5ec4 X-Received: by 2002:a17:903:350d:b0:2b2:4cd2:e162 with SMTP id d9443c01a7336-2beb065aa18mr50980615ad.34.1779471286971; Fri, 22 May 2026 10:34:46 -0700 (PDT) X-Received: by 2002:a17:903:350d:b0:2b2:4cd2:e162 with SMTP id d9443c01a7336-2beb065aa18mr50980165ad.34.1779471286487; Fri, 22 May 2026 10:34:46 -0700 (PDT) Received: from localhost ([2601:1c0:5000:d5c:4ec8:83f5:8254:6891]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2beb56f9100sm21464675ad.37.2026.05.22.10.34.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 May 2026 10:34:46 -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 , Dmitry Baryshkov , Anna Maniscalco , 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 v9 06/16] drm/msm: Add a6xx+ perfcntr tables Date: Fri, 22 May 2026 10:32:52 -0700 Message-ID: <20260522173349.55491-7-robin.clark@oss.qualcomm.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260522173349.55491-1-robin.clark@oss.qualcomm.com> References: <20260522173349.55491-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-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTIyMDE3NSBTYWx0ZWRfX8TQ8NI/GINBR AjLnFPFtPQBzOG6FpDRvwFDRtle7aeI1/lr838IjUiM8qySfSJBVcLDUpigHNfW/sQv4+2oN96H JLgb+HkQ0dUT79UmE61cOzveQXniai+bSmc5W6LmuhiCe0i5v7dOE9cS52/nf1wUWwxGJ3A1TdQ eyKn+HpTHLtIhOgpIrRTe4GPkbHjE6MlheQpMrwKjyAz2i5HjgeEpF2v8/0+oWD8Nz4xXU/hlw/ z9mPhOFVxRrceAb+jWLgPz8NkAHZThcI4GFHDLJ4Gwz+NjZulHvz2PfiGP6JGW2NmEoTKTLSrqV i4fobZkl+DtOoDs6QTnxF5Sdso9CJsKicYBsD7SF+rTZkwivICReqLnRFoU2hhX9tkJceZCy4j6 23qYHN4Q1aEUUWd1ehxgeQGVk49Gt6ifY3BpwmkGEaaBkhaqw4oBI8gZSuFS3nLq/N3DlBd88uJ ROpOwHgdSkiuW1cwpWw== X-Proofpoint-GUID: IAWbzBgguVumwPb5C-rdtOakI8ufQs3X X-Authority-Analysis: v=2.4 cv=LNdWhpW9 c=1 sm=1 tr=0 ts=6a1093b7 cx=c_pps a=MTSHoo12Qbhz2p7MsH1ifg==:117 a=xqWC_Br6kY4A:10 a=NGcC8JguVDcA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=DJpcGTmdVt4CTyJn9g5Z:22 a=EUspDBNiAAAA:8 a=pGLkceISAAAA:8 a=tmZHKQuSfWdd6biKE2QA:9 a=GvdueXVYPmCkWapjIL-Q:22 X-Proofpoint-ORIG-GUID: IAWbzBgguVumwPb5C-rdtOakI8ufQs3X 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-05-22_04,2026-05-18_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 clxscore=1015 malwarescore=0 lowpriorityscore=0 priorityscore=1501 bulkscore=0 impostorscore=0 phishscore=0 spamscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605130000 definitions=main-2605220175 Wire up the generated perfcntr tables for a6xx+. The PERFCNTR_CONFIG ioctl will use this information to assign counters. Signed-off-by: Rob Clark Reviewed-by: Dmitry Baryshkov Reviewed-by: Anna Maniscalco Reviewed-by: Akhil P Oommen --- 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.54.0