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 6651E38F95A for ; Mon, 18 May 2026 19:08:16 +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=1779131297; cv=none; b=PnXqHtGb9JrvZOlqWhhJrzn5JB0X1wCX3EDZlXcz+8Rz3EnGOyl3FL2cO0idzg4/Fdgr61ZyO11xmsSCLulWoP1E8BzFueKNwlhG7iURw6/S9+ph5zCjdgL6rwW+JkCr2Mrm/0MEvNQafGW/NrEtZrSnwCKZlmlRH2+Dhppbzts= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779131297; c=relaxed/simple; bh=9I8fbZtieKCx/gmo5Zwh6/QipI3JStv4Oiuy+n8j+nQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LvS9/8g/xTK665yJowzPXFf/jZFjA8lQi/jHZbqMPkuwZVAlxW4tffmWtTW/fkYSiQhFwUoVzMFKaf9ssVVygdpWy2Dnd8/VjfRFLkafoAAhPMdmJ2o1XTkB8IkjFDVEtMvIv/RbxiPOzBLc1A71Ssa/fGPmtmmv7Iv8//3P9Yo= 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=obDBykG5; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=M1oxX49O; 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="obDBykG5"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="M1oxX49O" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 64IHKiYR2685229 for ; Mon, 18 May 2026 19:08:15 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=obDBykG51Tmw9P6mDKolMxrix7J xBiEB7C9CjZuuPVFYtXWUVjndJLAE6MdHZn2XqHR4bMRMPryksQBbjdlPJ3MKKmI Kj8QnxE/0e6XMI/iQwMXQYTHP05UI64gUVvJ8X5ZTdoOP1i1dl0MNbfVQymqWK7S 4ePrkhPJ4p8hCWYv/NAO8mSXLh2EefgrECHmIzGsYEFGXL8kbGD9aPP0MQ9Eplpq Ijctdhl1742NTTkAvE6+CLsiSL7FeJOd4XYJZhTqqEUtswRXWJlMv/L6Qu1rZlh/ i1ac5QTXXUDyNHnadXpnwuLWYFdB0lCCp91ziCBrTbAEgA18dXr6K9WRENA== Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4e7vrbuaky-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 18 May 2026 19:08:15 +0000 (GMT) Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-2b4654f9bb6so25906765ad.2 for ; Mon, 18 May 2026 12:08:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1779131295; x=1779736095; 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=M1oxX49OKXscpyc4UI29Ivmi8xsn7AifetoPBF1uQczo9RZspFGfZ2RwbOz2gxvFx3 A6ruFZiOI6XzY3rkZ9czjvD0B/EFVwXI7K8G3x2oTabOqL8hExluHl1ywMv8/CrcsTZr qOjdWpu3SLicv4t3huhgQQXQZ/QBCrz3lRl9UsDdaz9IWB+OHwgGGIy+8NtNZ8q8h9eZ lcRs/kFy1rX3M4LFJDLQljyxTFeMTjIMM44+A71+muUz5Ym8OacnKCmQuKmAnSLZkL2I 9HImyTd1oeWH126zEQ83Nyo4aDZB7vIcZt6zXPFcTCveXcvVbM/E0IpAiFtFsQQz7A1J YICw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779131295; x=1779736095; 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=eLXOHSaUqsIVcMh8ZsbcCg4CBXaRMzWbrCy8fiv7Tmi8qE8MLUzmO9EAi4IwPrcMZl AEAH8YrO2k5lZGm9mOckS5qdYDVBHCFGn7tMVrhxC/jBwLDlSKx1/iD0Uve7iYp6llMO kbQ/zN2rzLNcVWS5z3rohkqQWTC7g95MnFvk5G8OqsPsnwIwkjSR7FFTF5gi7CsFCw8F f4m9yL7HUaN4AE+u9RoMR3rkI8IPSV9MhiPjIDRtOhm/YWm+I6OJkvu3OXJhVIMAz9SF VsioSk1/QPDTJYm7/HOj7R+ivRsReMdKSn+2bmOOFuR2lyd2m5M7QCvgam/fDLFnUvHQ vkdg== X-Forwarded-Encrypted: i=1; AFNElJ/cfBG0WksfOdaDmiCME4owF3Yeu9SNRKSEKxtjmbc1WFC6rqRE92+Lp655G70BY7taiSxCxoHayRPk/m0=@vger.kernel.org X-Gm-Message-State: AOJu0Yy90jwgxFywPM23mEp+N+5TR4zS14afcLIXYhelLFGq6X1D3kMM Bt56DQubvASZ9gtFFu1PMIMMtSiHPUfuRihEkDMMoa1c3truaUfq0mtkN3EgHblPhMXd0bkN4Dr d227G0UmJ63VaXciKCuBpCy9z822lIGBKNGilPDp7qKkj2VGVoKCBM6rval+ekxaq14M= X-Gm-Gg: Acq92OEgr8K7gEIcxN3aELrNrypSffM1MTTpA/cIS7FH7GoM2SNRML2XqTn8rwrhPqg 0RuPEaw/dSrNa5FKx7eo6mY6xJ66vnC5ClXDmL+03vbFqAfn8r1yhfLKkQfjXdtQ42mYjicI78B 2bR1OmySHXbFdAXY4EIC+0ckxZGU0d7aXgTsnSxogEplma1H9+N3qtfaaDOdGmwMzjLA5ieyVm8 woTGtFAPUVgd+pKb5h+FMOPH6vKgOqtP8NHUDB2BUMgnSFgO8Rw3mNsMMvHjfWjKdvM1xpgGGj7 d5oQZ/fjJI6ugQrda+ZmSRrGmJUC2kJwe8AffRFcamIbgVce8mmmrzPY8gAcHSFmf/rnxaG8Tsn yux9oxkK300eVT+fsj06F0JMRffC4mpLZlgGnaSJV3Ao= X-Received: by 2002:a17:903:24f:b0:2ae:5629:ac55 with SMTP id d9443c01a7336-2bd7e887498mr171542845ad.21.1779131295074; Mon, 18 May 2026 12:08:15 -0700 (PDT) X-Received: by 2002:a17:903:24f:b0:2ae:5629:ac55 with SMTP id d9443c01a7336-2bd7e887498mr171542495ad.21.1779131294566; Mon, 18 May 2026 12:08:14 -0700 (PDT) Received: from localhost ([2601:1c0:5000:d5c:4ec8:83f5:8254:6891]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2bd5d11ce67sm162668925ad.74.2026.05.18.12.08.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 May 2026 12:08:14 -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 v7 06/16] drm/msm: Add a6xx+ perfcntr tables Date: Mon, 18 May 2026 12:06:33 -0700 Message-ID: <20260518190735.16236-7-robin.clark@oss.qualcomm.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260518190735.16236-1-robin.clark@oss.qualcomm.com> References: <20260518190735.16236-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: 5FBe72GjOVOL8bFAa00bIUBXphdpChyI X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTE4MDE4OCBTYWx0ZWRfX7n1juysE0oIB ux0TLGeT3HB3vqV+/v/Zs5Daj3bOKXFnwA0D4RF5qyINwK1FUqchXbgVedoXsLhxt/JS/kV7BAW MB9WeNvJ8akhu5M3iXtAz/EgT1fSBGpoPv/uXanpb/zy33ol9csn6tNLetj/dUxn+NqNdqJ/f1j ySXr5rAF5iK+P4tnTAfyIDiaPCx8w3R6gEOSKTxFV7xv2wn29gUF3oxojBK++xgWqYQ9f9kZaF6 qbOAoKj3noU2+XmJsjmjzcRMan8hUddjOIhp7BG6DxFPy1x2lJx7e6X5HWVIMymF5TRidgqeLfT 2wl40vvWq/zomJ41SFnYubrO4jDelBvF2c++cCQ/d3LDk32HI8humbPwAZp4kT20UN1Ihym26nT h83yV5SmUBXnoxy4r1Fs+8rexgMoQfB+Gm/IjQ9gUtm8QaUwwFlPeFjh+Bv4Xck6xgbnsrNb6MS m6Pn/RL7zIK5y1B3UJw== X-Authority-Analysis: v=2.4 cv=KZ3idwYD c=1 sm=1 tr=0 ts=6a0b639f cx=c_pps a=IZJwPbhc+fLeJZngyXXI0A==:117 a=xqWC_Br6kY4A:10 a=NGcC8JguVDcA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22 a=EUspDBNiAAAA:8 a=pGLkceISAAAA:8 a=tmZHKQuSfWdd6biKE2QA:9 a=uG9DUKGECoFWVXl0Dc02:22 X-Proofpoint-ORIG-GUID: 5FBe72GjOVOL8bFAa00bIUBXphdpChyI 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-18_03,2026-05-18_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 suspectscore=0 phishscore=0 priorityscore=1501 adultscore=0 clxscore=1015 spamscore=0 lowpriorityscore=0 bulkscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605130000 definitions=main-2605180188 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