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 B9BAE3EF0D2 for ; Mon, 4 May 2026 19:08:33 +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=1777921715; cv=none; b=DyaJcLfSUvJp3fv2ejqhNyBAFpTI5Z5AOcvNdRbzFknVovzbk9JiJHL9GmhBL5t8wMq/+iS8N3oko9Id10gLBJbBxJNYRi03jvMmRGsnjnpAb04qlQUqL7ad79Zl7tNf0WGPrkJE+JtkWMbaNS6fgtzsiyY0mPRGRXAebjU2Gds= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777921715; c=relaxed/simple; bh=EM7ENbxlrlWP9nDeXhbulykziWmwjg0MWHFUydnf3Gg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Vurm7uvLj50WOcXQ8x2XRsaZgwgIsD5Riv+ctf85jvIOrI3UeQwD58F8EQ2Zp3zUID/CEHVx34E2/Ze1whnYuVRjRHqwaQOGNfLZI3sNM0WgOvPJQFC1ybXWSNElkzeE1KRT8IFU1s7aELSFCfiUbUCQ+fpCE2TV5bpkxb0PwSo= 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=AYBo1g/Y; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=RpW+Ytv9; 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="AYBo1g/Y"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="RpW+Ytv9" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 644E2hsA1186849 for ; Mon, 4 May 2026 19:08:33 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=nY8Zf16hfaV mHNExd3/Edt40koDFD/E4yWO1TVKH8HE=; b=AYBo1g/YCo07xifCZTxImkFEyIs 2CaoxM5v8ho7UJ80SVUJtQe3XnGk4Y/BnxMSAUDIW7OZMkz6wkNvWAAeIsSVrRtW C49FD3Mm18cWyeV15R+LTHzHFdv5VR9LXudxlxiv+3Tgu5ew0Jw/9rl3okv/ef/F THPKLSc4V99ZtapUriKLLjKMB7zni7Ag4tKLMTEONo0jaiNCu+VDAX/tZXwJBYCN SXPJ5EpJDki7IjqzNOWjzNNQ/6jDQ47VmsvyeSIZPe/gbxG77R8a02het5wrUIfQ KQCbPdKQzoNFCiTd9Jqf3NsPw5r7gBl/ySTiEaTGqXGXEvj2S9hO6sJNPVQ== 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 4dxvvg97ec-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 04 May 2026 19:08:32 +0000 (GMT) Received: by mail-pg1-f200.google.com with SMTP id 41be03b00d2f7-b630753cc38so5853284a12.1 for ; Mon, 04 May 2026 12:08:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1777921712; x=1778526512; 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=nY8Zf16hfaVmHNExd3/Edt40koDFD/E4yWO1TVKH8HE=; b=RpW+Ytv9BKJjhBWYG3/oyFm6Hq9A3W/r5d5Fwq3WRuni4L55pu1TqWsV21J+GohFl4 KQkYPMz+WayZXWHtDBr8UZPv7RCOxRPt+sEMuoFn+P8p6hfHlhf1hdOu4C9yWv/a90vh vEH9cRuvNrsJMWKV+AGcD7rVHKq4bPNn3BStEI3hfnI7k4j4TDtvluiDoX94K7KF2eSC 5oyBPPW4xOhzWZSSC3DTPoSeHWkOTmgN7nBi17eEVv4FHqNwx8UlPF4RQfZoiQEHN/6e T1NxlSKt8l9mXdMgCXVFzWKe6oEqxrKPJp9vlr54jk6kjpA/GS0T0+wIDxqeRG6Gk0m1 uw+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777921712; x=1778526512; 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=nY8Zf16hfaVmHNExd3/Edt40koDFD/E4yWO1TVKH8HE=; b=lYpPsMg/Y08k/HD0vzH1lUuDvHFqh1y1DYHJmpzns1hAii1ZkdICt9xn6ipiP22+qr i8MyzejQPkdXbs15lTad0z1uaiEkk/IyvtTmFJG6D+r/Qb7UfoV7EhKc8gTrHBVSHnLB XN+Jk9lYf++z0+Yx/ADr/6KofSXHookCfquQFvAn+pcPQkwoKBCUcIdbu0wHrALrm52/ T4f2sqmgqDd0XLowoIQeqoTnQkVNS+x9nzJq8nPfSbNWlUNwd6mvzWlK/PuXUj3ZeftR Cb45A3LF6tKk8uboFyg6j+66On2KxVnp/Bg/bBNzIBx9dnbtllTDMh+/VumqJzlaxGPI xShA== X-Forwarded-Encrypted: i=1; AFNElJ9sCu7BV9j3wBgZEKD1n1g2cxiDnuSY821tTsCNkMeWT6hmdZzb1V49Zyj8dwJWo2FqeltKctrSTy5H4jI=@vger.kernel.org X-Gm-Message-State: AOJu0Ywyxaqoi9XBc1ltxtP4U+9oJpK5CPWPt/E9AdMKTjFipH5XLCU3 V8k8wR6T8vKjjOn4DMK6NOCJHEfLCcYQSzNhAigB8C4Qx/Dk1X4ni6kGj7Ukevmg4/nNSSyls7J 4XZNdw+QbZqG0DaEhYysKGQsG/Y+UruVvuemHCByux6zvHswtJ/1AAkyYqXmwnsHPq0o= X-Gm-Gg: AeBDiesDeVxkzTo33jPLTjXn7cGC1Ir3niM5QWg/jKs2xkKEzK9jEPfIMturxH+L5uh 18D+xXN6L9f3ZgWNIKijzRRhQ8SMgmXL7+1EMLGoeQLzj/20SDLjvYUCvpFPyujZH3s6RcvtRFc MZSjAd0ic+yVU9f7mNwXj+NszhZ/B9ldA28xLZsrAvYxapxhnqGwgEGZzKgB5mc6ZtZ1RIVyfHZ mI0zoankgtWSvtLoUL3aQttDniKNce3laCA1J68d253UYMaK6adgXavhoya905UXhOv/K6uItco kY28ta4p3ASVTXvajGJROHuiDug4Qqi43xWV88jFC5JNNVrIwX9Gwg0IiTgRovHBl31MXTly993 sWrj/InlLkdL0SucCmgWy8hZa2yOjH8qzXo6ZbDUZTNo= X-Received: by 2002:a05:6a20:4326:b0:398:8870:b58f with SMTP id adf61e73a8af0-3a7f1ad133amr11856276637.14.1777921711539; Mon, 04 May 2026 12:08:31 -0700 (PDT) X-Received: by 2002:a05:6a20:4326:b0:398:8870:b58f with SMTP id adf61e73a8af0-3a7f1ad133amr11856247637.14.1777921711051; Mon, 04 May 2026 12:08:31 -0700 (PDT) Received: from localhost ([2601:1c0:5000:d5c:4ec8:83f5:8254:6891]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c7ffbc8ad8dsm10017506a12.23.2026.05.04.12.08.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 May 2026 12:08:30 -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 v3 06/16] drm/msm: Add a6xx+ perfcntr tables Date: Mon, 4 May 2026 12:06:49 -0700 Message-ID: <20260504190751.61052-7-robin.clark@oss.qualcomm.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260504190751.61052-1-robin.clark@oss.qualcomm.com> References: <20260504190751.61052-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-ORIG-GUID: joNNJ_PWrgoyDQ8Xu_Vycvu2eb-RlnvU X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTA0MDE3NSBTYWx0ZWRfX0i7+0Mz5wl25 W366usL6JS4yoFQ10TSJlKXK20fMOxt8flMop0GCLzVK8Aw8gW0BYeCa/jypSVpnT8bejz0ugtm 9AHvrfh6E4Tk2a/pAv/qgBtWJymBIGBfxNm8ObjfbA3cnmDoCLTFDOuzwgkAETQCos+KlM6QEBn DmydUN4C+xAbSVGW29uLX53lhnDifRYppy06L52+qbQ4IoxrcVXsGaw2g+NMQStNSgn078HKl15 SiXQbNNSnzWLOG6xeoe/5yMoMKcIsDYNK0/YCh+0i8+MwUNW0XY7hdPpagZTyEy4Aza3Y4NX2xm QtVx7ukCkZxv9SLbX9aPq+TT1ecKZoQj2kTjD37aAEfhAQTcb2yS0JZx2OmGdysL+/Y3YPcHs/Z zzOs7vLcuM2WU4gQNO+UwGMeTD1tu9PkpRsEmx7NYb2WWuVYjMIQ9itNLVSIr3SG4zzSmN/QEHv AM+PHLfkdYpDFKDLmBQ== X-Authority-Analysis: v=2.4 cv=K+AS2SWI c=1 sm=1 tr=0 ts=69f8eeb0 cx=c_pps a=oF/VQ+ItUULfLr/lQ2/icg==:117 a=xqWC_Br6kY4A:10 a=NGcC8JguVDcA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=3WHJM1ZQz_JShphwDgj5:22 a=EUspDBNiAAAA:8 a=UuwE4gOO9k-hs8zF27AA:9 a=3WC7DwWrALyhR5TkjVHa:22 X-Proofpoint-GUID: joNNJ_PWrgoyDQ8Xu_Vycvu2eb-RlnvU 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-04_05,2026-04-30_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 suspectscore=0 spamscore=0 adultscore=0 clxscore=1015 priorityscore=1501 bulkscore=0 impostorscore=0 lowpriorityscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2605040175 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.54.0