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 3D36C3F7AB5 for ; Thu, 14 May 2026 13:54:27 +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=1778766869; cv=none; b=omydwpwFJ/OrNKB06bBh8THNXdvDryfXcv5I0AkeQ2k5vQ+3rIVLr3BUFN5CMnLckBFsywiqIM3OIcw48A3B/bnGieXnY0yadWOhPynWd/cl41DYA7O7QoEOwzszG4APaRyYdsqcig4zcVrM05/Swbt1GICndqyI9vePj31pmFI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778766869; c=relaxed/simple; bh=9I8fbZtieKCx/gmo5Zwh6/QipI3JStv4Oiuy+n8j+nQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gLdJMOm/iGUZY7f+tkAUK/bykzqNQgDfPSwXBhKT18sWINbMbklbeR3W9Ja0Su15mRNcpaZLpA0Px1MIN7SPnvqx7Wpmjfl1rKyIHInf7zchCSiHec93O8LLC8mJ5f7xy/DJoGlR0nBJrhF6+wqp7OXkeZXxvBqKGsEvgxtMOF0= 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=k+qM+M/Y; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Pw/lRn8t; 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="k+qM+M/Y"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Pw/lRn8t" 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 64EBeWEL2841099 for ; Thu, 14 May 2026 13:54:26 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=M7rs8SEMK1L Qu/2/xiK9f0eSs0YeYPU7CAo4VX+afCA=; b=k+qM+M/YsSqPCOCcTYoJhS0HWd8 aIrB5Q3TZRg7rJIvbL/lo1ZRFJaPLj7D7x65Yjfz/CFmN8uTb1RFSg+VTbdPdHv+ /t1rdCgQjLOLq6SDBIjU6YWpev9tVeq2RLgU5HB+I4goP5KjNnASoRYdMj9Vru5Y SIfNmrB7hCY4QrPCbZtA3Yd+j+VxaMcXGUuaREBE4WIaeznHYevwcO1T2f/WD3yN EZvzJV04NiYvkyjoO12UupXJ0trXjoonJyElI9GeDC70QrLG1nbK8KKSxj5hHzfY vS8Sux7HdgT6SmeXmpksN/0ScHCJK5hLnmsLphlIFWAvXk5tdPYQ2ngWK4g== 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 4e5899sn5w-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 14 May 2026 13:54:26 +0000 (GMT) Received: by mail-pj1-f72.google.com with SMTP id 98e67ed59e1d1-368ac44b26dso3833313a91.2 for ; Thu, 14 May 2026 06:54:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1778766865; x=1779371665; 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=M7rs8SEMK1LQu/2/xiK9f0eSs0YeYPU7CAo4VX+afCA=; b=Pw/lRn8tEKTze70e2uinZfM5+vfu6uD3Se0FgipQ8UJnMgYEwROBgFrdvPY1boIjPC 8dY0s06zcDw2bRidIAZpiFU/d/MtEgQ7TZWtWUMrDWn4SOWzvUyMoNF3yzd5m2SQiX2P u63tu0yIcgNGF7hqjv/yMVu4ViJcfhkybQtLmlqBTF7kjb1p9mL59ZSM4Q4t85PR5oVy qkYYlV2HwfinC46Q9hkDoXLevIImtveeRwBDpopkSG4Yba5kqFOi7K9voywdoZQQdShO 1aCv4echOm7TUJdinh3xF1stzIfK1S9hbcDHgnAqBhzIGnfIxHoXhdCRxRio+YGjTBl/ MibA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778766865; x=1779371665; 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=M7rs8SEMK1LQu/2/xiK9f0eSs0YeYPU7CAo4VX+afCA=; b=gEhDyvIjPKzaYbWkgZ0kQet1kZA8GnB+N3v+V0iyqWa8KEK9I74lZzYmNCRxvFmZjt cCXAVtuWQOBVhzurtPVaZ5qDTRZeQXEhO7qhXsydtyebVldHpgrfhMI52wVOTVExErqe lb7skICGpCpnBoV9ORzmzo6zM/aS/Iws70Y6i8aQIsJwDKO9F1YVXVXJ1OxX8DTYJ4aL yLepK0T5a0VzqTZyJeDzl+qZf7SoTcq1K8jPzOpS5F9D08ic6v7SzvwrcUJJ9E9YrUGd d6Pj55ftMm/cB8GmXGt1hJ2vPrNzdpbI53ebnIzpHk27VVaQIGc0AhIY/7JaQvNNH6Ue FjRA== X-Forwarded-Encrypted: i=1; AFNElJ9egE1nxN3RZylc7mllJqYAbiQv/DSJy2eU0tyw+YjYdHm7RLTTgZPOUg8HD2hLNRBdti6sz7i/QHWia5Q=@vger.kernel.org X-Gm-Message-State: AOJu0YyXl+X06H2j7YTVUOmesfkx5XXHMm/7I58SibepxT7aOGfNHH/c imtHM9AXUdFBclbAOzjLGPmgkuMuKwXDhRYEGQGQQvOFOcF0z0S8SuBH+pAkKUM+QVaSvA2PS/t vbyYxF3gidtKG/71vlH+dMwMYJJGtDv1zbUbzYT+EX+MJ8UO45elxt8t+w/rtoW//H1A= X-Gm-Gg: Acq92OEUblvgoWqrDluZbeyg656AEYdKQejGe1FDKBtFx+LbPtL4Czgm9JiC/nDwClb P0nCKsszwQhP+DV6MenCqxBYYTffGY97fzTTpCr2z9On2UMXEtpP2lXCntLqBCI3s8JXujoau+j nl25JYrjiGne2uQb7I4wrHtfUd/hb2F35eepZtgkrWiXJ6zbVotFhy9GcJEkWk8tB+wpKH3NRhF OtjupScNS1oL9Mae8AZe88pXzCVSIhJq4UGzGSRubsWAGbUH3WyN6kaLuAcIM1Zl5JzHv4IrmLI O+ap7yGFjg7mfYXuDGLl5ZViOOZZBaq5KWiV8sK9Vv94msHm+04XVhmbfaVzWFx5Z7N8rHRz3tx etPYGUIDq3hPxWngjhE+dKmoIrA/+kMU2 X-Received: by 2002:a17:90b:3502:b0:366:d9c:91dc with SMTP id 98e67ed59e1d1-368f77c9859mr7089983a91.5.1778766864975; Thu, 14 May 2026 06:54:24 -0700 (PDT) X-Received: by 2002:a17:90b:3502:b0:366:d9c:91dc with SMTP id 98e67ed59e1d1-368f77c9859mr7089919a91.5.1778766864338; Thu, 14 May 2026 06:54:24 -0700 (PDT) Received: from localhost ([2601:1c0:5000:d5c:4ec8:83f5:8254:6891]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3692716c2e1sm1627921a91.2.2026.05.14.06.54.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 May 2026 06:54:23 -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 , Anna Maniscalco , Rob Clark , Dmitry Baryshkov , 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 v6 06/16] drm/msm: Add a6xx+ perfcntr tables Date: Thu, 14 May 2026 06:39:54 -0700 Message-ID: <20260514134052.361771-7-robin.clark@oss.qualcomm.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260514134052.361771-1-robin.clark@oss.qualcomm.com> References: <20260514134052.361771-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: AW1haW4tMjYwNTE0MDE0MCBTYWx0ZWRfXxEv+1X6zDSFO rjDaibeuBGo57vvh661tjjL1ovuUs1Qu6auu7MCtggtX/4Q2JgWJn3QEAbXQUJdP0obCuYprGiL F3Sr0VuzAO7mSDQkJIWcueN1JF0BsnubruXxV73NW+R3CIpKkFcumjZ8yu9wDWzWNNmoyzGodmW akwtkF2axx+WED4KNpG2wZz/l/f4Apvw+rnxM1HO2GHoVUO2mIx9/gtWt//HP5zuahjq0MCobx+ O3kV4pdSRd10R4DDWhqAgXeSlsNwPQ/C+7dKupcTl6Gt2cRRvK83sGe9qFomhJM/26czqYQzczD VryzG2D+DR//VQA4Qd4QRiJiUxWjZx9J0qf5E5cFzHqWpz0TnTsSh7I/LCSnMNW6WDlvPhKijvo XAl2RMIX1K2afM6J+3/ORErQEgWqcPVsUF8HogM7kkvhuCsZt8mXqePBv4wWBcXXkTcUG6ihjCm QS5XyxCOsxMAbe5xBBA== X-Proofpoint-ORIG-GUID: bfWJIHJuc_pFviAVyU_Lp30Dty5atiq0 X-Authority-Analysis: v=2.4 cv=N6AZ0W9B c=1 sm=1 tr=0 ts=6a05d412 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-GUID: bfWJIHJuc_pFviAVyU_Lp30Dty5atiq0 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-14_03,2026-05-13_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 priorityscore=1501 bulkscore=0 malwarescore=0 clxscore=1015 impostorscore=0 lowpriorityscore=0 phishscore=0 adultscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605050000 definitions=main-2605140140 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 --- 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