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 E47774ADDBC for ; Wed, 6 May 2026 17:12:03 +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=1778087529; cv=none; b=tKwzCrkOaK78jnzQ8HrV3NLQXrah58EHS/D4cJdOiVFTtaYGvxkxKUXGeOl3W4LMRvhYivNA8e1zkjokWJtOoemLQ850eENWx7GGiGixX5k6KyUtIBapyRBTBoztxIQerwZqyvH/13ErDjXLreY6A0+dgE9+zuKWp0HOmWx52S4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778087529; c=relaxed/simple; bh=EM7ENbxlrlWP9nDeXhbulykziWmwjg0MWHFUydnf3Gg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qeVlihvnoDDJT7z5nWo+7Dof9qMD23ScUB033EtaxHz9QIDm0QgI9oezjZStblEvY6acL6XNyYCDAvv/iyvWfcpq5YKOZ2GpxzS9CN6XoVI6KjZUJGqYgwZhyr6hE9rA/XhvxP02T8jrYQggZqEsH/6KA8FhxVmZ5+TsIB/KoPg= 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=a4vYDOcS; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=YLLHoXIW; 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="a4vYDOcS"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="YLLHoXIW" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 646H0hcM1953138 for ; Wed, 6 May 2026 17:11:59 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=a4vYDOcSiiN0dP9oZK53PrvzSbQ DrNMA7b5x7Z5P7hOiM/krxyULrnGlBcxln28lKPS1ZFk1SwSRaoEK83B82MG9gea wgHu4ACKegp17Qk0u+5w/yl54nNhTd6MLuzduSYk+GT7DUmMPjqQMlKFuUGXoccv o4YH/lsX7DN9VasidTp0SvECj5laJs4QRdkdQOE7f0PKpZRB3Qd9SC8MvJFYvLlf IKQ5ENPpzB/zWXfwr0vggL0gaq/xdfjlYZW2upDwZgbi241UtEXJmzM4Fe9VyfIY XY8Uy1jekKAzPdlZKonU48jO2MSgUnnrHhHIJZMGLdoddCfX2Byhm1BAGxg== Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4e03jc1mhm-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 06 May 2026 17:11:58 +0000 (GMT) Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-36512f223d8so8885389a91.3 for ; Wed, 06 May 2026 10:11:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1778087518; x=1778692318; 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=YLLHoXIWeGaHKAhxeJMz2tIWK5DH6TWaG0yhGVvPr3F+sklupeZ1X+umrsJ5tcdhNr B+wtpluiQxQysmqy1fy0AYodHYeC1FAklt6xkdcEXfFCNTbGOdq+lkGxKXgJG1DOv0Gp qb55X24IOK5nxZXV/TKIjhHObj2hsTXDOHj/cz7QaOjhh9em8MkKwUVtoscjpMos8X01 He+WxNWixlYikgRh1iIvJmoVE9gU7svKHq2pG57Fk0EfKC0OlNHaWPcnMuGtojE5zxqx B4e5zjycCLEszv4ybxwDZBAtpVV39iYUCjJ1Dai7fGW2Agxq5OG1FDf/Mer3VlI2cp3Y sG5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778087518; x=1778692318; 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=lmuUabkl8dnAPWFMdIb3sO0WbJNNhMwF2HLa6pLbjr0fuo9pgyVQ1IByHUuDa0jgye jQ3oLW3x90UEPvpIePGcbGPIcJ3i/IhK/QtjwNdOXhtP7lUxakFoPdxervoX00XUwee2 yoJDgnrtUzUJsA3NUp5uTf2m2g92Eme3Dc6WVjhqs3nDwFM446eH9vXbHRXU46YUDOtt 9RVADJfI5sEtiJCEgXzVSb+SVkiJmoAABlU3LRGWwkKOURMxjhTnFpWC3eF0uaHwOCQo NaoozH2AZteEIS/xVCq1o6jpYmaYoJokN0utQ+lg3duuEvwV2xVWFVtxM5YeO4t3k0VA 6lkQ== X-Forwarded-Encrypted: i=1; AFNElJ+hf4EowmNX+DBCzdiQub5/U+ZvzRGXngDNmqt0nubJmtq+/UxxGlSkWm49qYWcb5rQcLlqeAViaQHcaeM=@vger.kernel.org X-Gm-Message-State: AOJu0YzScsf9p212xDl4G6ReyBaK7q9I8nfKFDK/gG7YwMs9AU8JOP9p 10B14YnM//l/+Muuv7lWhHKoh87nv6ssogyNGTs48aBrRtapV5avs6BbrEYmTROQBOfDd4DTIRR y0JeOLYBz/K+vnPG/sOpQUt3xdbrZFkMN3rDJmzMeDigvJQxnSvwkOXFekWdN4MS+DXU= X-Gm-Gg: AeBDievdZNUAf1B0L/1lBUXeKX7VyOBqf7DjEo+VhnGTw015pvvOrepJCEbXgFPS6g/ G8ogISX6FZypVPpC94GdWqGDF7QU3kxO+TPjy9w38WBX5rFyI04qzMw689VSkENcHLV4eMLngZy ee3PZfVvl/0phUndpfB4w7FV8Ymft7ZWH38apKGb6Nb0fdoA+mUlE+rz9hMDlQ8e0irttiynOJS UcEW3UWNqUE+UljULX/t3tFOnwKmk7FDMzXA1V5yZHkwnP6HJDUendiqmag87yQd4E3tF6mY36s +YKft2GranG0N9+V1gTaoAAIFO8JZ9cwzTdr7B0K+rkNowUuk1/29NT2h4DrQAXuqSXhABqvpgx dW8x0w/ncriU0pdMyy8ho8DtsCDVbV0zuq2F6+AUdz1c= X-Received: by 2002:a17:90b:4b87:b0:365:46aa:e68c with SMTP id 98e67ed59e1d1-365abe79170mr4073655a91.15.1778087518028; Wed, 06 May 2026 10:11:58 -0700 (PDT) X-Received: by 2002:a17:90b:4b87:b0:365:46aa:e68c with SMTP id 98e67ed59e1d1-365abe79170mr4073619a91.15.1778087517517; Wed, 06 May 2026 10:11:57 -0700 (PDT) Received: from localhost ([2601:1c0:5000:d5c:4ec8:83f5:8254:6891]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-365b4fb5f1esm2963395a91.14.2026.05.06.10.11.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 10:11:57 -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 v4 06/16] drm/msm: Add a6xx+ perfcntr tables Date: Wed, 6 May 2026 10:10:30 -0700 Message-ID: <20260506171127.133572-7-robin.clark@oss.qualcomm.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260506171127.133572-1-robin.clark@oss.qualcomm.com> References: <20260506171127.133572-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: AW1haW4tMjYwNTA2MDE2OCBTYWx0ZWRfX1a7RGt/vFkE5 VYKew8HCzyX8atCr9XUus1yYh3gzPozKJgSMe4jKVSmudZZAFy+gXtX1lLc7o8Ge2SG8HWNCkKE 2XnK/lweUOVY/NtUnUpbD0OIdCKX7paOST5MOruEPc4NW7XATGAF53b1fpHPeyBYfnr0tNMLvv+ B228VR8knU9U7CpOfPOqlROqESA9m/dGTUf4rTNVCSAY62KbpQ/2nI2mG/r9vmu9qHo2E4DsvyM HZD1sBzMQwM/zLXg4pu86lPObTED6MODMdNXBPggA628wdgg8ODJRWMHId2SIa048xrz7Nkw2/Z Q5Wg0E6wm8tAEX9JFIJMVp1/2OahUY2rU8mzh9SdMzEoxYwBnjvWhNyV+89Cf4n6axDu9G0O4t1 fItPF94ElPLoIzxFfy+Fx6uPp7NN8kPdTWIhafzZkow5xovYO+pWl4xepOVZ6QS22BVchZDJU1k SVGGVxrfeYUM2XQzXxQ== X-Proofpoint-ORIG-GUID: uni7NdCcqppzXMcrMTeXijMS_HO7UFBz X-Proofpoint-GUID: uni7NdCcqppzXMcrMTeXijMS_HO7UFBz X-Authority-Analysis: v=2.4 cv=EpHiaycA c=1 sm=1 tr=0 ts=69fb765e cx=c_pps a=UNFcQwm+pnOIJct1K4W+Mw==:117 a=xqWC_Br6kY4A:10 a=NGcC8JguVDcA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=EUspDBNiAAAA:8 a=UuwE4gOO9k-hs8zF27AA:9 a=uKXjsCUrEbL0IQVhDsJ9:22 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-06_01,2026-05-06_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 bulkscore=0 priorityscore=1501 malwarescore=0 adultscore=0 impostorscore=0 phishscore=0 lowpriorityscore=0 clxscore=1015 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2605060168 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