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 4E56636B067 for ; Wed, 20 May 2026 16:25:30 +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=1779294332; cv=none; b=cPYpZzrszNfFbO80PW6rEn5vccPjJg+3o1c6x5CT9x01B90QrPEkELAwIiVT8dF9QG/RN53z8ryZ6dO6fWap66KXHQ0FoRP/sx1E0X8AEdF3UR61CjQwFjRJo0B+ZLb1JmC5gpiC7OyJsDVNSD0qNS2kXT3ZKSmRsFzvyzvaKTY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779294332; c=relaxed/simple; bh=A6F5qReJDJgGgECAx/he/Gp+PHKgzH5mAl7LkVSzXqw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DVuxGW+ac5rMrAo4HYsijcqRBYbAcrVE2yBsVF8iaOgseG5Rkn/gTMTstexiAPhsbRrvtcaPMQn8XhDmaxBC/eTkzv9JjKK0YFPNbjkzZOHxnBXhz/7YKQ63VVrbIDIfHEYChlxcScwMclkBaLTeapM2Q0+LrrvZRM7rWKEV1T4= 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=iFnma6KF; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=OwcF2GY/; 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="iFnma6KF"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="OwcF2GY/" 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 64K9nm02447958 for ; Wed, 20 May 2026 16:25:29 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=iFnma6KFpjfHQwCvKa9dKg5g4oi 6huJvHDvSuAhS3K03qgn80WzB73AmsXS41pD43k7kETTl9GtIh19uC+UzHn2Cuzv 7B1A1WS1CCXleHRg8nLU+UIBpEbJky//YPynDPKivBGngzjAIpb5GcNtrIFLIK3J /owtwv7ChEMLwkVmcRggcoUZtmm0Xri49bJfAxCovC0GMlcSk5SPMWZRE0jkisRx NFQmuz51khnH0oPI62wzj6G4vOf+J/hA0SFZ5RYqNpVP6syyjmE0zpfGkGLhfwQl aawwdOnhp3CteSKb89k1cgDnX5gnPEioRAoyGkoyOJM6q2SE25+m22R2jjQ== Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4e9anrhj47-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 20 May 2026 16:25:29 +0000 (GMT) Received: by mail-pj1-f72.google.com with SMTP id 98e67ed59e1d1-367cb6de61aso8962139a91.1 for ; Wed, 20 May 2026 09:25:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1779294328; x=1779899128; 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=OwcF2GY/eAeft7UH4xe2u/jOt83QmDM1smo3O59yWmzp2N+Lk7Ul/oUnx87VJ7HbKA zj/MJn0vKqPyYxZvILxo3tJHA6aN2tCdkQ8ncZjhRGlCY60rLi2xrg65G7H0XmgXQaWg w1mkiglOIA2SefqlTHy1+y9Vo5W1ZNPe0MwkQHH6qdPonjAbMEgL5tJy33tcigCnF1CY GMjKW0s6w5qTkXwXGBXzk1r44k7DYHHFYi9WCRaL7yup44PkUmS7t/ggtL3IoQhEVUMb YwLkiVo+SDYdW//tENKpVljfr9N5s94D3RvvxkPQLfStBVlmUlSqHatEjGbNitrOwKeQ sduw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779294328; x=1779899128; 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=eUrNQ/rJadBTR4hq586heu2f0hg1es0QT4EmcaW9VSal6BQvzwVAFgfE9bWB9ShL/q 7a+H16mwSLHCNeEtYXqgQYvXvL+xAV22+2z5UfUEYZuebZha3sXMDuJa7kdsjRNRkWsk tIso8kfHFP/0MRk5I0Xf0Hs7l2KUhfX7l4qE+lDXcG3dnr+otsqSJK9Q0zl8jtzNBmL7 aUBZfGrMuujAUKES9wkRyw5znGmrvHluc89EHXby+kHc95Wn0IFgyWHvxD0D+CAy0JBj lreqi5c6BxL1rmbyjsVTPZDH0u9KeSWoR1j84jpwAD2iHFWyRnHc0YuTo7reKJ3SwKvq auYQ== X-Forwarded-Encrypted: i=1; AFNElJ8bRIq80WyBhjhIsP+AJdiURltzQzI/jYZ9fulRRlhvSp2dKrKn2i32s1aMT5UtuJRqtfXjzS/KSaZKDMg=@vger.kernel.org X-Gm-Message-State: AOJu0YwP8W9IjtYpH07rDnQslCCywbMXj8ubpBdq896oHqpCa6zBXwvo uvK4lNluxu4Ysif5Cxyp9zm/PtyPqTRqa1FvOM7pmjsg9Ljf5XRGGGppbbgLG5lDtikrbW2ndty FjumJ/Ecw1dDc//xfYTdmMNruEVjtJxcFLDNQ6xK21j2BSn2emEvBKFvvogKYT5Ag1uo= X-Gm-Gg: Acq92OH6Alo/FEVKOBprvKQGtWnT0nhw/4wrGbUVGOxYygV+s60pgUm5dPaLQWh/Nix FaQaY3WBj1hDwsel5PduZqPu8nBP1NGgTEq4MeRjg7huYNjs/3Hdjt2NnnT5opgQcyZ7rI5dG9o h9CTknt7TyKlUQkMDVxE3gtwxeuoJMPbFDzNi5e6d3RZct3vbT/NbL7eF4Nnft/+qsnEPN1cFPK b5UPQT5DEZm4sHtVKTKSwbI1N4OFPYOL7DorRWZctt079PR+DwWQ/7FHoZL6tx+3lNzs/ATUwq0 G1nQT4N8IuPskpira/+ZuZl9Kxh5mBa9rCQUX0qUgTt3uqlrEPwLQ/0QYbZvUddRzB5fac6Tc6d NzrV5Le/JWPogJKwor+NRrjSDOP0oX2mO X-Received: by 2002:a17:90b:53d0:b0:367:db13:aca6 with SMTP id 98e67ed59e1d1-36951dc1cc3mr24889539a91.26.1779294328096; Wed, 20 May 2026 09:25:28 -0700 (PDT) X-Received: by 2002:a17:90b:53d0:b0:367:db13:aca6 with SMTP id 98e67ed59e1d1-36951dc1cc3mr24889499a91.26.1779294327641; Wed, 20 May 2026 09:25:27 -0700 (PDT) Received: from localhost ([2601:1c0:5000:d5c:4ec8:83f5:8254:6891]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-36a3cc56cddsm114371a91.6.2026.05.20.09.25.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 May 2026 09:25:27 -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 v8 06/16] drm/msm: Add a6xx+ perfcntr tables Date: Wed, 20 May 2026 09:23:53 -0700 Message-ID: <20260520162454.18391-7-robin.clark@oss.qualcomm.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260520162454.18391-1-robin.clark@oss.qualcomm.com> References: <20260520162454.18391-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-GUID: 2lp0e9P7-bmuwLm_mM675m5puNnna6_d X-Proofpoint-ORIG-GUID: 2lp0e9P7-bmuwLm_mM675m5puNnna6_d X-Authority-Analysis: v=2.4 cv=UuJT8ewB c=1 sm=1 tr=0 ts=6a0de079 cx=c_pps a=RP+M6JBNLl+fLTcSJhASfg==:117 a=xqWC_Br6kY4A:10 a=NGcC8JguVDcA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=EUspDBNiAAAA:8 a=pGLkceISAAAA:8 a=tmZHKQuSfWdd6biKE2QA:9 a=iS9zxrgQBfv6-_F4QbHw:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTIwMDE1OSBTYWx0ZWRfX41rjbf71tKk7 v1GfDHY+VD1AapKODimaOEKtQ890Gsr7k493VNkMO2fjmuuqlPgABbCJwHNojoV32iSWFI5Kpre 5/GalH/rB1E+CmYnlWO9jZmHi+FSx9bYF6OJ7WelFPiGI60jlDWDZ3/vzQPZPQzYvOS+RqSHFDM SjLTCHsMmeWK5mH2zSQhnP68N4uvRNe8B0P6aLJbOMCgG9LRHrdSFdIBO3FYB80zJJ+OOyf+e4t a4FYmFZYn1Y05RR/ukEcKpiGuStrGzX3IzTBoqP/iBOKZK6Ellz6n5lWDEJ9K+XIf6oPLjgyheW Ogx52Ky5srq9QPFgFTNEGXwgPZysA9SBV1c/t4agaooaeVBHOTLhAlqkBD27KtSV31kyVPo6jEd heirxSqqJJOq/1M7GWTRFDlyZZoVyOD/W+X2PudloVCYnbI1AmuPWrapaUJQV14233TNzmDAaEM CGG1LVTQ3iyxy0nMfSw== 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-20_03,2026-05-18_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 priorityscore=1501 suspectscore=0 spamscore=0 malwarescore=0 bulkscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605130000 definitions=main-2605200159 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