From patchwork Thu Nov 28 10:25:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 13887855 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4FA6815854A for ; Thu, 28 Nov 2024 10:25:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732789551; cv=none; b=gNs18nRj+3WoLYScr02XYxmILzymbeFWbyzCz12d7/WaPK5JKa7jgTz0S6w1Qhy6uwY3yVqpKV9FdmN5THvXgkiSyy76GvA2fienP9ngrOl6mgdQHN/bDxEemvKFZtYtESZ1wl+12WiySVNw78e1kdq9Egis0WDRGmIxRG1UxKc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732789551; c=relaxed/simple; bh=vsEtJhqxnbLwiKyoTF80GGH+V1VYTVJylLP0loUgqSU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=eTO3x13AkpZ7ccIr1bR/UjWScJnPG0gHTqmVwphgJBeX1Sk5VUPUqPrRJx/ywAoXEKWdray2Eu7R6Mdb16dAhYeccHgNSBJRkqfQdBVE0hRb5QDZgpbwLAKNtD5H2FmtMOHM4miL2zUYl0PuBgp3TeRlRpMtiCgm+HRO0XshnKc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=zFgG/7Q4; arc=none smtp.client-ip=209.85.128.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="zFgG/7Q4" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-4349e4e252dso6031605e9.0 for ; Thu, 28 Nov 2024 02:25:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732789549; x=1733394349; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=reoDVbzQsiSf/gPv0A34FrWumLX+gyEDCSO0BWtsisc=; b=zFgG/7Q42juePtAqz6+rjW8MhJDU8ePUopqFhQonszGOLxbIzaIHiJHIoUFA0FlIu2 /fJ+DDHp8hmGJotI4DlkLlV3EtFl6XojutEDbLG5tA1Xb5YX31FhtthQBMbrvX22ye92 DDdJqeRbdCbta0O53vKSUmeNnuXXyYMjObJJCuQndZByfsv9Hzc8MzDa7AjERJlMuMXC fig6FuHaxUiejYoeMnvYuySoiKx/AtziWY/+029STv5MzSXJz2gHGX63XG8ITUUm5I1T miRWEJFMrqUO2dEDR65ZP+PW3ccf8R8yTxz+ZwNzjgaDT6o0WkPX/fOqk+0xRkyBLc7L 9DMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732789549; x=1733394349; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=reoDVbzQsiSf/gPv0A34FrWumLX+gyEDCSO0BWtsisc=; b=mV1Ukd2DBKkBs7YrMZnG/sQYNXF2d2C04UWJvgFQhGZKVMk0/z4j/pTS3JMifgm251 k0R+oXbGx9FQ+apdYf0i61WVtaMJZ6KJ7pj3jZljCanj4ckOCo/yZIEsngo9F0Gz2NOj eIc2+wJtvH7Z1bRNkkLXGUD1J9JDFFMR5y3K2Vm633yvTThw04WJWuGZ3/f+wX45YwRC t91HcoEo1brupL4wNpvkbCwJasy/ZeN+s9CrAiozamN1enJypic2CddbrWngHEGRhdwV +JU6Jj0cON2ItiXqtHuT2UN1PUdlGkT9LSqVRA4k5CmFEBFJvyAfMu9m5kvsOgLREZk6 WLiQ== X-Gm-Message-State: AOJu0Yxn3kfm25fi+dD/2omHPfgOp9wInoNzIsa6P05b18VUXtLsJD19 tbDcv/nbxx9Ge6gTFPAtoUeAnUtKwrGu6sUSEtuWSMezq5o6QEB3zkyvs9AOdzE= X-Gm-Gg: ASbGncvhVND9NJPEgctE32IRbF0nWp/exaLwu0OrMkjD+urmad2VdwO74DZP1QetfiA lZqwQONt/S56xTMG3AjUOkuea4BsFLhzGiTt/4LYQ+wb1rA2Q/1U2mIIJYUEGuXiSQUM14RdfVx mvPeniJI9lhGZElWhOj644KesIQypO8nPhcfTbvcomsjzEhzXsbYWx1eqzl4R3izDjbFh+nqVcc 8W04ZAxDnH1w3A/rt0njGb4AcvQIa8HNUvQYb/EAdtgzzW0YZ2sFTbThBmGGPdeiOnMHAA= X-Google-Smtp-Source: AGHT+IGVIJCasw1w/lv4nzEi6y4n3531XuVT2EDn/i1vSfZn52Q39Pj28ZjDj+ocKgTB+1FjYDEvjQ== X-Received: by 2002:a05:600c:4e8b:b0:42c:de34:34be with SMTP id 5b1f17b1804b1-434a9db8393mr69151985e9.3.1732789548697; Thu, 28 Nov 2024 02:25:48 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385ccd2db59sm1265909f8f.11.2024.11.28.02.25.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2024 02:25:48 -0800 (PST) From: Neil Armstrong Date: Thu, 28 Nov 2024 11:25:41 +0100 Subject: [PATCH v3 1/7] drm/msm: adreno: add defines for gpu & gmu frequency table sizes Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241128-topic-sm8x50-gpu-bw-vote-v3-1-81d60c10fb73@linaro.org> References: <20241128-topic-sm8x50-gpu-bw-vote-v3-0-81d60c10fb73@linaro.org> In-Reply-To: <20241128-topic-sm8x50-gpu-bw-vote-v3-0-81d60c10fb73@linaro.org> To: Rob Clark , Sean Paul , Konrad Dybcio , Abhinav Kumar , Dmitry Baryshkov , Marijn Suijten , David Airlie , Simona Vetter , Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Akhil P Oommen Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1341; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=vsEtJhqxnbLwiKyoTF80GGH+V1VYTVJylLP0loUgqSU=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBnSEUn67+M0ZML1AQ2Cu12caF1aO4b5n+ci1RzZfKS W1UiU6CJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZ0hFJwAKCRB33NvayMhJ0Tk/D/ 4/1hGwJ8vuHp8WboZb5xYxpLSFr2w5QWVfhTYJfXz3uYFf09IKoQt1rD0qqOYKUrioDRVPXnOvnfEC gdYfqAzokrpfBrJ1IDSdDZL+bMw1poelWVWdr/UDO+0q6ivtCgTxe2i1toSmnHE+ccpXigknc2U1iS 4WecgJfwi5zaxlqGStKnjZ9MxeJrP+tdi4VW0ghOInX7WgduaepmTAgesQ+Rpwlan7bVaG1eG82k8V /vqsiQUlUWnE26PhWF3K6eNPhgJfD3x4DFGKxo3eqS7dmDvq3d7qNtP3hbfJVLdrdGwkk144aPe0MS yVH1y4I40NCPtp7OnHEKjXgF9xJoLRbyT00Fb23tJMPethBjIJpk8WlY65znroi+j3S1h18DId/rDd PqHbmxcxetOWwL7/3XxDYrss9FqK+Zex+tDk6DRcaWhyM498GXdx19lvKJv8ND4HZx337ctJvhESGI ufv7C0e84+6RUTlMZ/lZ5BBEBsCbh1SDOh01uiyiDNT8SuBt7hIW5oYwurg6UTtd0TUG8wAyOzI2cZ wIMDENQbTNcZRmSUhpzL5Yje+OU3Vmh6qIR8MBF9VDeKTKv2XfTwxUhgDqqDexHTA4QaQesWcGgPNL B5Zxk5qKmVc9bmnZjA+xVsY2XGnYSD6O9w30M20cCS0NRrieE9AwUWCgXaVw== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE Even if the code uses ARRAY_SIZE() to fill those tables, it's still a best practice to not use magic values for tables in structs. Suggested-by: Dmitry Baryshkov Signed-off-by: Neil Armstrong Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/adreno/a6xx_gmu.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.h b/drivers/gpu/drm/msm/adreno/a6xx_gmu.h index b4a79f88ccf45cfe651c86d2a9da39541c5772b3..88f18ea6a38a08b5b171709e5020010947a5d347 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.h +++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.h @@ -19,6 +19,9 @@ struct a6xx_gmu_bo { u64 iova; }; +#define GMU_MAX_GX_FREQS 16 +#define GMU_MAX_CX_FREQS 4 + /* * These define the different GMU wake up options - these define how both the * CPU and the GMU bring up the hardware @@ -79,12 +82,12 @@ struct a6xx_gmu { int current_perf_index; int nr_gpu_freqs; - unsigned long gpu_freqs[16]; - u32 gx_arc_votes[16]; + unsigned long gpu_freqs[GMU_MAX_GX_FREQS]; + u32 gx_arc_votes[GMU_MAX_GX_FREQS]; int nr_gmu_freqs; - unsigned long gmu_freqs[4]; - u32 cx_arc_votes[4]; + unsigned long gmu_freqs[GMU_MAX_CX_FREQS]; + u32 cx_arc_votes[GMU_MAX_CX_FREQS]; unsigned long freq; From patchwork Thu Nov 28 10:25:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 13887857 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8A86F1917E4 for ; Thu, 28 Nov 2024 10:25:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732789553; cv=none; b=uPLpIXOOqExYkqdc1IlDq/sP8mY1rblhMvxgWUSDWYlhwPOi6BX4rpY8tTduBui7pAJiUU+3fTTXA/iz5C2zxDVCH6NvnnAqxuoSAMzV7rs+bg8va0V9JHWkSLNwFSHGHG5vuBqx7sUgYhm36BYCLIKi3oHNE63qMh0VMp/I6yw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732789553; c=relaxed/simple; bh=Yox7ns7AWe9CCOqpJVniXlXb56y0ulJikyMV2//ouGw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tx02/TTACu0PLgJfgo+dbMnGmb24iFTvGOrW1KFdM68/63jZd7KRkJt+BL3NkoIbyYbowObH77s7l0LT6jF7CrsRZUqoQnu9Z1P/kH8A6TIJRma+61iPIShVLDjnGBGFeHTVld72aLCCmUpcb7PjWz9uo+czOpVpfMiMFYbR1bY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=ly+wbuPK; arc=none smtp.client-ip=209.85.221.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ly+wbuPK" Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-3825a721ae5so410021f8f.1 for ; Thu, 28 Nov 2024 02:25:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732789550; x=1733394350; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=WD4k8z96es8B14gjovDS2FjtHXDh1zXMm66FOvsAIWE=; b=ly+wbuPKuJTdpHkXoCZnT0pUSIsgXpGd7luagQPZFGf4A11OoWK79S30T/22stsNjg uKan2bQIYUdmRYv2xlPe29bhMUno0gD1DOnd7aY3tnFJl2Nb8no33K8fc428gIANXTo1 JOYQrilaPBMuY7V2VOWNUjbNAuGcCMx4h3Mykhkp2haYzNSIWulYCYPEpTPx8Eoq+/8v /wRLJpK5Jjdxh6slKHZ/P497KIaF4vIlhqfdYXwbBI0jl62Pt5FeMF1CgSrsiBKkmaTn gEhjTXS7AGl7sve8Wk1uW06+6D5L8lAURtTIwOc1AW2HuykC5Ioq1VK429OsREIzY0WP RBMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732789550; x=1733394350; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WD4k8z96es8B14gjovDS2FjtHXDh1zXMm66FOvsAIWE=; b=dHb1fTCrZKhy2tPCjMuCHhdahlaXrJpEyqRn7OdDz3OSc5ql782nnBPVIwcVKHn+E5 9iEywZJ7YjbSlkrSWMiMXq/accf9duJuPvP/xItrgIdqmljlA8NDH4daQTdDXMfRqE+b t4Zqzv3wrs2JmufNjA+yECiGmCksbZgsKD+2mNohBoBw1M4gOAajEshlPRzlc/JzQG2V IvSe9STiRtRHkiJCjAWyNjCYrk+6SQKb0W9yOFncN4VKHWnubyCo7SgFAHU51+EM5EIS YJBKswGIooNFacKBJM6WZYpP+oVmeHxgMmcwQCU+1qbwbxnSLO65w5861fV4zZQtlPnW WOlQ== X-Gm-Message-State: AOJu0YzfRYGe1YyyamM0Q143ith+0pjlIx9+3bM7eDfYNDKgdoT4XeH4 apsxces/s7mYgL9Lj48xFW1TAOGThh3scutylSZz/0HeoyG3uI6NH+RQEf9ivpw= X-Gm-Gg: ASbGnct/sXEaYX4c4iekdiOw39XfuK8cCkMnU0yC06/dW1IDVxMoG8fofQ5GS7EWMa+ NeXi8Th+6cQ+iro1ENu8uOclK+TMlwiahJPO9ViSkZSTTbVgxTKBSpUJdjCQjs6Y96KHnvNHqX9 PQxU0V+7lTEibnk2Xzenvn7JoqPEL+IlHLFUrD2Fr3FL+wjAa45ieLFI49dWvyR2gt/gOQyFIaR d3Fm2Vowa4rIthJ7o1wwzQrFjw4pNhnkp7RPxykgxopSvL9D6bMsBpRvFQBFHUhkW7hg7U= X-Google-Smtp-Source: AGHT+IHiah0ZporX1boPQyRJnxWi0PYsdjol0KT8cTMhis10crc5JNx+P71COKeg+wguvfAAotc3mA== X-Received: by 2002:a05:6000:1886:b0:381:f587:40c4 with SMTP id ffacd0b85a97d-385cbd816f8mr1897058f8f.21.1732789549807; Thu, 28 Nov 2024 02:25:49 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385ccd2db59sm1265909f8f.11.2024.11.28.02.25.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2024 02:25:49 -0800 (PST) From: Neil Armstrong Date: Thu, 28 Nov 2024 11:25:42 +0100 Subject: [PATCH v3 2/7] drm/msm: adreno: add plumbing to generate bandwidth vote table for GMU Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241128-topic-sm8x50-gpu-bw-vote-v3-2-81d60c10fb73@linaro.org> References: <20241128-topic-sm8x50-gpu-bw-vote-v3-0-81d60c10fb73@linaro.org> In-Reply-To: <20241128-topic-sm8x50-gpu-bw-vote-v3-0-81d60c10fb73@linaro.org> To: Rob Clark , Sean Paul , Konrad Dybcio , Abhinav Kumar , Dmitry Baryshkov , Marijn Suijten , David Airlie , Simona Vetter , Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Akhil P Oommen Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=10352; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=Yox7ns7AWe9CCOqpJVniXlXb56y0ulJikyMV2//ouGw=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBnSEUoF3bv93h4bMtSfLxgVWFRxPI4RsyxrQT7pcdh TeLsSv2JAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZ0hFKAAKCRB33NvayMhJ0c8MD/ 9bauAz6BQ24jKdL3MiaRqjsQBXRnyyN8H3+OEHNERAiuRP4eySuHynn3f22rF7gjzsoRH9InqhoCZv DRFmWyNKjug262/7fUBef1PN0Qo2cvLZyrrpuJpaDbwopt8274/A/P/qQ397pEUDnHyIn6awF6nOsg /t/llMHRpp+CRNpIfJMXRiSpU3nXUBAJDyQ7EzT46rgsgii1IO+/HGQdoSGSSjHg4MQlMjmUbPl31u LV2rYH+ns7evutzj7fsJP4SEG0/mdSZDekDmeO4ROgI68nl1IRslLLcEAVsiH7Ac2w0utCbU+EFKlr 5izNzJVg5ZBsaf6azN4S+YhhHjzMV+AHLSA9TJiWtq72n7CIdN6ZyxwwlMp+Xo20qt536Zm3rIDxTr VS6dwHj/Bo0Mq6KLXQYKezI/EUuAsCQ49v8FBYTcIIS2loJCDpNjKIKZBjYeAr4ULDGHMK4Dq3/gag TX6opBk9lOX4aGq7OlPvOGjT5WvoQVmbFcG8jkplv6IA33Hlim92pTbHDA6Y/I+bb2ayLpCYe54JxJ bZzsntw8c6rPC62+U5Om5Jv4HcMtnfyh7oJB1oBkicJr2Lrvu58Yf3J4YHfuX8/BmvtEBn5A96Vv6X GhM/gJkh1TpKJ6rwAhc5ok911tYKHrcQKnZuhxn1LqHeUiDT3fC+j3E8h51A== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE The Adreno GPU Management Unit (GMU) can also scale DDR Bandwidth along the Frequency and Power Domain level, but by default we leave the OPP core scale the interconnect ddr path. While scaling via the interconnect path was sufficient, newer GPUs like the A750 requires specific vote paremeters and bandwidth to achieve full functionality. In order to calculate vote values used by the GPU Management Unit (GMU), we need to parse all the possible OPP Bandwidths and create a vote value to be sent to the appropriate Bus Control Modules (BCMs) declared in the GPU info struct. This vote value is called IB, while on the othe side the GMU also takes another vote called AB which is a 16bit quantized value of the bandwidth against the maximum supported bandwidth. The vote array will then be used to dynamically generate the GMU bw_table sent during the GMU power-up. Signed-off-by: Neil Armstrong --- drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 174 ++++++++++++++++++++++++++++++++++ drivers/gpu/drm/msm/adreno/a6xx_gmu.h | 14 +++ drivers/gpu/drm/msm/adreno/a6xx_gpu.h | 1 + drivers/gpu/drm/msm/adreno/a6xx_hfi.h | 5 + 4 files changed, 194 insertions(+) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c index 14db7376c712d19446b38152e480bd5a1e0a5198..ee2010a01186721dd377f1655fcf05ddaff77131 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include "a6xx_gpu.h" @@ -1287,6 +1288,131 @@ static int a6xx_gmu_memory_probe(struct a6xx_gmu *gmu) return 0; } +/** + * struct bcm_db - Auxiliary data pertaining to each Bus Clock Manager (BCM) + * @unit: divisor used to convert bytes/sec bw value to an RPMh msg + * @width: multiplier used to convert bytes/sec bw value to an RPMh msg + * @vcd: virtual clock domain that this bcm belongs to + * @reserved: reserved field + */ +struct bcm_db { + __le32 unit; + __le16 width; + u8 vcd; + u8 reserved; +}; + +static u64 bcm_div(u64 num, u32 base) +{ + /* Ensure that small votes aren't lost. */ + if (num && num < base) + return 1; + + do_div(num, base); + + return num; +} + +static int a6xx_gmu_rpmh_bw_votes_init(const struct a6xx_info *info, + struct a6xx_gmu *gmu) +{ + const struct bcm_db *bcm_data[GMU_MAX_BCMS] = { 0 }; + unsigned int bcm_index, bw_index, bcm_count = 0; + + if (!info->bcms) + return 0; + + /* Retrieve BCM data from cmd-db */ + for (bcm_index = 0; bcm_index < GMU_MAX_BCMS; bcm_index++) { + size_t count; + + /* Stop at first unconfigured bcm */ + if (!info->bcms[bcm_index].name) + break; + + bcm_data[bcm_index] = cmd_db_read_aux_data( + info->bcms[bcm_index].name, + &count); + if (IS_ERR(bcm_data[bcm_index])) + return PTR_ERR(bcm_data[bcm_index]); + + if (!count) + return -EINVAL; + + ++bcm_count; + } + + /* Generate BCM votes values for each bandwidth & BCM */ + for (bw_index = 0; bw_index < gmu->nr_gpu_bws; bw_index++) { + u32 *data = gmu->gpu_ib_votes[bw_index]; + u32 bw = gmu->gpu_bw_table[bw_index]; + + /* Calculations loosely copied from bcm_aggregate() & tcs_cmd_gen() */ + for (bcm_index = 0; bcm_index < bcm_count; bcm_index++) { + bool commit = false; + u64 peak, vote; + u16 width; + u32 unit; + + /* Skip unconfigured BCM */ + if (!bcm_data[bcm_index]) + continue; + + if (bcm_index == bcm_count - 1 || + (bcm_data[bcm_index + 1] && + bcm_data[bcm_index]->vcd != bcm_data[bcm_index + 1]->vcd)) + commit = true; + + if (!bw) { + data[bcm_index] = BCM_TCS_CMD(commit, false, 0, 0); + continue; + } + + if (info->bcms[bcm_index].fixed) { + u32 perfmode = 0; + + if (bw >= info->bcms[bcm_index].perfmode_bw) + perfmode = info->bcms[bcm_index].perfmode; + + data[bcm_index] = BCM_TCS_CMD(commit, true, 0, perfmode); + continue; + } + + /* Multiply the bandwidth by the width of the connection */ + width = le16_to_cpu(bcm_data[bcm_index]->width); + peak = bcm_div((u64)bw * width, info->bcms[bcm_index].buswidth); + + /* Input bandwidth value is in KBps, scale the value to BCM unit */ + unit = le32_to_cpu(bcm_data[bcm_index]->unit); + vote = bcm_div(peak * 1000ULL, unit); + + if (vote > BCM_TCS_CMD_VOTE_MASK) + vote = BCM_TCS_CMD_VOTE_MASK; + + data[bcm_index] = BCM_TCS_CMD(commit, true, vote, vote); + } + } + + /* Generate AB votes which are a quantitized bandwidth value */ + for (bw_index = 0; bw_index < gmu->nr_gpu_bws; bw_index++) { + u64 tmp; + + /* + * The AB vote consists of a 16 bit wide quantized level + * against the maximum supported bandwidth. + * Quantization can be calculated as below: + * vote = (bandwidth * 2^16) / max bandwidth + */ + tmp = gmu->gpu_bw_table[bw_index] * MAX_AB_VOTE; + + /* Divide by the maximum bandwidth to get a quantized value */ + gmu->gpu_ab_votes[bw_index] = + bcm_div(tmp, gmu->gpu_bw_table[gmu->nr_gpu_bws - 1]); + } + + return 0; +} + /* Return the 'arc-level' for the given frequency */ static unsigned int a6xx_gmu_get_arc_level(struct device *dev, unsigned long freq) @@ -1390,12 +1516,15 @@ static int a6xx_gmu_rpmh_arc_votes_init(struct device *dev, u32 *votes, * The GMU votes with the RPMh for itself and on behalf of the GPU but we need * to construct the list of votes on the CPU and send it over. Query the RPMh * voltage levels and build the votes + * The GMU can also vote for DDR interconnects, use the OPP bandwidth entries + * and BCM parameters to build the votes. */ static int a6xx_gmu_rpmh_votes_init(struct a6xx_gmu *gmu) { struct a6xx_gpu *a6xx_gpu = container_of(gmu, struct a6xx_gpu, gmu); struct adreno_gpu *adreno_gpu = &a6xx_gpu->base; + const struct a6xx_info *info = adreno_gpu->info->a6xx; struct msm_gpu *gpu = &adreno_gpu->base; int ret; @@ -1407,6 +1536,10 @@ static int a6xx_gmu_rpmh_votes_init(struct a6xx_gmu *gmu) ret |= a6xx_gmu_rpmh_arc_votes_init(gmu->dev, gmu->cx_arc_votes, gmu->gmu_freqs, gmu->nr_gmu_freqs, "cx.lvl"); + /* Build the interconnect votes */ + if (info->bcms && gmu->nr_gpu_bws > 1) + ret |= a6xx_gmu_rpmh_bw_votes_init(info, gmu); + return ret; } @@ -1442,10 +1575,43 @@ static int a6xx_gmu_build_freq_table(struct device *dev, unsigned long *freqs, return index; } +static int a6xx_gmu_build_bw_table(struct device *dev, unsigned long *bandwidths, + u32 size) +{ + int count = dev_pm_opp_get_opp_count(dev); + struct dev_pm_opp *opp; + int i, index = 0; + unsigned int bandwidth = 1; + + /* + * The OPP table doesn't contain the "off" bandwidth level so we need to + * add 1 to the table size to account for it + */ + + if (WARN(count + 1 > size, + "The GMU bandwidth table is being truncated\n")) + count = size - 1; + + /* Set the "off" bandwidth */ + bandwidths[index++] = 0; + + for (i = 0; i < count; i++) { + opp = dev_pm_opp_find_bw_ceil(dev, &bandwidth, 0); + if (IS_ERR(opp)) + break; + + dev_pm_opp_put(opp); + bandwidths[index++] = bandwidth++; + } + + return index; +} + static int a6xx_gmu_pwrlevels_probe(struct a6xx_gmu *gmu) { struct a6xx_gpu *a6xx_gpu = container_of(gmu, struct a6xx_gpu, gmu); struct adreno_gpu *adreno_gpu = &a6xx_gpu->base; + const struct a6xx_info *info = adreno_gpu->info->a6xx; struct msm_gpu *gpu = &adreno_gpu->base; int ret = 0; @@ -1472,6 +1638,14 @@ static int a6xx_gmu_pwrlevels_probe(struct a6xx_gmu *gmu) gmu->current_perf_index = gmu->nr_gpu_freqs - 1; + /* + * The GMU also handles GPU Interconnect Votes so build a list + * of DDR bandwidths from the GPU OPP table + */ + if (info->bcms) + gmu->nr_gpu_bws = a6xx_gmu_build_bw_table(&gpu->pdev->dev, + gmu->gpu_bw_table, ARRAY_SIZE(gmu->gpu_bw_table)); + /* Build the list of RPMh votes that we'll send to the GMU */ return a6xx_gmu_rpmh_votes_init(gmu); } diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.h b/drivers/gpu/drm/msm/adreno/a6xx_gmu.h index 88f18ea6a38a08b5b171709e5020010947a5d347..bdfc106cb3a578c90d7cd84f7d4fe228d761a994 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.h +++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.h @@ -21,6 +21,15 @@ struct a6xx_gmu_bo { #define GMU_MAX_GX_FREQS 16 #define GMU_MAX_CX_FREQS 4 +#define GMU_MAX_BCMS 3 + +struct a6xx_bcm { + char *name; + unsigned int buswidth; + bool fixed; + unsigned int perfmode; + unsigned int perfmode_bw; +}; /* * These define the different GMU wake up options - these define how both the @@ -85,6 +94,11 @@ struct a6xx_gmu { unsigned long gpu_freqs[GMU_MAX_GX_FREQS]; u32 gx_arc_votes[GMU_MAX_GX_FREQS]; + int nr_gpu_bws; + unsigned long gpu_bw_table[GMU_MAX_GX_FREQS]; + u32 gpu_ib_votes[GMU_MAX_GX_FREQS][GMU_MAX_BCMS]; + u16 gpu_ab_votes[GMU_MAX_GX_FREQS]; + int nr_gmu_freqs; unsigned long gmu_freqs[GMU_MAX_CX_FREQS]; u32 cx_arc_votes[GMU_MAX_CX_FREQS]; diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.h b/drivers/gpu/drm/msm/adreno/a6xx_gpu.h index 4aceffb6aae89c781facc2a6e4a82b20b341b6cb..9201a53dd341bf432923ffb44947e015208a3d02 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.h +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.h @@ -44,6 +44,7 @@ struct a6xx_info { u32 gmu_chipid; u32 gmu_cgc_mode; u32 prim_fifo_threshold; + const struct a6xx_bcm *bcms; }; struct a6xx_gpu { diff --git a/drivers/gpu/drm/msm/adreno/a6xx_hfi.h b/drivers/gpu/drm/msm/adreno/a6xx_hfi.h index 528110169398f69f16443a29a1594d19c36fb595..52ba4a07d7b9a709289acd244a751ace9bdaab5d 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_hfi.h +++ b/drivers/gpu/drm/msm/adreno/a6xx_hfi.h @@ -173,6 +173,11 @@ struct a6xx_hfi_gx_bw_perf_vote_cmd { u32 bw; }; +#define AB_VOTE_MASK GENMASK(31, 16) +#define MAX_AB_VOTE (FIELD_MAX(AB_VOTE_MASK) - 1) +#define AB_VOTE(vote) FIELD_PREP(AB_VOTE_MASK, (vote)) +#define AB_VOTE_ENABLE BIT(8) + #define HFI_H2F_MSG_PREPARE_SLUMBER 33 struct a6xx_hfi_prep_slumber_cmd { From patchwork Thu Nov 28 10:25:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 13887858 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6DC4A193062 for ; Thu, 28 Nov 2024 10:25:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732789554; cv=none; b=c7PswApszaGyYpORvsjYWQhcuIEUMotB5wLLVJzg70i9QD+0AQoHuuJrwQvOa8FKx6IuZU5LtSOygF6s28EbF2MNgM0/Zud7dBJOvopkKkwKeFlYW+vYbHy+AuLqx1vcV34SsNGvluhV2qvnhuAecJ3BOqrK2Fn9/rj4okbMItw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732789554; c=relaxed/simple; bh=m6cl+5dS7Bml6VmAVtYBvyewU2newXJK0Ii2eLN6yeQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=KPtK+iA6xwy9diLvaY0ZLxmbqFHKvWBWkeaZkYU+BJLHxXNF1/6RSRHHTIsQtu67J9hVBzMVbrV2Za13fiJ010uUn8p2qGGU0korvkLbOP6TKIbPkQivtcYtS7whv4QhpyiYBQTkp3SWabemDxo44fMw4QYZ3pMFQ9cV9D/ByBY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=MBIETNHS; arc=none smtp.client-ip=209.85.221.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="MBIETNHS" Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-382411ea5eeso384806f8f.0 for ; Thu, 28 Nov 2024 02:25:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732789551; x=1733394351; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=SK72k/WQ3xmvOOaJYIdk4hrey4edqK6L3NlBzQcP4y4=; b=MBIETNHSz2i724FLTX0HghlS7gXqbg9TiifNcp9AS6wQ4wilDXRncJpr6SZhuo2Zx2 lIgmMz2jvKmEnS9RCHk/8B/8YdT6fr6wvv7QC1pCY+RYPJZIbeWNBu+7h81Sl15z/q+Y 1YcrjAXeEWaNuaS4HmqedqszqzUokXCOHFPCmfxZWfNFRUj7LjNjQluI+3EjtspRiojb OPMiAU4b/ntTUCXvvpJ8KPoA5NDOGwwkajb6pjiq4MHaknFOVRDXr/9q09jrX/GH3tWw Djz4Q6UZyfT1rd8/8DpLU8rrGOEG3Y5pqBzSztBXjgNmluAL/D/cnuPqx1smAvESewHe 8dSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732789551; x=1733394351; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SK72k/WQ3xmvOOaJYIdk4hrey4edqK6L3NlBzQcP4y4=; b=CJ3L5ljFrvS5PCjGp0IRYIYGo/JqS5ySzT743WVL9dOLdUQwkrR9qNg8Qxvp4jg+b4 hbEQLbTip5hGRztbIxQhQA1rypQiBRTzfMH8McQjJevVGzix6kNRH/fBdZYOiJZ4Y3u3 +QJZXvqp/QXylGG5larw/tyMejQ5GQxHI8QBKYFfNCJg1mpk5DtZp5Is3Uud3jPxwTb+ pHidLXUnklHDPbBPMfAHTqfNivtkmCzGvYPsw+yCG/wYbZHzOOAas7LtoJchXsQOEWzl vDYnSDhNtyTBDR/vfo9QJFBAhf1iMvUNUTBTRxhT0RPxpK54gKuV7Qad4SH+E+c771kU wEww== X-Gm-Message-State: AOJu0YyTClHOY/GOm3hi+eqtgAcVJOGowYmcU2dQQZo50IoDa/s89qef lCg7kEH7FrqJkr/E8yMsL15SzuentV44ifXN3OWzofTIB8PPecLS+8gCzkehdQc= X-Gm-Gg: ASbGncvp2TjQhE/qYGCHSTG32sE9xf1aGqRGPJH08eeHGybvS7mi18a7PweOGQia+YR xASxgFAXYGjLPKy3C47E5T1Ce1Zvr4m9tkMfqfNF74C3pcusECX4c/eTKWpinn0Jp4cp2oS5BKx HHDefatTRD/6Ry7TBarElFJ+z7XjpWzR7njRjj9Fi4yiWZvWLY1nh7c1nhoHCCi0QVqhEPKzT/2 zaoeHq05cM7dteEMDBvxr6IPL53k3NkxSvcD5XN1B0n8HZmujGKm0GKyxrwrfDQkQfw0IQ= X-Google-Smtp-Source: AGHT+IHY+Sjd0bkCvjs7AqBGAYrOFtVHwswzKk+ObAyWflqtjd9aC1HO9xGFLGs13Fc/oCxtCFOpCQ== X-Received: by 2002:a5d:5f8f:0:b0:37c:fbb7:5082 with SMTP id ffacd0b85a97d-385cbd89a30mr2155992f8f.25.1732789550839; Thu, 28 Nov 2024 02:25:50 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385ccd2db59sm1265909f8f.11.2024.11.28.02.25.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2024 02:25:50 -0800 (PST) From: Neil Armstrong Date: Thu, 28 Nov 2024 11:25:43 +0100 Subject: [PATCH v3 3/7] drm/msm: adreno: dynamically generate GMU bw table Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241128-topic-sm8x50-gpu-bw-vote-v3-3-81d60c10fb73@linaro.org> References: <20241128-topic-sm8x50-gpu-bw-vote-v3-0-81d60c10fb73@linaro.org> In-Reply-To: <20241128-topic-sm8x50-gpu-bw-vote-v3-0-81d60c10fb73@linaro.org> To: Rob Clark , Sean Paul , Konrad Dybcio , Abhinav Kumar , Dmitry Baryshkov , Marijn Suijten , David Airlie , Simona Vetter , Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Akhil P Oommen Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=3000; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=m6cl+5dS7Bml6VmAVtYBvyewU2newXJK0Ii2eLN6yeQ=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBnSEUo6s9LquaLR+t1nEdRJP/ejIjlnSkwxWLYTtMU dqJbcumJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZ0hFKAAKCRB33NvayMhJ0WxpD/ 4xaJOWThrZMYAhDcrGpuIeGYdU2zQYPNgiJPV8h1MiEz8m7g+ZbjOHJjRX5Lto+HVhMlKjqhiIfIuZ LzMI7RwrC+D6QNFKZiND1klBrhVGXpnkOdqDhO4ZE+lxf5IgF+PtZQi/tWs2k63P2DeAvGzOJxXF2i CJJiud6JioVyBbZvCGomMl3SLnfFkQml7agoY6wyHXz7cITxkth4PD2Mptv8U4HbQ1QPksCOgNLhGh CMrfwwhD5kCztNVBoNSmT+lAo1MlP5lDvU76wwRYBl0dRo8GwesHreB9qz0VTwvf01/GK7K4ktpHj9 B6YKc9H1oNfszwrssRp7mWmmCiHYzwP53gzsruiZNGpeyhbaQx2ZohVm+25+8R5VLupzB7565H49hC eLZdV8V3Xe3diOICPugaNJ2ajlx3oKYfy2yJPFFicOT2NiL8wzKUc9QXIMqCtDVMm2sCznLhrjvs3W 9og//JiUKsRQ8R6prBe7OSh/77TcZVOHmwy0vgTZsJPQk65bw0H+h+FTAfFosgqPhbOMndfn4rUuUn I6RdaTwoEMTLSGYTaRmeuO4eS265TsNRRJ6Tq2aAJrHCO19I5UDeK2rdsGeS6LoqUr6g8/qi/rX0SA JR8RC5oCAqNqEmSC9xXftPesdzwnJtDZIaeLco6R3we3gi3SY1Lf9xrNCaHQ== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE The Adreno GPU Management Unit (GMU) can also scale the ddr bandwidth along the frequency and power domain level, but for now we statically fill the bw_table with values from the downstream driver. Only the first entry is used, which is a disable vote, so we currently rely on scaling via the linux interconnect paths. Let's dynamically generate the bw_table with the vote values previously calculated from the OPPs. Those entried will then be used by the GMU when passing the appropriate bandwidth level while voting for a gpu frequency. Signed-off-by: Neil Armstrong --- drivers/gpu/drm/msm/adreno/a6xx_hfi.c | 39 ++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_hfi.c b/drivers/gpu/drm/msm/adreno/a6xx_hfi.c index cb8844ed46b29c4569d05eb7a24f7b27e173190f..fe1946650425b749bad483dad1e630bc8be83abc 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_hfi.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_hfi.c @@ -621,6 +621,35 @@ static void a740_build_bw_table(struct a6xx_hfi_msg_bw_table *msg) msg->cnoc_cmds_data[1][0] = 0x60000001; } +static void a740_generate_bw_table(const struct a6xx_info *info, struct a6xx_gmu *gmu, + struct a6xx_hfi_msg_bw_table *msg) +{ + unsigned int i, j; + + msg->ddr_wait_bitmask = 0x7; + + for (i = 0; i < GMU_MAX_BCMS; i++) { + if (!info->bcms[i].name) + break; + msg->ddr_cmds_addrs[i] = cmd_db_read_addr(info->bcms[i].name); + } + msg->ddr_cmds_num = i; + + for (i = 0; i < gmu->nr_gpu_bws; ++i) + for (j = 0; j < msg->ddr_cmds_num; j++) + msg->ddr_cmds_data[i][j] = gmu->gpu_ib_votes[i][j]; + msg->bw_level_num = gmu->nr_gpu_bws; + + /* TODO also generate CNOC commands */ + + msg->cnoc_cmds_num = 1; + msg->cnoc_wait_bitmask = 0x1; + + msg->cnoc_cmds_addrs[0] = cmd_db_read_addr("CN0"); + msg->cnoc_cmds_data[0][0] = 0x40000000; + msg->cnoc_cmds_data[1][0] = 0x60000001; +} + static void a6xx_build_bw_table(struct a6xx_hfi_msg_bw_table *msg) { /* Send a single "off" entry since the 630 GMU doesn't do bus scaling */ @@ -664,6 +693,7 @@ static int a6xx_hfi_send_bw_table(struct a6xx_gmu *gmu) struct a6xx_hfi_msg_bw_table *msg; struct a6xx_gpu *a6xx_gpu = container_of(gmu, struct a6xx_gpu, gmu); struct adreno_gpu *adreno_gpu = &a6xx_gpu->base; + const struct a6xx_info *info = adreno_gpu->info->a6xx; if (gmu->bw_table) goto send; @@ -690,9 +720,12 @@ static int a6xx_hfi_send_bw_table(struct a6xx_gmu *gmu) a690_build_bw_table(msg); else if (adreno_is_a730(adreno_gpu)) a730_build_bw_table(msg); - else if (adreno_is_a740_family(adreno_gpu)) - a740_build_bw_table(msg); - else + else if (adreno_is_a740_family(adreno_gpu)) { + if (info->bcms && gmu->nr_gpu_bws > 1) + a740_generate_bw_table(info, gmu, msg); + else + a740_build_bw_table(msg); + } else a6xx_build_bw_table(msg); gmu->bw_table = msg; From patchwork Thu Nov 28 10:25:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 13887860 Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9F4F71957E4 for ; Thu, 28 Nov 2024 10:25:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732789556; cv=none; b=RWnsBWXAD7APpl+5QoN+QyykjOCW2f0S+BcsyYnk20F4AAMr4XN53turn96RgUCaunD5WMysKSf5JA0zqXh00NWNBqzJzqheC/3UAl1Bzqlg5TDrZ/u/eTP4r2ek4qBMLHStr5TDrtTviBVN45f8YE72qTIFNcxlfbljunInePE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732789556; c=relaxed/simple; bh=HGV2P0MV+tkckRcz6aUbwnmYns+3KdFY0veuiRhyFqU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ErAX2yk9poPCIiyYOnhdCqGxUVyVuZQ5D4WVgTlSxQl376PYwHnSey6OpX+VKu03efAteF1jeaWEbl4p1Xt1Aa/ciZfe6xUA3jVlabBrGyzCGW2MEr4QvMeaVz9pv9cY4FjFA9A6Ij5jry4ctLOZ+SIfuGmrapWC8yCImjkO80Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=XATMv2Vq; arc=none smtp.client-ip=209.85.221.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="XATMv2Vq" Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-382442b7d9aso499926f8f.1 for ; Thu, 28 Nov 2024 02:25:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732789552; x=1733394352; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=V1gPTm0pjlwG0c0atvGnz+vU500nz6vqRW0Excxm+p8=; b=XATMv2Vq3sEeExO7kfTM1pWqMBfL2ujfRzJhTiooHrN9dpUaPLswunCJEFW+Y96+Fq rlV4/mLBX+BbI2YM0BkKvBD43OatlPRwnQEwXgcc0ArtoRhRQEBD8vpt6A+dW6Q077DN zn5zopcwM40P7Xjsn2Do3mapEYbtMK517q/MxIrTibMAkYJlt9MmuBdJQH/5+3LQziID kEESM7pgbuWE8Do4kapINb0ae7DtcWWNWPo3FaO8CGZtJKr23fqS7AIlhIhWgjcfnfKr XQ6O/jy8xix8gLicnW9GdX6iIQWpJ+xCnnueKB4NIr0nM9xeyGnNrY3q+sNOZipk/dVG aixQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732789552; x=1733394352; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=V1gPTm0pjlwG0c0atvGnz+vU500nz6vqRW0Excxm+p8=; b=SK6wLIVbR/94OC8aGxmNJ1EzrIEZtu3k5XyFrnEMdriXyyS0oSKlzorinEitSrGgwo tVTVfjRxHj0vK0zOuO8Ogx/wXMJH3rhwvOhrbMvpO1rHgwkXo37PTv/HN7NNMkVnQN83 Vl+7XGYHJ0F+U7UFkV1LWjS9y5s58SzQ3yRpivKPrWMi67LI73eSgY52v14pEzN+Xa3G S+T9Zr75L045DEhTQCtfXeaR2+rTA3VOoez1CIgMVCzQXXQpmqWWDSBNxiUxsgc4i9FE Lm4N7tSU+0tGVTWWzg3IKkfIxX4v7doaZ2+cXeYkI2XnZ8uGhYmnfkVW5wV5j8S5GoIH Fv1Q== X-Gm-Message-State: AOJu0YyGO6Q8R9ZENSN6NGkYo5iI6smJ5JISR8QO0oGttDYcd9H7d/dt yn4OsbCbJphHYHqkgXX/Fs9rRwz5xs/EMYUzGWW0ebEPq09xjthQeuBGAqESjsk= X-Gm-Gg: ASbGncuW3t5ffzpqILgVaZEpaogN1Ep04VWkfzPncyRQ96LMHCoLd9ZVI144u5hTurZ ETnjUXq6qQ8pWEzyFHSS0qKXsDDscRJ6iLTZ7r9pzWUGMyMQoJOraI4Ctw3Nkbeo5st6ThbdlFm AkHOZlIaf5lPa2E9fGppBO7MCKHFXZ8XJaoj0ynhZsIvhwFJkHiu3FhPAItgqj52FXZfdN+02CA NoTBhyMDCdIWvN5gawrJOOFtNZ75jOVcBfJxvycw/RmdSI+KcUnYo7omM0YqB9cb6j2kxE= X-Google-Smtp-Source: AGHT+IH7sktOVLKHGjk9KT+EMqHEmYPm4nKYmfIvMzvZeiXklUBSbGgviUeQzfTI3dSQAF2MPCiL8A== X-Received: by 2002:a5d:64c6:0:b0:382:424b:d0a6 with SMTP id ffacd0b85a97d-385c6ee2285mr4561807f8f.55.1732789551865; Thu, 28 Nov 2024 02:25:51 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385ccd2db59sm1265909f8f.11.2024.11.28.02.25.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2024 02:25:51 -0800 (PST) From: Neil Armstrong Date: Thu, 28 Nov 2024 11:25:44 +0100 Subject: [PATCH v3 4/7] drm/msm: adreno: find bandwidth index of OPP and set it along freq index Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241128-topic-sm8x50-gpu-bw-vote-v3-4-81d60c10fb73@linaro.org> References: <20241128-topic-sm8x50-gpu-bw-vote-v3-0-81d60c10fb73@linaro.org> In-Reply-To: <20241128-topic-sm8x50-gpu-bw-vote-v3-0-81d60c10fb73@linaro.org> To: Rob Clark , Sean Paul , Konrad Dybcio , Abhinav Kumar , Dmitry Baryshkov , Marijn Suijten , David Airlie , Simona Vetter , Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Akhil P Oommen Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=4409; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=HGV2P0MV+tkckRcz6aUbwnmYns+3KdFY0veuiRhyFqU=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBnSEUpFH18HETnVEkA1avAO9F358zoh02g20joobql 7nkwWfKJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZ0hFKQAKCRB33NvayMhJ0eIsEA CVHnknx1S/dySNA2A/93aQICdmUiOgXKP7HJorQ5fVnwJMNHoWwWLPyb4U/toZ08A5Sz+QpbduDMQq L+QTbdF2vQj096ofU+VO/Sh2t8/EuwO6lT/+GPbqnnBSvQFZTO+lxg8Bu+37mWEPh1RJDyxIUlRF/D qBeiwW7SiiEaBnqeDW2CoblV5NOCrHGTW+z7Wtkf16QMP8A0TtfeO6dOrTw7nlGXoYEqk3iB0WcxEH 3cuA0h4+6jHteDVqnKS+6aRzvgayrVbit+HUD94WoU6sfmEaAa2TDcyRo4pejRbDDy28PIiJcU1aaf aFPS1tIRJLCF8it7VLXRNNOpftnoxBmeo+5u0BWFCcWekKSAPHkRocKguagGu7BG2BQViHa9qP6GGS wcfP9tu/xnMRBf1Un+AKB477Qq6DOsZGYX4AB9RS9oWJxwKBYo5MWN0mFmt1wn9x5os01QZLoq6SWk QBc7cZXCa5qpsGpVR2AaFQw6zpgscn3xwfuXyvBGfkRxxuTudF8CRAJ+rGtFO9C5Uf2+SE9+gCEz+H vMinnMZfnvXBYCBAOIkaSr3oS8ivNOED5CLzcwWHmOBMxonjfedca2B/GE4oL9FsLaAvvDp70dHEVx dW8tne8V28NlHfVqTdW22JE5umB83FbK7QS5Uf4jLTiKAmuEF0bFf7VjL7qA== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE The Adreno GPU Management Unit (GMU) can also scale the DDR Bandwidth along the Frequency and Power Domain level, until now we left the OPP core scale the OPP bandwidth via the interconnect path. In order to enable bandwidth voting via the GPU Management Unit (GMU), when an opp is set by devfreq we also look for the corresponding bandwidth index in the previously generated bw_table and pass this value along the frequency index to the GMU. The AB pre-calculated vote is appended to the bandwidth index to inform the GMU firmware the quantity of bandwidth we need. Since we now vote for all resources via the GMU, setting the OPP is no more needed, so we can completely skip calling dev_pm_opp_set_opp() in this situation. Signed-off-by: Neil Armstrong --- drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 23 +++++++++++++++++++++-- drivers/gpu/drm/msm/adreno/a6xx_gmu.h | 2 +- drivers/gpu/drm/msm/adreno/a6xx_hfi.c | 6 +++--- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c index ee2010a01186721dd377f1655fcf05ddaff77131..c09442ecc861c4e56c81e7e775b9e57baf7d2e51 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c @@ -110,9 +110,11 @@ void a6xx_gmu_set_freq(struct msm_gpu *gpu, struct dev_pm_opp *opp, bool suspended) { struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu); + const struct a6xx_info *info = adreno_gpu->info->a6xx; struct a6xx_gpu *a6xx_gpu = to_a6xx_gpu(adreno_gpu); struct a6xx_gmu *gmu = &a6xx_gpu->gmu; u32 perf_index; + u32 bw_index = 0; unsigned long gpu_freq; int ret = 0; @@ -125,6 +127,21 @@ void a6xx_gmu_set_freq(struct msm_gpu *gpu, struct dev_pm_opp *opp, if (gpu_freq == gmu->gpu_freqs[perf_index]) break; + /* If enabled, find the corresponding DDR bandwidth index */ + if (info->bcms && gmu->nr_gpu_bws > 1) { + unsigned int bw = dev_pm_opp_get_bw(opp, true, 0); + + for (bw_index = 0; bw_index < gmu->nr_gpu_bws - 1; bw_index++) { + if (bw == gmu->gpu_bw_table[bw_index]) + break; + } + + if (bw_index) { + bw_index |= AB_VOTE(gmu->gpu_ab_votes[bw_index]); + bw_index |= AB_VOTE_ENABLE; + } + } + gmu->current_perf_index = perf_index; gmu->freq = gmu->gpu_freqs[perf_index]; @@ -140,8 +157,10 @@ void a6xx_gmu_set_freq(struct msm_gpu *gpu, struct dev_pm_opp *opp, return; if (!gmu->legacy) { - a6xx_hfi_set_freq(gmu, perf_index); - dev_pm_opp_set_opp(&gpu->pdev->dev, opp); + a6xx_hfi_set_freq(gmu, perf_index, bw_index); + /* With Bandwidth voting, we now vote for all resources, so skip OPP set */ + if (!bw_index) + dev_pm_opp_set_opp(&gpu->pdev->dev, opp); return; } diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.h b/drivers/gpu/drm/msm/adreno/a6xx_gmu.h index bdfc106cb3a578c90d7cd84f7d4fe228d761a994..432b16c4e198939d9bdb968df6170e4ac74fc923 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.h +++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.h @@ -210,7 +210,7 @@ void a6xx_hfi_init(struct a6xx_gmu *gmu); int a6xx_hfi_start(struct a6xx_gmu *gmu, int boot_state); void a6xx_hfi_stop(struct a6xx_gmu *gmu); int a6xx_hfi_send_prep_slumber(struct a6xx_gmu *gmu); -int a6xx_hfi_set_freq(struct a6xx_gmu *gmu, int index); +int a6xx_hfi_set_freq(struct a6xx_gmu *gmu, u32 perf_index, u32 bw_index); bool a6xx_gmu_gx_is_on(struct a6xx_gmu *gmu); bool a6xx_gmu_sptprac_is_on(struct a6xx_gmu *gmu); diff --git a/drivers/gpu/drm/msm/adreno/a6xx_hfi.c b/drivers/gpu/drm/msm/adreno/a6xx_hfi.c index fe1946650425b749bad483dad1e630bc8be83abc..9f8c6f9157381a6f7b66de766a046dd84e211384 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_hfi.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_hfi.c @@ -759,13 +759,13 @@ static int a6xx_hfi_send_core_fw_start(struct a6xx_gmu *gmu) sizeof(msg), NULL, 0); } -int a6xx_hfi_set_freq(struct a6xx_gmu *gmu, int index) +int a6xx_hfi_set_freq(struct a6xx_gmu *gmu, u32 freq_index, u32 bw_index) { struct a6xx_hfi_gx_bw_perf_vote_cmd msg = { 0 }; msg.ack_type = 1; /* blocking */ - msg.freq = index; - msg.bw = 0; /* TODO: bus scaling */ + msg.freq = freq_index; + msg.bw = bw_index; return a6xx_hfi_send_msg(gmu, HFI_H2F_MSG_GX_BW_PERF_VOTE, &msg, sizeof(msg), NULL, 0); From patchwork Thu Nov 28 10:25:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 13887859 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 96E38198A1A for ; Thu, 28 Nov 2024 10:25:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732789556; cv=none; b=K3jXZV//+oRtZFsC46DBbP0n0UkifNOowZeqhQ0O4l1j0wzcDooXq4vAqKpdA5mI9JF5fhKNDLcZQuezg53T1SmE9IyJztokuiIqOiFZQHSNfi0poOqVuoRLjsHRR31cyLMMgHebS76yVUPtspwug61b/n3xAopqRCclaF1D+zk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732789556; c=relaxed/simple; bh=924DT6oTDMvCY939ECy/haC6Lh7oI4FgArQiNZ+Ppug=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=cNUR+67jQQ+iQLQuJYjuJ15jxAwu41zVRPkrVfjdmja+zKxpYA0dBvWQmpoOiSAYNRPbfSISpHj04HZVOwjMbvBGBcmvcPBPIiiaaCLHcZzp5d1QbNab3OI4w3MbUdGn/ankSQlrTdnTdpzC3TgwHzXZrlHQxbhLHt3gJurAx5A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=B5u1Cu1f; arc=none smtp.client-ip=209.85.128.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="B5u1Cu1f" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-434a9f2da82so5395925e9.2 for ; Thu, 28 Nov 2024 02:25:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732789553; x=1733394353; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=onHZLTuuortukCIGD/zr91NsXEjXLUPL7AUDe8ckj8E=; b=B5u1Cu1fMtNRqZKQM7wttKGD/v6nzDRQDcCYc5GixTugGMQvTkxLhlBZlKeYOO0h/f 646NB7OMjjIopH9mG4EtxlsFqlWAcrI/AobI8gHOTQ9y0pr6ZwGm34mTFwrxuIPwQzsn 1X3qhiiJTJcv3fcyzjvnjKwqSpSF0hxGVYtBMA8mWKqJVVmVtbAOzAgQD1Gk02fK6lYM T4O6dFKER9Oj8W1Rf04dyYJ4wlauI8aWFoxa7L0irFf899SpoPbGW3r18u/7/sQIdxMy bpkU3FU2HTZWzrD771v3xBGuA/rqlPVfXjSTc4GckI/NwFQ9eV4fTQTDmg7Kse2fbH8Q NARQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732789553; x=1733394353; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=onHZLTuuortukCIGD/zr91NsXEjXLUPL7AUDe8ckj8E=; b=nGyQzpGZ/Kpks4O9DUVdQ4+keJgLtSlEx88H5zc9gSuL9OBXCKBg4Ee02NHO+Lk3bJ JYutt+0lSPidVxw9IAqHAZq6RV/+FaRGSClSm5BRfQ5nJWGTxayWpQoYUS8Pq8Q4eoot 4s7OyhuODkkRe7CXEWRqS4UHheBSYMYhwY50+ySr5D+zgh2Y/iSAA/+MbkPo/j58y4QN mTVOiDlsRw0qb50N3qBqPt15MjA6LiaOSSmw4ZPBYM1q3KsuQcV2hXmM4q7KvGNAkc6m 1KLHRFaaRRPaaun7uoWAJwUJlsIfYP/Det1soQ3GliqSayF+M9z10vkisZ8NaHO8UjSW 1fXg== X-Gm-Message-State: AOJu0Yw2TAOG6SxANMy2O3wY5S3MWiOnBPaULpIsXPcqPfaow2cNQEn0 zF/zN5KG0TfhbRr5752C+lEr51U4qNrQOuhEuI10x029Y1ECgts9XdVKUCJSIpM= X-Gm-Gg: ASbGncsce/OJYXmPq5b1s10M7SB1D/c/Ptrr3UQ1qfzVZ5WrKkkad3dvWTKG8Pkli/w 1DO42ea9RE2rfp7zU2CzAesKX8aWTuK/GjDZRle1h4dq2AzFzm+RvCeBh7Dl3mw2UxTmg5vh9VA MKHHwszgl2FwhkxW2ll7wiUrHPQ298gpzmeAtHBb6wkfNSa1NR/w3fwmLJmr6b88754BFe/4beX 2vWXCmK73jHp9BefIXMCwjZ+rasa1I+r7apKpA5wBhbUgX8ROZyODNzmj+o0VuneDfcQrI= X-Google-Smtp-Source: AGHT+IFc8baEE4obV/t+dZEaXnJYfvSi4j1JSnGZb5upEN1OOzGRPJoCXriBFRWmZ8/pRLNl0l74RQ== X-Received: by 2002:a05:600c:4f0e:b0:434:9cf0:d23d with SMTP id 5b1f17b1804b1-434a9deca10mr51252185e9.25.1732789553016; Thu, 28 Nov 2024 02:25:53 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385ccd2db59sm1265909f8f.11.2024.11.28.02.25.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2024 02:25:52 -0800 (PST) From: Neil Armstrong Date: Thu, 28 Nov 2024 11:25:45 +0100 Subject: [PATCH v3 5/7] drm/msm: adreno: enable GMU bandwidth for A740 and A750 Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241128-topic-sm8x50-gpu-bw-vote-v3-5-81d60c10fb73@linaro.org> References: <20241128-topic-sm8x50-gpu-bw-vote-v3-0-81d60c10fb73@linaro.org> In-Reply-To: <20241128-topic-sm8x50-gpu-bw-vote-v3-0-81d60c10fb73@linaro.org> To: Rob Clark , Sean Paul , Konrad Dybcio , Abhinav Kumar , Dmitry Baryshkov , Marijn Suijten , David Airlie , Simona Vetter , Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Akhil P Oommen Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1786; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=924DT6oTDMvCY939ECy/haC6Lh7oI4FgArQiNZ+Ppug=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBnSEUpWCTm1P4HsUDHmzl+hSPFrHFr1Uz6nvhjAh0U ag9joeuJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZ0hFKQAKCRB33NvayMhJ0TPmEA CKNYmQ/3wwTCYJIWif0Ir+v4DtzD2ni3Il+Jkwn+SGIGlDWiB+kPTLReVehrzVtdJE7tMfRqCxHk7s 6j7H/H4Shl9fa1uAdH3ljKBgyGsvhytbWLsy4G9dVenGN+ps84hteAs8m/FPfQkGiLrHGrlYsd3kbv WXqzevlGmH1wL2GLJgWXikowi3pzHt0PCFdo4euBlSm+GDl4dPunOfQO44atfqOLVkmke+bJr//TKJ dcTA6qFZMYaal3iMUtzN+73AzuXgr+NYBTUC+VRHvdW7MymRSa0kAbo4HcBulVuEw3O6CLfG8ZiO96 B7z+zOwqz86rsDDtr0dNhsagJHSP6te1/aCrSvBxUllDFAVpFDxmWcdvqP1l5J9e82bmO1UneYi1TA TLbvt/DjQrfSr5LJz6VywB6fFumm16csyVIEPv/QYPCLtvaTQrYQTcTKXXi1+kQD7hD2Ui5fTPfRaG y1KIoQogg+OuI25+n86i4vHX2QgpZK2bfYi2Esnod7LnC0V5j76Jg3nAh/e4sjRzsx+XdqKTcI8yM9 Uf2TBYKuw5wXkOi6haDShbQNXeHGh4RF28bG0rvQrWh0L/HPCiwfxNtDAYUdoXc2AptTpa94gm3Hfo 6BqjfzI23rQb09w23GW2t6L7AV8+sopHmzVmN9q/IQ/5wsiP/neDNPGjqjSA== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE Now all the DDR bandwidth voting via the GPU Management Unit (GMU) is in place, declare the Bus Control Modules (BCMs) and the corresponding parameters in the GPU info struct and add the GMU_BW_VOTE feature bit to enable it. Signed-off-by: Neil Armstrong Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/adreno/a6xx_catalog.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_catalog.c b/drivers/gpu/drm/msm/adreno/a6xx_catalog.c index 0c560e84ad5a53bb4e8a49ba4e153ce9cf33f7ae..edffb7737a97b268bb2986d557969e651988a344 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_catalog.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_catalog.c @@ -1388,6 +1388,17 @@ static const struct adreno_info a7xx_gpus[] = { .pwrup_reglist = &a7xx_pwrup_reglist, .gmu_chipid = 0x7020100, .gmu_cgc_mode = 0x00020202, + .bcms = (const struct a6xx_bcm[]) { + { .name = "SH0", .buswidth = 16 }, + { .name = "MC0", .buswidth = 4 }, + { + .name = "ACV", + .fixed = true, + .perfmode = BIT(3), + .perfmode_bw = 16500000, + }, + { /* sentinel */ }, + }, }, .address_space_size = SZ_16G, .preempt_record_size = 4192 * SZ_1K, @@ -1432,6 +1443,17 @@ static const struct adreno_info a7xx_gpus[] = { .pwrup_reglist = &a7xx_pwrup_reglist, .gmu_chipid = 0x7090100, .gmu_cgc_mode = 0x00020202, + .bcms = (const struct a6xx_bcm[]) { + { .name = "SH0", .buswidth = 16 }, + { .name = "MC0", .buswidth = 4 }, + { + .name = "ACV", + .fixed = true, + .perfmode = BIT(2), + .perfmode_bw = 10687500, + }, + { /* sentinel */ }, + }, }, .address_space_size = SZ_16G, .preempt_record_size = 3572 * SZ_1K, From patchwork Thu Nov 28 10:25:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 13887861 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ABBFC1990CD for ; Thu, 28 Nov 2024 10:25:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732789558; cv=none; b=on8/33DUEBo7oOLgHeffJY/fLCRxfMkK5mTgjF80DNCrCJplVGolc/VFcBke4qukw6FVDw7lFxNsn1rCtjix27l2oRXvCUVrAZ0P5LaZhgxeavkjR8QL7N1jErIIrhdPk8i27U+jSuZhuCVWCHNfsHS13HHWK2s43lh4PWfk4Nw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732789558; c=relaxed/simple; bh=SPiS1PE0VaU+lZQZUAnT3yVj+1EZ8DKyTqWi4EEzxic=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jDVSwV8CjDdKPFScwgOLKsga3V3MQydQvCw7+Gaetj3AUMWEodkdIB1hvj7ZooznHS7b2ozlkBxAaA6kNLTqxYk+obdjEGK6yT46g88VIrqJujaOgCWQYW4F1DkaFlSFKkky7cv17Om5CV8cW4XyT5gNGL6yzd3jhmkQMSgu0sg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=asRlwMNe; arc=none smtp.client-ip=209.85.128.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="asRlwMNe" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-434a8b94fb5so4063405e9.0 for ; Thu, 28 Nov 2024 02:25:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732789554; x=1733394354; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=oxD1mwK+mwBfZm5ePvwF7qngRKOmVEln2kQY0A2fNXU=; b=asRlwMNecHx1zRExDAWjvIhr1X12OtzSrFf2++t9M/uQlBxU8MVVnixv0gRhwOMUxw FmfuRlnb37z5SXkLboGVEdztALmLE4KIb94pX+SgmMVyZWDT0ntoCgoaDi70uH8Ei6nb MF+WyM4DyS23PPP7WNWjracti+I3EfgB0Vd1Zl8kCPYXerHHy38Q8h/HHHHxRwTrAIcB Aa8bW2zHJhlwgZB9t/kL8KweKLsW0N9G111PfB8KOweB1QiKVrs9bI79ucLbkkhvbdLl NN+bFe7/xPBCyKQSItkJL/d8EngnPJAmGLv3UxsyU3bBCy7nnvEwTVU3FtGTh+FHattG Smrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732789554; x=1733394354; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oxD1mwK+mwBfZm5ePvwF7qngRKOmVEln2kQY0A2fNXU=; b=EoDrA+Ht0WnEJgeqwmPvH4BmRqi+pcjwRKvMSG7qu6tHfEiQrQZCEHWqZnlA7/bB/e 1lT5GyaNymXxk7pSh7+EcLKgYSNjk14vTAs//k1qoBew4IQiwXgn3YLXpaN2JAdyJuFm bRhjkGTjyr8OAqnRCdIhNoaasON54H4LcP/w83hP4U8Gt2NSUXUJ/QIW3nUo+3vItejR AahklFscz11AzsZI4bqCfBTUa5TassPSCCfUgrCuLsAhbQa0lnEHqHpAeFK/m4z2pHkf Kcdfkq0YNP5zwhpFuoG2FMUe6xKv6fA7368PvDzQZXBW0DmIuuMiDfNo9nS6jMVnNMU7 y5iw== X-Gm-Message-State: AOJu0YzaN5yBP4JKUZMUSEQ7OZ7VzyVFCgiLKvCm91gr/UA/booR/rDg 9SNdCTWGxJmQApwSfdji/gyme78aXJrLF8sbZ6DLQU+lOKJkoLO75MRgPPAYooE= X-Gm-Gg: ASbGncuAyGqpmBCWBiO5eAwVfh6cmBSroSrddzNQYxQI2znm/D0vxPCdrBWJzW+U8Tk vuXrd5J5lUybq8hUBOUWthPb+kUX+Eq6hF2+owcqRtHScQf3HSqGJMC99dVpaNExXzo/r0GuoPk 5PfaXNsQhmNftdlsfb0sJibWRKQEUdBRxo97RwAMgoFtqLGHUAIEJtdRg5Sc4nYwnq41i6cpTOc KWWlBQjbYEwdKcD31IgctaxCuY007/4fE1icJSVVnkM7JK6zE1+3OisgAhQvipDjD5zeS8= X-Google-Smtp-Source: AGHT+IH9zTsMi4bXrztoim9bnTLqQthtJbqFnNXarWSa44HOSdk7AqCzL4tsxwQbZNvxNUCZd2R14A== X-Received: by 2002:a05:600c:5123:b0:434:9ff4:24a1 with SMTP id 5b1f17b1804b1-434afc3e694mr22424005e9.13.1732789554035; Thu, 28 Nov 2024 02:25:54 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385ccd2db59sm1265909f8f.11.2024.11.28.02.25.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2024 02:25:53 -0800 (PST) From: Neil Armstrong Date: Thu, 28 Nov 2024 11:25:46 +0100 Subject: [PATCH v3 6/7] arm64: qcom: dts: sm8550: add interconnect and opp-peak-kBps for GPU Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241128-topic-sm8x50-gpu-bw-vote-v3-6-81d60c10fb73@linaro.org> References: <20241128-topic-sm8x50-gpu-bw-vote-v3-0-81d60c10fb73@linaro.org> In-Reply-To: <20241128-topic-sm8x50-gpu-bw-vote-v3-0-81d60c10fb73@linaro.org> To: Rob Clark , Sean Paul , Konrad Dybcio , Abhinav Kumar , Dmitry Baryshkov , Marijn Suijten , David Airlie , Simona Vetter , Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Akhil P Oommen Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2162; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=SPiS1PE0VaU+lZQZUAnT3yVj+1EZ8DKyTqWi4EEzxic=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBnSEUp3GWqkaAyvNyjK+Commp2P2mBY+OCujX5NST8 VlBWoKyJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZ0hFKQAKCRB33NvayMhJ0bUTEA C0HDx8xWxvW60Vq1Fn6+4ZVKKnqrCLe/5/utX2NRP7PNDJFGb96Do4ba6K6JuHAwoqirVKXdhPBLDp OQ1/jqoPoI+P0MZ/9DDvkZihtkzl31zXJY5RS+BpsGIOudVRLY8Fcj7CnSR9C9xrqNm3KXQ6cCjCI2 wQD47Ee6FNL/t/XurPl0ZsZTEY5S2Lytdyo7FxK0KIOjw0prOTC4YO0D7lybb+q++WKCPBpZ3goopg IOYWckLX+xmmrQSP50gRZ3L3cSdhV8LDfpXEg6iD+ppH2Bbs1f94q602RTLVOzsdYpghreebEi8xkx t6tsRvaXQewCqfvs4KukxEJfEIq6AgyUsahoEcuHOphsgowe3qvT3C70WWuJu3hCpsHr01FBf31opN mz0BOSmsZFaDbl/VHnzV0QVppZJ+YukA4m49gR2/VQNtwLK1cklCqCwI88gK2iwAs4RDdnnT4GYkWB p3VE3RWOJFQVi72pPAqxLtJEmvE+xbAsC4DHcFye1AY5rxHbQL0OW2n3sGZ02Z4EeL08P4reyFFvTB aniTH+u4fB+cck65b/JewYNnWWWCG9+5K70XnkbBlwsYo1ygPp07ThCDL1Ie1hee8HC/CeBaXBFqDG e//LsTfex1Iy1ZFFNXBucoeLHxh7/o+bMo1NWjYWXSezVEoZ39mkDLDNCETg== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE Each GPU OPP requires a specific peak DDR bandwidth, let's add those to each OPP and also the related interconnect path. Signed-off-by: Neil Armstrong --- arch/arm64/boot/dts/qcom/sm8550.dtsi | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sm8550.dtsi b/arch/arm64/boot/dts/qcom/sm8550.dtsi index e7774d32fb6d2288748ecec00bf525b2b3c40fbb..545eb52174c704bbefa69189fad9fbff053d8569 100644 --- a/arch/arm64/boot/dts/qcom/sm8550.dtsi +++ b/arch/arm64/boot/dts/qcom/sm8550.dtsi @@ -2114,6 +2114,9 @@ gpu: gpu@3d00000 { qcom,gmu = <&gmu>; #cooling-cells = <2>; + interconnects = <&gem_noc MASTER_GFX3D 0 &mc_virt SLAVE_EBI1 0>; + interconnect-names = "gfx-mem"; + status = "disabled"; zap-shader { @@ -2127,41 +2130,49 @@ gpu_opp_table: opp-table { opp-680000000 { opp-hz = /bits/ 64 <680000000>; opp-level = ; + opp-peak-kBps = <16500000>; }; opp-615000000 { opp-hz = /bits/ 64 <615000000>; opp-level = ; + opp-peak-kBps = <16500000>; }; opp-550000000 { opp-hz = /bits/ 64 <550000000>; opp-level = ; + opp-peak-kBps = <12449218>; }; opp-475000000 { opp-hz = /bits/ 64 <475000000>; opp-level = ; + opp-peak-kBps = <8171875>; }; opp-401000000 { opp-hz = /bits/ 64 <401000000>; opp-level = ; + opp-peak-kBps = <6671875>; }; opp-348000000 { opp-hz = /bits/ 64 <348000000>; opp-level = ; + opp-peak-kBps = <6074218>; }; opp-295000000 { opp-hz = /bits/ 64 <295000000>; opp-level = ; + opp-peak-kBps = <6074218>; }; opp-220000000 { opp-hz = /bits/ 64 <220000000>; opp-level = ; + opp-peak-kBps = <6074218>; }; }; }; From patchwork Thu Nov 28 10:25:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 13887862 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B9D8E19924D for ; Thu, 28 Nov 2024 10:25:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732789558; cv=none; b=XiZfw6YV2bZDpRtavKbdA/LsudHoaYPcanHWmRq+UVgLkwE12MA1kAqG7gFKr2NWuMFo4bVA66eGxDFRQc4C+IRPWLTbkkD4WefrsWN6VESAAHpA5nH+MwXAq5wBqzb3pwq9TsAvnHnjcO4fGaV72hI4D4YoSWSBrUkkLsyRcq0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732789558; c=relaxed/simple; bh=Z/fubARSNKiSdA4saAVoRo6dxj5fjC0/InYw7gi/1hw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IFiVg6ing3czcfcHGzS71JpZsFJHdHCA2cmPxkOJ2rxoXQQ4qcZoJZR53BCZDJWHFgsGxNbNGq5Ngffrgrra6WWW+ckT5ATkjXZ0y3QjitBilSV1q/jii+j23KrqO7Nvb51pbdZsd0S7xB9rk+e1ZgIVHWaxxG24Qg/8n3dd/p4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=JQMR3/0u; arc=none smtp.client-ip=209.85.128.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="JQMR3/0u" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4349e4e252dso6032275e9.0 for ; Thu, 28 Nov 2024 02:25:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732789555; x=1733394355; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=MV2f7FQ+IZLtcez7+tYl5S56MAb02gKSe/ez4DkB/II=; b=JQMR3/0uvg1cH8gUkLpe8zExGWRx20fv5pfl1NpSziEsl/lv1gew1QJma98w2CtpKv CfQitQIEvDQv15LCodxrjX5z3uRCNr3ZlDGTBtpX4cNdH7MWc7PzORP4E73blnqkEGCu Hx/qFF4gSe1alfip+iw8omf6ZZ+Bm3OWSHiBKvYUXtCF2sEkGhHHaFVNycA9FWdPaB14 LmjUdTKiVgHFHgRjH+f8mVDRPFpoyuN0nlcR+Uy3kGnL9Jw7YkMefYUXRhtcYxJEHFFZ 8Dw8QPYMGaXXvm7SXFf/ZyGTjH/sZ/Erw9aF6U8xw/hyqjOxQ58atye4Roefnde6XPZG EnKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732789555; x=1733394355; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MV2f7FQ+IZLtcez7+tYl5S56MAb02gKSe/ez4DkB/II=; b=sOhY1TmevNmsoYBTNNEdhG5Wd4E6ucm2hzjlI4zf0b6BpvrRYZGWvyzKGn9Zzz4xQv oDu0QzP9EESiIe9cbjxnKlSjFbcbC55HN+AezxzIPaAcXxRrrJBiiQAItV4iRHEkwSHn NB4HDfPpfBQkJFz1jhboG8xap66//Zzmgr1Tji7EmiOKQhT8uaEt9un+otqiERFojqU/ QZTNUudeyBgj82M/dtshQx9aM65LmOTJFjnhuot1sRCy0R3Q1su9RM6c2GKmVth3WbxJ YinQqWHWpHuqwhubYOpyysNnu3ztZYkuurjaWMB2cgRwtKRaekFqUij/9q+oZA75NTl5 wD6w== X-Gm-Message-State: AOJu0Yy/cg3n9C0+ehG/ELTNJ7VntA/M8k1kgj8/EKWYk0UN/oafU77v 8beSYlnFcxc0WwFOZVVrUqKHYjsFKBhdxhOE2KfZk4Im3/wgZ07R08Ta/wTobNM= X-Gm-Gg: ASbGncun2IGoWeVLtep88r5qgnRzxcelH1lILcGYj/YFkgZv1SejiYj0SeCyHUeJVdE KkZj2cUHe6ghrW3PzOGn4x0RWIq9tqPUmJNnfFAh4W8Tm86o2s8Xshx0/BxzLiNKrDoB0HOX79e Jeyv9L7vHG+ANMpqGnV6apj2blHpcC6wpKxFlNI247u0uTfej1k49Iefk31trt9A3djR+gQNAu2 vWQ+N+ObJSSBwDRaYMjsuPepXe3jDNz5uImeSQAnSi+my3tfIxEYSBOLwU5SpQs3gK14x8= X-Google-Smtp-Source: AGHT+IFDPNwfPwU7WoDGxeoMVmod7G7Th8E2EFadkBA7uRFVnWAcSGDgmzTL1DRYsdo/WKpUznV5Jw== X-Received: by 2002:a05:600c:3b16:b0:434:a4fe:cd6d with SMTP id 5b1f17b1804b1-434a9dc02c5mr60957305e9.12.1732789555076; Thu, 28 Nov 2024 02:25:55 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385ccd2db59sm1265909f8f.11.2024.11.28.02.25.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2024 02:25:54 -0800 (PST) From: Neil Armstrong Date: Thu, 28 Nov 2024 11:25:47 +0100 Subject: [PATCH v3 7/7] arm64: qcom: dts: sm8650: add interconnect and opp-peak-kBps for GPU Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241128-topic-sm8x50-gpu-bw-vote-v3-7-81d60c10fb73@linaro.org> References: <20241128-topic-sm8x50-gpu-bw-vote-v3-0-81d60c10fb73@linaro.org> In-Reply-To: <20241128-topic-sm8x50-gpu-bw-vote-v3-0-81d60c10fb73@linaro.org> To: Rob Clark , Sean Paul , Konrad Dybcio , Abhinav Kumar , Dmitry Baryshkov , Marijn Suijten , David Airlie , Simona Vetter , Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Akhil P Oommen Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2636; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=Z/fubARSNKiSdA4saAVoRo6dxj5fjC0/InYw7gi/1hw=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBnSEUq+h8O+EIw/Wmn20ule4XeaTlABW5canDbHBVJ hvj0Tk+JAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZ0hFKgAKCRB33NvayMhJ0YUlD/ 9AklTjzKjHTXsDNhxoMU2vlELfn13KBdQEWIH7QLvqednKgEWEfQJF/QAYc8iiDJEHIHnmaCbXADHa JHCBES8HZ7L1U8mnXKneTx3HJ92mYMbWKtjcderjdusT4Lxwv3uoj9WejleepYfBS3GGTIW3SspHtK +69uE+EeNwMP7zLvfSDiCvEhppZ4Vjg3lmAjp5d+2C0aQFFAWBie75uXLei3mO20W1nNCmo95Vgpv6 sxbYN9NKLGDhQv2/5i+ZwjkpPN8s7CPji3gdO4ODau44hzRvcbUetfP/ZSZVPRj3C0f78ho42pz7t3 9U26Ay/sNCKAt/b638J6YA0jJd4StYkw7Q1A1f0hufut+1Mo208B3truFKCTiyfTGY5bg/n6p+sC5k qS719wFR2pr3CpuU/lC94xsSFhyK7WIhxcntyygzVphL8u4GpKx6yA//9FnIgZY6r4vJysR7qF18ZT G671aFiMFhH7OzHPqY+SAlEtAuFY23udPGTfeD6Mco3VXICcf3gahprPPZfg7L2nadNnqBWSD7fC4u EPOuQW6szIx32FHqvgumi6Ss5bXUlcfVAq2Q6idXkNDTCNY+t80e1qv/jIEoM2C/9o9P3X4BrGEU40 pJTEJ5PKOxQpg7RVNZ/H/Jv2oWqt85dgvAgt5qnYBdU/N0xgrT6Lamw9+Uig== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE Each GPU OPP requires a specific peak DDR bandwidth, let's add those to each OPP and also the related interconnect path. Signed-off-by: Neil Armstrong --- arch/arm64/boot/dts/qcom/sm8650.dtsi | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sm8650.dtsi b/arch/arm64/boot/dts/qcom/sm8650.dtsi index 25e47505adcb790d09f1d2726386438487255824..dc85ba8fe1d8f20981b6d7e9672fd7137b915b98 100644 --- a/arch/arm64/boot/dts/qcom/sm8650.dtsi +++ b/arch/arm64/boot/dts/qcom/sm8650.dtsi @@ -2636,6 +2636,9 @@ gpu: gpu@3d00000 { qcom,gmu = <&gmu>; #cooling-cells = <2>; + interconnects = <&gem_noc MASTER_GFX3D 0 &mc_virt SLAVE_EBI1 0>; + interconnect-names = "gfx-mem"; + status = "disabled"; zap-shader { @@ -2649,56 +2652,67 @@ gpu_opp_table: opp-table { opp-231000000 { opp-hz = /bits/ 64 <231000000>; opp-level = ; + opp-peak-kBps = <2136718>; }; opp-310000000 { opp-hz = /bits/ 64 <310000000>; opp-level = ; + opp-peak-kBps = <6074218>; }; opp-366000000 { opp-hz = /bits/ 64 <366000000>; opp-level = ; + opp-peak-kBps = <6074218>; }; opp-422000000 { opp-hz = /bits/ 64 <422000000>; opp-level = ; + opp-peak-kBps = <8171875>; }; opp-500000000 { opp-hz = /bits/ 64 <500000000>; opp-level = ; + opp-peak-kBps = <8171875>; }; opp-578000000 { opp-hz = /bits/ 64 <578000000>; opp-level = ; + opp-peak-kBps = <12449218>; }; opp-629000000 { opp-hz = /bits/ 64 <629000000>; opp-level = ; + opp-peak-kBps = <12449218>; }; opp-680000000 { opp-hz = /bits/ 64 <680000000>; opp-level = ; + opp-peak-kBps = <16500000>; }; opp-720000000 { opp-hz = /bits/ 64 <720000000>; opp-level = ; + opp-peak-kBps = <16500000>; }; opp-770000000 { opp-hz = /bits/ 64 <770000000>; opp-level = ; + opp-peak-kBps = <16500000>; }; opp-834000000 { opp-hz = /bits/ 64 <834000000>; opp-level = ; + opp-peak-kBps = <16500000>; }; }; };