From nobody Thu Dec 18 08:13:36 2025 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (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 98E34221476 for ; Thu, 5 Dec 2024 15:01:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733410890; cv=none; b=WgOkEpbNXkKvdIy7f1m4oiRtxqbTaRFxGkVxd1/CjYv3Q0zKjZOGLMBaXz9JTORQQaxMe6Lws8NRc049kFnjRU5zuxVmDlJ3GhWroDH+AC1jueIvFwNZL0N+wrcAaTVI/9fhYP629KH70nRUeMAFEyKQzTSF1XavjexPRvBqFG8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733410890; c=relaxed/simple; bh=uvbHEXTw+a2tX2idu+ViK6cwh2GKBsinSbc9Nbsj/3M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=j4Ldshmv8EIRAQsPNYrTYsKqtSGNRI7XPlQ/MaeWCmCWza6Ty8z0VpOrbb+w4pNfE46cCk9/gBtqQon+b+bMWqxNqznGNEf2kRhXrdLoOiDOnPc9tv3JElURTuZaS5Wcbaw7/xtV9Db2hU4I5Uk0GS26P4XnFney07J5N2U4CDk= 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=fRL6svp7; arc=none smtp.client-ip=209.85.128.53 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="fRL6svp7" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-434aabd688fso6998835e9.3 for ; Thu, 05 Dec 2024 07:01:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733410887; x=1734015687; 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=GT6Ffu6NHkparOWH1yazIoGcxgWe1DmTQ9OnbymmN/0=; b=fRL6svp7oLHlRdN7F3a4hz13D8Sabf7ef2j1VxG4YBcF0ZhYSTBLOroG0ZPIjvActO SZX93YIzwg2//GDqU+d1V3FgrmrBWseHiIb8rIvbc/l4dZOUQXar3s5AIAqdqnKs2Rru DZ2OoxnuzJumOa+sAXWhVHSNiiHD01Zho6QYGzVKJ50cxsvhYPPMKNa1dIZ6LppuXMTm vvh5/apebx8rNd0NAdcq6wFvnFCXyvw1Ig2JG80/hFqTjypJJdWRznhdBeUiH8zzCgza Dnt7RIp6pguFfrxbirfQ/2i7MKwsCaQR2OFrhlSPcibndPbJc4dNKY4wcpDsIELy2BKd h5Yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733410887; x=1734015687; 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=GT6Ffu6NHkparOWH1yazIoGcxgWe1DmTQ9OnbymmN/0=; b=g6dd28ZO0TLeKh5+MypSIx4bYKdEIw1o6wFkMCHR2sEsZrgna2FH2C52EUrkdEVLoM d1erlB++BbEXFu3ne9YYwuAD4pgbDPsBbF2zHqsA5eYJcsIasacstr9+y+qHsiPFY8Ck DQO5WJTH1s354ugHOB+5L7R6/KcSOlUvCT7JdgxgewpyiyvzozIIsGBgWSX8xa1nUmVi fHBMZN+2UBg9JhfnkJTM0b7XuGE3+cnqy/FiNAOlCFoIX7GvHlJsBVQIMowlMDxvMqQ1 U0xBXynnOvPWgHYoMwJn2Eq9LH0++HhNWluvm8u/Uh3USXAwCP49C37bYLWp5oky3ZWs VbNQ== X-Forwarded-Encrypted: i=1; AJvYcCUNqEnoLFpyst8vqE7uDRbGkj7uDK2mjtI1KHNY+cj7ZArVYhK1GRT9HsrawdNGZ9X8WPjD8eUx+jy95Lk=@vger.kernel.org X-Gm-Message-State: AOJu0Yx8kEINXwzI5MQv1L6wYutpwe6aH8Qt+WyY4/uSC3F1zv4eQBm5 UedY8OkI8fXAWdn3gXLx4Y44N7L8FSlfr1s776BBVjckJOffr2EDpNd877C4RpM= X-Gm-Gg: ASbGncuotXJMEnbMrAYOsUfy0yioHZ84EXxyo2C7iDk9EaDH89UpWG1No9KjwXyIrev wv+XN4hhVSV1k7oS9AhaHJ8mXWelxON+MADW/KS0cCkLmEK8T39CqNFxWkUaZXlCe4caaXrJjsg itvvDwWfAuV2+yicBtJw/MUmWp+BchItgKfPiTeL25dM180pVjE2hRPkuFWCv0hTKejbiWWBD2q AXrAPs5RlEvfpKGVBHocAY19+9bsprtpzvi9c65BRyyLpH3hovLjqbuel1Dk2XrydPG82M= X-Google-Smtp-Source: AGHT+IEN4o+Oox5ANVYMM6enY3uS/sHjTMeJBzvAdOgxkjHoFq8gCfsd5ag0i0sigeASyixlcr1XHQ== X-Received: by 2002:a05:600c:1906:b0:434:942c:1466 with SMTP id 5b1f17b1804b1-434d3fe3665mr70571545e9.29.1733410877656; Thu, 05 Dec 2024 07:01:17 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434d52c0bc7sm62830795e9.35.2024.12.05.07.01.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Dec 2024 07:01:17 -0800 (PST) From: Neil Armstrong Date: Thu, 05 Dec 2024 16:01:05 +0100 Subject: [PATCH v4 1/7] drm/msm: adreno: add defines for gpu & gmu frequency table sizes Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241205-topic-sm8x50-gpu-bw-vote-v4-1-9650d15dd435@linaro.org> References: <20241205-topic-sm8x50-gpu-bw-vote-v4-0-9650d15dd435@linaro.org> In-Reply-To: <20241205-topic-sm8x50-gpu-bw-vote-v4-0-9650d15dd435@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=1458; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=uvbHEXTw+a2tX2idu+ViK6cwh2GKBsinSbc9Nbsj/3M=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBnUcA3bFRWVZyYroAh7BnbdOr16taWEJgG0OfOdkw1 q8cOaJOJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZ1HANwAKCRB33NvayMhJ0R9oD/ 4uwOe9t4JiQcOr7JaHYVYqTinY/nVh3yjQKUgRsMDCw/y7ZR2XV1LV9N09Rq9DZSgt/II+yiXkuRAT bjxT/brdEgeEjTkEcQItDtvySc51oJEYdeq1kCFqb+1XnhbEbNYg2DsZWy/KM0sV4vFOwt+1VdrckQ 5+Yh0UR3w1PS8cpD+2WfcMEH8fc3vjJL4HaZJuF+SbKLzLnhExUAYu/sCDEPAG3iaZCy1Tmztf0Zxa nvph5tRyDl4oXzeIjvnFadXR9r9Z3xjcu/qy/kANOFC9k22biOavrz8tM0QSCb/Q8lIR7WqomYsV0+ Jyi+jYMSlTJCeM/4JoUa9x02PN+FrgtY/YvTt5G5NVhIejgBbYNvBJD049qD+86etVuoYjJkP5IDR1 WKZ5yatzqi+8mdu5oQefSQp6KXDE3z8szzKgr/0XxzAAz5YLhlOPSfLsOnF6tVYOGlX6MvySsaHFry HCOmlUYgOFhvl1ntM8Vjqk8wHNdD9wE5vWYHn2jGDcAcHBX9UOzaC1jMfuNWJr6SxuPY0uwA/3M1pv /dvujdKWYPgd2FAd9A8bgW4EMFRWYgs3cPHLxW2pk+P+4trvAYXIvhoePzUHFIPiXY53O8DAuEbZ4z hxA38RK663xNZEgIT/rRW5WEpljwbsmHMXkOtAkeDeipXVw8b5WjamtYsOWg== 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 Reviewed-by: Dmitry Baryshkov Reviewed-by: Akhil P Oommen Signed-off-by: Neil Armstrong --- 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/ad= reno/a6xx_gmu.h index b4a79f88ccf45cfe651c86d2a9da39541c5772b3..88f18ea6a38a08b5b171709e502= 0010947a5d347 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; }; =20 +#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; =20 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]; =20 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]; =20 unsigned long freq; =20 --=20 2.34.1 From nobody Thu Dec 18 08:13:36 2025 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (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 0B66F21638F for ; Thu, 5 Dec 2024 15:01:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733410883; cv=none; b=H7o5T9XKmrse83MQfp2SNpGKrs3d7Uk5QXbsv2n3wEeQqewZp+gfqc8nN2ipM3qyYQIjZL0CPnCk4qjFFBf+TizZUlx8RMkXrYN8QYVJVV0FnCs3q6U/l7YUS8WcY8NMsa+qeVgitRVbXyrUykPW2dvIN+lfvTy2nkZIg6AcVWo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733410883; c=relaxed/simple; bh=AFBn2s+RM4tSelG+CSWlChEN5C6TfvYSz1urqnevF9E=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=C4t29PwDzl5/ES/BCawD6pNkZ9Y2zOujA0hQqA9oxbh6dizGc0RVlj+EZkSBjG2Z0jdOFVnbBkpjOMYUF9jtEPBbU+nMqa7vD6wTAXJBPd+4FNi6tqrq2Fe/rh2PZXZMnOcAkvjAOkosneN5pG6GxTLqpRp09o1FaTn4dswCEHU= 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=DoftAd5z; arc=none smtp.client-ip=209.85.128.53 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="DoftAd5z" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-434a2f3bae4so10911985e9.3 for ; Thu, 05 Dec 2024 07:01:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733410879; x=1734015679; 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=SLp+DbXq90D3dyKDJuecin1rC2Og8R+EfL4+PzPI0T8=; b=DoftAd5zEK2GKheAT+9WgivY5ZX4j006sx5fMCcew4t5QTMJ/BcGVAYtFZQCIMVEmn zjkWGcDLsGUS4e3pHoCvSXcV446UdORglCzT+7Y5TW7v7LN+tLLV/8MMCm3kUoN/JBuG zxFlNa5Mna32ioOb4J5ZBGnyREyI/vFxl9/WQwj9i3wQHxJfu09+uvylzXukVfR0AnNF POdwldiCo89hyQN7BTipeqO8u9DTyzfrLtLg1h2bnrJjTpFU1Z8suAXT06Kb6BFybpKH 2AK/ewZF5pMFjhWNJbJYSWzDEWsElFbN8m0mHI13L0T4ecbAIZd3jL+LPAk7Rw9i9LhB KntA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733410879; x=1734015679; 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=SLp+DbXq90D3dyKDJuecin1rC2Og8R+EfL4+PzPI0T8=; b=BjhLHf3sDvtPS1qHN4zIB/OC1BEJt2SQbDuY0RvuqXqH4x5As0PDB8k1KW5Wy45jZC VdYNWaJ+c4+JypiqvFxizE/1AUU3qrfKYqfOzzT7+unEG1rXeicWRKbfHtfEG62gJCI9 crHWRhSIzaY2GEB8L+cwSNJntNBlfKiCR1ajNHj7xlx/0krORxUfMEn5fAhGiW6mKEZ2 16rsuMS9H5IgCFHATfhMgXCeQGt2wm16+xdsHL5EGMI1rmuD9fEzNmpaxWlyL4f2Ier1 XHjDogSQeXnat7CeEZbX15+/6TwMjZ50RVTIz7/E0Y1GwGOMSeyeS6vQHGzW54LF0XqJ s4xw== X-Forwarded-Encrypted: i=1; AJvYcCUaMUQtTvphZOzsX+ieP+J1DuIartRUkUDMrfu1acO6uYYe7W/O6CUJlt2OHzxCQsNY1wE/orn5ohXLMfE=@vger.kernel.org X-Gm-Message-State: AOJu0Yx1oF1ft0deYuJzrYuIGbS/OoYdRJBDhvm2Apj5KsA++fKyoe7q IbAzQVVyFs4UJS94ydVsWIkphGQWOERzHs+LP0nSpAU6CcfTXcKupwCjb2Ni4oQ= X-Gm-Gg: ASbGncvoA3MgPyygevsBBMzoBb2+AFqBNI1IsnHIwNLCPUQKYItYq5zs5n+n53F3lmw 6XnXBciF7+BBXS4P5hoevax6mZgLB+rSCNmejJlwPJzPFYaaNGhrKvj2lZ+QvVPU1ofIo/knxxO Ofvhgyl5g36r12j66x2AtmhhJEbihDE4Go79kxbG0Jid1qmRH0LaJo3VyaGROO4NpqEKf5+WIXh MN8sTaSqUS3rvhE8APjFJPcRPXnOBX4t49U2H8IO71dtqlWmk67NtyMj9TeTbuy9KmAdXE= X-Google-Smtp-Source: AGHT+IEMfDY9Qmea0MCuZ1uuDSp1eGa3UO0w2WAQemaQFoYnGy/nc2emuVkuUMMIV2sbm4DADpQ7RA== X-Received: by 2002:a05:600c:314a:b0:42c:b905:2bf9 with SMTP id 5b1f17b1804b1-434d09c3249mr99659355e9.16.1733410878906; Thu, 05 Dec 2024 07:01:18 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434d52c0bc7sm62830795e9.35.2024.12.05.07.01.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Dec 2024 07:01:18 -0800 (PST) From: Neil Armstrong Date: Thu, 05 Dec 2024 16:01:06 +0100 Subject: [PATCH v4 2/7] drm/msm: adreno: add plumbing to generate bandwidth vote table for GMU Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241205-topic-sm8x50-gpu-bw-vote-v4-2-9650d15dd435@linaro.org> References: <20241205-topic-sm8x50-gpu-bw-vote-v4-0-9650d15dd435@linaro.org> In-Reply-To: <20241205-topic-sm8x50-gpu-bw-vote-v4-0-9650d15dd435@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=8870; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=AFBn2s+RM4tSelG+CSWlChEN5C6TfvYSz1urqnevF9E=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBnUcA46zLn82xY6K0FF4hjXrIYBRa0M+n6rSmgUKwc yNTphQ2JAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZ1HAOAAKCRB33NvayMhJ0Zv1EA CoBQu+5nY+g6PBrEdwALlbQpe/VH9d6/I4KIrwVAjxCzvNNztj222JIlbKSL1xEZfLbfMuYkGwnEQF B78yKVToBBAS6o0HbZMVICgi8gUZPZcHCFVcBy9Enpr5fgQvMoDcKY3ofLmgI32PASGs0VjRY3wQNC wc9O++ya2oZToSO0aEzBLrv4Djtjb3BbTORY12lWC0n1tXvL1aQgoy/H/mI6YuaxX3SuUFboNE6jSS wC+9tOmbc48j/Mupo8xtdThpwkSBcZJvU1b2p/7KN6GPqlk2DEDzNC3gBQplUI+mKjz1SR66+UYVqc TFzIX8riw9P428CeWDCyCQWxKbX9eNL8U/CQj0HdZQsk9jd2YAn2BgNMjyBuoqQACbGtRc034dQM9k CbP5ddhrOevV8PGewEQjGV1aEXTDxIgOqe+3Hi2JeUtb86xaxdEoo2jON+CxVLs7cK8YMyVdBVJb4f XFKPBfmHCPHyhc0ihCeZrpXX0Oifo9YWKvfU4LWhT+t1eCQSU7YEddWtZ5Smut5eOlwqKkIgJeoQGx Rkl3/PypZEcr5TdHzzulmtXrQYBdA2IBJYYoBE4W8m2jb9Ms3zj+8b7YMh01oWLPjTwJaWUFutoVm8 8siD5GDqkLom14D7pwoXIyjRA9EWrrBQaIrbdUEUrgnIkN3qDMtqcK2k0i0Q== 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 other side the GMU also takes another vote called AB which is a 16bit quantized value of the floor bandwidth against the maximum supported bandwidth. The AB vote will be calculated later when setting the frequency. 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 Reviewed-by: Akhil P Oommen --- drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 144 ++++++++++++++++++++++++++++++= ++++ drivers/gpu/drm/msm/adreno/a6xx_gmu.h | 13 +++ drivers/gpu/drm/msm/adreno/a6xx_gpu.h | 1 + 3 files changed, 158 insertions(+) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/ad= reno/a6xx_gmu.c index 14db7376c712d19446b38152e480bd5a1e0a5198..36696d372a42a27b26a018b19e7= 3bc6d8a4a5235 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 =20 #include "a6xx_gpu.h" @@ -1287,6 +1288,101 @@ static int a6xx_gmu_memory_probe(struct a6xx_gmu *g= mu) return 0; } =20 +/** + * struct bcm_db - Auxiliary data pertaining to each Bus Clock Manager (BC= M) + * @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 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] =3D { 0 }; + unsigned int bcm_index, bw_index, bcm_count =3D 0; + + if (!info->bcms) + return 0; + + /* Retrieve BCM data from cmd-db */ + for (bcm_index =3D 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] =3D 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 =3D 0; bw_index < gmu->nr_gpu_bws; bw_index++) { + u32 *data =3D gmu->gpu_ib_votes[bw_index]; + u32 bw =3D gmu->gpu_bw_table[bw_index]; + + /* Calculations loosely copied from bcm_aggregate() & tcs_cmd_gen() */ + for (bcm_index =3D 0; bcm_index < bcm_count; bcm_index++) { + bool commit =3D false; + u64 peak; + u32 vote; + + /* Skip unconfigured BCM */ + if (!bcm_data[bcm_index]) + continue; + + if (bcm_index =3D=3D bcm_count - 1 || + (bcm_data[bcm_index + 1] && + bcm_data[bcm_index]->vcd !=3D bcm_data[bcm_index + 1]->vcd)) + commit =3D true; + + if (!bw) { + data[bcm_index] =3D BCM_TCS_CMD(commit, false, 0, 0); + continue; + } + + if (info->bcms[bcm_index].fixed) { + u32 perfmode =3D 0; + + if (bw >=3D info->bcms[bcm_index].perfmode_bw) + perfmode =3D info->bcms[bcm_index].perfmode; + + data[bcm_index] =3D BCM_TCS_CMD(commit, true, 0, perfmode); + continue; + } + + /* Multiply the bandwidth by the width of the connection */ + peak =3D (u64)bw * le16_to_cpu(bcm_data[bcm_index]->width); + do_div(peak, info->bcms[bcm_index].buswidth); + + /* Input bandwidth value is in KBps, scale the value to BCM unit */ + peak *=3D 1000ULL; + do_div(peak, le32_to_cpu(bcm_data[bcm_index]->unit)); + + vote =3D clamp(peak, 1, BCM_TCS_CMD_VOTE_MASK); + + data[bcm_index] =3D BCM_TCS_CMD(commit, true, vote, vote); + } + } + + 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 +1486,15 @@ static int a6xx_gmu_rpmh_arc_votes_init(struct devi= ce *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 R= PMh * voltage levels and build the votes + * The GMU can also vote for DDR interconnects, use the OPP bandwidth entr= ies + * and BCM parameters to build the votes. */ =20 static int a6xx_gmu_rpmh_votes_init(struct a6xx_gmu *gmu) { struct a6xx_gpu *a6xx_gpu =3D container_of(gmu, struct a6xx_gpu, gmu); struct adreno_gpu *adreno_gpu =3D &a6xx_gpu->base; + const struct a6xx_info *info =3D adreno_gpu->info->a6xx; struct msm_gpu *gpu =3D &adreno_gpu->base; int ret; =20 @@ -1407,6 +1506,10 @@ static int a6xx_gmu_rpmh_votes_init(struct a6xx_gmu = *gmu) ret |=3D a6xx_gmu_rpmh_arc_votes_init(gmu->dev, gmu->cx_arc_votes, gmu->gmu_freqs, gmu->nr_gmu_freqs, "cx.lvl"); =20 + /* Build the interconnect votes */ + if (info->bcms && gmu->nr_gpu_bws > 1) + ret |=3D a6xx_gmu_rpmh_bw_votes_init(info, gmu); + return ret; } =20 @@ -1442,10 +1545,43 @@ static int a6xx_gmu_build_freq_table(struct device = *dev, unsigned long *freqs, return index; } =20 +static int a6xx_gmu_build_bw_table(struct device *dev, unsigned long *band= widths, + u32 size) +{ + int count =3D dev_pm_opp_get_opp_count(dev); + struct dev_pm_opp *opp; + int i, index =3D 0; + unsigned int bandwidth =3D 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 =3D size - 1; + + /* Set the "off" bandwidth */ + bandwidths[index++] =3D 0; + + for (i =3D 0; i < count; i++) { + opp =3D dev_pm_opp_find_bw_ceil(dev, &bandwidth, 0); + if (IS_ERR(opp)) + break; + + dev_pm_opp_put(opp); + bandwidths[index++] =3D bandwidth++; + } + + return index; +} + static int a6xx_gmu_pwrlevels_probe(struct a6xx_gmu *gmu) { struct a6xx_gpu *a6xx_gpu =3D container_of(gmu, struct a6xx_gpu, gmu); struct adreno_gpu *adreno_gpu =3D &a6xx_gpu->base; + const struct a6xx_info *info =3D adreno_gpu->info->a6xx; struct msm_gpu *gpu =3D &adreno_gpu->base; =20 int ret =3D 0; @@ -1472,6 +1608,14 @@ static int a6xx_gmu_pwrlevels_probe(struct a6xx_gmu = *gmu) =20 gmu->current_perf_index =3D gmu->nr_gpu_freqs - 1; =20 + /* + * 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 =3D 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/ad= reno/a6xx_gmu.h index 88f18ea6a38a08b5b171709e5020010947a5d347..2062a2be224768c1937d7768f7b= 8439920e9e127 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 { =20 #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; +}; =20 /* * These define the different GMU wake up options - these define how both = the @@ -85,6 +94,10 @@ struct a6xx_gmu { unsigned long gpu_freqs[GMU_MAX_GX_FREQS]; u32 gx_arc_votes[GMU_MAX_GX_FREQS]; =20 + int nr_gpu_bws; + unsigned long gpu_bw_table[GMU_MAX_GX_FREQS]; + u32 gpu_ib_votes[GMU_MAX_GX_FREQS][GMU_MAX_BCMS]; + 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/ad= reno/a6xx_gpu.h index 4aceffb6aae89c781facc2a6e4a82b20b341b6cb..9201a53dd341bf432923ffb4494= 7e015208a3d02 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; }; =20 struct a6xx_gpu { --=20 2.34.1 From nobody Thu Dec 18 08:13:36 2025 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.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 4C52C21A440 for ; Thu, 5 Dec 2024 15:01:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733410884; cv=none; b=HmVpU/8wQ1D2wmSO9WScml7CEVnWioOEDuwwZ7HzL4vmv2s62dlGbLcBItgW6vScBPLo1eTw/aTmrb/mZzzRR9C8Ai2UgvNjldgBoCdGddR2jE7CTgwzJcyTvKj8HNLY3FDFmSB7bpbbcN10WcCdLj/BRh1QptTlQPmfPz44ChQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733410884; c=relaxed/simple; bh=kKOOTThIk8iPzovAMSJ3CIAP9ALUD9Nh/ftHJ5udojQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=o4snGtEI2CGgzzdH0cTCqVQEG2wH1g43sUTC4rXlJ9cKNRodgOiqJia+hsW0aMLoVnbo0j00VytbWg90qA1jOf+2fEqCDJF78MzC2Uk7PWsMVZ5FXLhWLOGsU/EH0HCZdjTVuaJNQAvJkmIbxj5TBVVqivmnTEaDRTsgGrLCkpc= 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=KjKKhgYP; arc=none smtp.client-ip=209.85.128.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="KjKKhgYP" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-434a752140eso7054775e9.3 for ; Thu, 05 Dec 2024 07:01:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733410881; x=1734015681; 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=wVDHOHcdQFmM3Y+rOV7NlR5dp4TOlaLEYtlDOJJ7ARk=; b=KjKKhgYPgV4Dh9eUTq9crYmjtvNUdAkaUesqVWrKw0U5qYXurOvbd9/W+e/nzM6StI 2M9SObZOtni8MnLKsfD/34UwpN24FPuV9zj37lCmmHgHjAwkQnazk9sqxEmyhqnY1Vz4 PHv/P0PYnN4YoIrla72BkbbZv1xd6xACzUdwL6TuJaLFWPsA9PXb072oeGRJUhWliuyG ShSyOQ8f4Gea0ucsuSq/XvBZboWPUAkRcLzl4wOMU0ecJMjV2PrtXiQJUByLTeiGPA1j kiVoqxv09B/ZMRyzexmgbI0xm1OCuxEFDOZj3Y83OzorxegSzZfe2NoALGiAUE5V4Oaz wk1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733410881; x=1734015681; 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=wVDHOHcdQFmM3Y+rOV7NlR5dp4TOlaLEYtlDOJJ7ARk=; b=oLAQ6VY86tnYL/gnGYC9eUeHuBAR/0Cefl/y+0FCzcpgokdjZ/BMNH7Uar0aMfnARe wQZdwZ6SUnMIL7KzEPFRJsNxGYKpKCmBNptmDaR/n2dSaQMqKsLXj3pu5u82VBkYJWhm KSQXMUBAIDC0wDkJcYZkxA9Kvt3iKA/762WkwihhpTAzZkItZQCZf8yOAbabH1hQplIo 55VfNJunEIMw4iSfx0Rv20jpvnHy6XPDQs/HY3aq0cg/KuHeoHX7qhSMhl1urgb2lDVU ezyCGNGr99lIEwmWj3F1RVDzGCUHzmGomXWtwKLvsBAOyBauYyb0Mrbx3VHKc0Kg3SVe W/xw== X-Forwarded-Encrypted: i=1; AJvYcCWFvyWfoeHxCUpLJbjw4Fnvzz8WYy60cwWpgQ+jE8CPpAepVohxwVmzoYWVnN8+HLvAQYS0zMu8SJVZVwg=@vger.kernel.org X-Gm-Message-State: AOJu0YxXer8RqIxpbY5WJYL8d1njfv6SbDQFOrzzcSr8oBfxh0a2pjPp aom9s14qzNOyV00SmpDPs2BbotKcoTuS4xKnEGzGz10P4UJq2Ygz4fLsGpasGgk= X-Gm-Gg: ASbGncuW49b+wIZr34PDq6qGGhI/2QXrCrJ/C0dL7+D+tTQtw9IDYTjnufUJkr6ZLr9 6CLGGdtffaynTis/i4qG/1+qTR/a7ZwdDjh/WEF4vKsF8mnbjOdOPhjye00imF/zWhmqk2ETIsI viHFMQmwvzl7aI1Ug7sRH0sV3un+97F4ZHJDXVeTRNcMxodqUVK7fNdcTbAIYw4GxHrsnPkKLdn iGjRKjxsNzxyguI0Fb2tzCjUXvdmJEOaq+gGyo6Xj5iQNJLLFXj7wdR4Vr9wE0fqSw9w40= X-Google-Smtp-Source: AGHT+IHUl3mX3zFLLOKzIPmjsomDMmz+8GFN7zIY7QDmDt0FQywuKl8zC4gmZxmQjk+lB0wUQS854g== X-Received: by 2002:a05:600c:4f52:b0:434:9ef2:f6dc with SMTP id 5b1f17b1804b1-434d09bee8fmr96401865e9.13.1733410880045; Thu, 05 Dec 2024 07:01:20 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434d52c0bc7sm62830795e9.35.2024.12.05.07.01.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Dec 2024 07:01:19 -0800 (PST) From: Neil Armstrong Date: Thu, 05 Dec 2024 16:01:07 +0100 Subject: [PATCH v4 3/7] drm/msm: adreno: dynamically generate GMU bw table Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241205-topic-sm8x50-gpu-bw-vote-v4-3-9650d15dd435@linaro.org> References: <20241205-topic-sm8x50-gpu-bw-vote-v4-0-9650d15dd435@linaro.org> In-Reply-To: <20241205-topic-sm8x50-gpu-bw-vote-v4-0-9650d15dd435@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=3310; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=kKOOTThIk8iPzovAMSJ3CIAP9ALUD9Nh/ftHJ5udojQ=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBnUcA4JDsgcp2rc0Ft4I+luHcAU8M6E9S7ClY/bthP zWuNzMWJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZ1HAOAAKCRB33NvayMhJ0ffyEA CKsONbYHtKmFeuonBgULVuJZzLi5rZnO6U7NUT/7iLLm7FximyGOA4kym56YIVhRv5mBKHfIWVQzF9 dy5hqag96netnbe1ggn1PqmAPMz4Q23un6xYMaDxQOEb11SX+Rar3bVVNRBVPe/B18V8dsXl89Twfs NzfCtL5u/xFnHDeqc1+OUdPtcOyT4+v3nNENjSbGeBv1nC/2/ro6vYrZNObcbAWOyz6LGEYvpu736h iQWdVx0nNWc5/pGwnZMUYfjX9PLSvYgJDzUlu9PVmKMp6redBw/CJmffbGkva6tLsAyLoj1451YNGQ fDr+XmuS0FV3qiDSTV7LOSrfFT4BL0Huj+udIjpKW4JmFxjoFa2yM+VeH1f3oKfpwj7+Ob3IwosqrL 3WN5BGxb0PBvTV/Dsa0pc0ETUYUyPTYQko5990K9MNfUjgoXGrRT53IR90eLHkUOtYsBzz6OsKl8Z8 yib8Z9YpVkOlbHtaH5xiuEaEKU/GmZJeLY9rgbWdKuxt4jwkVCGey0UAq/Y79Gggt/CGHGhwOSlpl8 LrFqkr3xnj7ObRdQH55UytkcXUQ3iqK2PuMnyH+eaduBNrB5GmIrW9vDuAO5cpUcNb/X5/ti3aX8Kw 03Q9BXNjeOQTE+ofgIezjfYV2tpcHeI8pStf7IMhm7/nQacMyEPEVZWr/I2w== 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 entries 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 | 41 +++++++++++++++++++++++++++++++= +++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_hfi.c b/drivers/gpu/drm/msm/ad= reno/a6xx_hfi.c index cb8844ed46b29c4569d05eb7a24f7b27e173190f..fc4bfad51de9a3b6617fbbd0347= 1a5851d43ce88 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_hfi.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_hfi.c @@ -5,7 +5,10 @@ #include #include =20 +#include + #include +#include =20 #include "a6xx_gmu.h" #include "a6xx_gmu.xml.h" @@ -259,6 +262,39 @@ static int a6xx_hfi_send_perf_table(struct a6xx_gmu *g= mu) NULL, 0); } =20 +static void a6xx_generate_bw_table(const struct a6xx_info *info, struct a6= xx_gmu *gmu, + struct a6xx_hfi_msg_bw_table *msg) +{ + unsigned int i, j; + + msg->ddr_wait_bitmask =3D QCOM_ICC_TAG_ALWAYS; + + for (i =3D 0; i < GMU_MAX_BCMS; i++) { + if (!info->bcms[i].name) + break; + msg->ddr_cmds_addrs[i] =3D cmd_db_read_addr(info->bcms[i].name); + } + msg->ddr_cmds_num =3D i; + + for (i =3D 0; i < gmu->nr_gpu_bws; ++i) + for (j =3D 0; j < msg->ddr_cmds_num; j++) + msg->ddr_cmds_data[i][j] =3D gmu->gpu_ib_votes[i][j]; + msg->bw_level_num =3D gmu->nr_gpu_bws; + + /* + * These are the CX (CNOC) votes - these are used by the GMU + * The 'CN0' BCM is used on all targets, and votes are basically + * 'off' and 'on' states with first bit to enable the path. + */ + + msg->cnoc_cmds_num =3D 1; + msg->cnoc_wait_bitmask =3D QCOM_ICC_TAG_AMC; + + msg->cnoc_cmds_addrs[0] =3D cmd_db_read_addr("CN0"); + msg->cnoc_cmds_data[0][0] =3D BCM_TCS_CMD(true, false, 0, 0); + msg->cnoc_cmds_data[1][0] =3D BCM_TCS_CMD(true, true, 0, BIT(0)); +} + static void a618_build_bw_table(struct a6xx_hfi_msg_bw_table *msg) { /* Send a single "off" entry since the 618 GMU doesn't do bus scaling */ @@ -664,6 +700,7 @@ static int a6xx_hfi_send_bw_table(struct a6xx_gmu *gmu) struct a6xx_hfi_msg_bw_table *msg; struct a6xx_gpu *a6xx_gpu =3D container_of(gmu, struct a6xx_gpu, gmu); struct adreno_gpu *adreno_gpu =3D &a6xx_gpu->base; + const struct a6xx_info *info =3D adreno_gpu->info->a6xx; =20 if (gmu->bw_table) goto send; @@ -672,7 +709,9 @@ static int a6xx_hfi_send_bw_table(struct a6xx_gmu *gmu) if (!msg) return -ENOMEM; =20 - if (adreno_is_a618(adreno_gpu)) + if (info->bcms && gmu->nr_gpu_bws > 1) + a6xx_generate_bw_table(info, gmu, msg); + else if (adreno_is_a618(adreno_gpu)) a618_build_bw_table(msg); else if (adreno_is_a619(adreno_gpu)) a619_build_bw_table(msg); --=20 2.34.1 From nobody Thu Dec 18 08:13:36 2025 Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) (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 CB642BE49 for ; Thu, 5 Dec 2024 15:06:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733411212; cv=none; b=jJpDyqGdpn6gApG5Ue8fR/yXAHFCAGXfWyHvOUg4rt40jA2OLb7QCl1f7CMQsNdyCH4ByDbdKQ+Es4ScWiCXCtS4v3NxCxaL+QHM22MWv2ippeYHZmR6WnQRbL8x3MO/Z7q6T5hqbRRQROFchvL63YSRFo5x6T2l4vfQ6QeKQTI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733411212; c=relaxed/simple; bh=/vvfdxnrBoRZ8tYl8FRklALE0KalVmA2J6aZIhuf4/U=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qT2RzJu8G5T9bw2DHnLqcc63euvQjAw23HrImbhJf4SGI6cbt0LfVcOgq59qeNqxogNYK5JN1yqeD8EiEjwe3s38RqNsIR2kVxeZK4iC69cA6VCsUYM3tlJMdNBXl2v1QfrkrPWCQuOTV1nBQ+XVcmksuLo4knwuawG0CFuvCVc= 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=sBQnZ+g0; arc=none smtp.client-ip=209.85.208.47 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="sBQnZ+g0" Received: by mail-ed1-f47.google.com with SMTP id 4fb4d7f45d1cf-5ceb03aadb1so1342083a12.0 for ; Thu, 05 Dec 2024 07:06:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733411209; x=1734016009; 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=W4oP5izvNF5OOtr3Waf88aH91OpBFvN5iR6It/NxVU4=; b=sBQnZ+g0uh9WopVuR06Muk8TasTx4vSuDjliV5b7M/3YRqLlYHpiplUC17UBCYvEW1 OSYPrmlaFJCaKBr+C2pp3eOrBRJ7P+xtYs3wTrXTc5uc5cKoSlm5kXCI4JXf8xmX0C1Y 1BYOlXcjApSod90E01/1UZCZURzChQfwmNt9jt5EZX1CnGsOD3x+L7NvPrB92L5wEKZH Cdo9ZCe3k4V8nTJulx+rsi39PoDA5HdGCnZGx9wE0f3JIJGVT/GkfoHTLa9fU6cvf4MX ZuD3F3jl9pmpGHPrsSpRADli8o1FflVy9c5Q56L5pOLvyG7Sl7T9W/gxgPj/DAcacVUY Qs1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733411209; x=1734016009; 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=W4oP5izvNF5OOtr3Waf88aH91OpBFvN5iR6It/NxVU4=; b=ICDSMBBr48+qcHWIQ6jGl08BGlnpgaS3WmpKSGm3W67dwICaJxoEt9G1EjmaL3CN1I u6g9cVdB3f8D+r4RI4ZPWBqgh+IAo7MfSkiiIzwRdRUH/CasloV1mB86k/EcUm71nNsk dZQ8oa0gfTsJUYM/lE74FZQXy1rJ5YiIsJC7Zehpdv9LeUy3an2FZdwsVWsfa3+pSU9r /MlVwPYQIMQYiY0+T82kLKz8KSuWlT76sjNNo+3163flrSTJ8YSgqutD7Ztp8ZssMGBE i+Q5PKoyOtML3vWlP/H+kL/0qxCdT4YRIFXyzfE7Q++QMvL7nstIGJM+m133eg8stfSI 082w== X-Forwarded-Encrypted: i=1; AJvYcCVl0Zsuq2PMNeQU8eBWHOR1CziwQsST6zXIsQOZgJ495Q4mYJT0glB9DwpI8TqFABMVDRITHAhwt7NmO/Q=@vger.kernel.org X-Gm-Message-State: AOJu0YyGKI3rL5OXoEgL5R2/9tPzDWzmWykv9ILojFE4tIaehM1Q2Z0B JcYkWl1hS9b/h6xzkNpO3w2dQ49b4ILAkufnAgV+u57MEHMXo1mmqv3e2ukBrrFOX5yX/GbFdWE Sj/o= X-Gm-Gg: ASbGncseUqd/UVuz4DyXxis++unSA4vRTPV2A17qTukGvhh1bbejboDz+pkw+X3j349 UFleo37PzlCOb+liD/uu+V647rkNxqgZRZZwc6WrnFR7eq7y1HmaLWTCjxOPK1ryNd9TOlLGGrr u1twG9S9DRrXUkBv+P9M7Otctn+0ZXlUbM+ALx7rP9JLy84yYJleVmec1X4AxfXnQio6uYg2ExR U67nzrUiLld9+jk3U619oVvy4gjbgyK2KCGCrsSbfMhllmhXwlLHnOMKmLNo+KHW/0DTJ8= X-Google-Smtp-Source: AGHT+IG3n3rheA8zko7qp1b4VyWBqjQnC6L2ZIjk3x6yI5qCJphyIylEY95jPMeS/SIWqqrgwJ70ug== X-Received: by 2002:a05:600c:4f87:b0:42c:b5f1:44ff with SMTP id 5b1f17b1804b1-434d0a07e55mr91108605e9.24.1733410881161; Thu, 05 Dec 2024 07:01:21 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434d52c0bc7sm62830795e9.35.2024.12.05.07.01.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Dec 2024 07:01:20 -0800 (PST) From: Neil Armstrong Date: Thu, 05 Dec 2024 16:01:08 +0100 Subject: [PATCH v4 4/7] drm/msm: adreno: find bandwidth index of OPP and set it along freq index Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241205-topic-sm8x50-gpu-bw-vote-v4-4-9650d15dd435@linaro.org> References: <20241205-topic-sm8x50-gpu-bw-vote-v4-0-9650d15dd435@linaro.org> In-Reply-To: <20241205-topic-sm8x50-gpu-bw-vote-v4-0-9650d15dd435@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=5830; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=/vvfdxnrBoRZ8tYl8FRklALE0KalVmA2J6aZIhuf4/U=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBnUcA4ffp2G+r00yspMOON4TPqISXjmk5DodVVlf2F H8WdJpCJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZ1HAOAAKCRB33NvayMhJ0fddD/ wMF+R1NR6QAWBxUcL7E/VOuFvVHeL7qSzhnc+eC5gdjLdR26WoI6NC8CcWf+9LPmHXcz/Mz+Mgxk/A PSNdYkxunfSeJqU5KGBAlHRVbJgno/BG+iawJWg9jN2NM4TOZF6MWF4HFDqH567GPyg0u8ZMfBpCcI HgmAQINM5DGWIkdlVDSPsFTgcSPvy7aLEHjMr47xbxNoVvHRHhJMuqOb0aVL7oGZTPnCLZHea+50UE h+CB/cxDC7gSIZ48QbXGr6Im7AUnlYMI2bCM/rP+oOK+uJA5snrVVG1XGzrMAbihAiJhAd8bcXz/JS iOvizEb4ZjzdYgfLDJzi2Z3SfUfNnYHSSunl8rXt6xZ/RAsDySoocW2jRtiRzJ84k3GtcjawR3zy3W JtsHOfh8RpyxaOMbTATPAZ8GgxSPqML+Xcywv/iDNgYVcmmNzs5KH8aYW3/Zz8Y7Hz0mdx85QOZKZm VwMvCsDky94NoQhyaQhLtTrifNCieUjDaoWjZ/cBnsAuaJD6xSvR67pF5iNVsMaFA6OtgGPThGMWIx lTzt8j/S3diqSHlXUBESbW4OENOA5geXascNO3nSZtXdpFOU/4OzCPy3QYpMuGo3ZuVTCP5AyD6Q4t JhbL6EVYTzJQ1b8jXawuL0R7aa8JAdn14KLTZWVKkLu9kQJqIRdygm/3I2Rw== 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 GMU also takes another vote called AB which is a 16bit quantized value of the floor bandwidth against the maximum supported bandwidth. The AB is calculated with a default 25% of the bandwidth like the downstream implementation too inform the GMU firmware the minimal quantity of bandwidth we require for this OPP. 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. Reviewed-by: Dmitry Baryshkov Signed-off-by: Neil Armstrong Reviewed-by: Akhil P Oommen --- drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 39 +++++++++++++++++++++++++++++++= ++-- drivers/gpu/drm/msm/adreno/a6xx_gmu.h | 2 +- drivers/gpu/drm/msm/adreno/a6xx_hfi.c | 6 +++--- drivers/gpu/drm/msm/adreno/a6xx_hfi.h | 5 +++++ 4 files changed, 46 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/ad= reno/a6xx_gmu.c index 36696d372a42a27b26a018b19e73bc6d8a4a5235..46ae0ec7a16a41d55755ce04fb3= 2404cdba087be 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 =3D to_adreno_gpu(gpu); + const struct a6xx_info *info =3D adreno_gpu->info->a6xx; struct a6xx_gpu *a6xx_gpu =3D to_a6xx_gpu(adreno_gpu); struct a6xx_gmu *gmu =3D &a6xx_gpu->gmu; u32 perf_index; + u32 bw_index =3D 0; unsigned long gpu_freq; int ret =3D 0; =20 @@ -125,6 +127,37 @@ void a6xx_gmu_set_freq(struct msm_gpu *gpu, struct dev= _pm_opp *opp, if (gpu_freq =3D=3D gmu->gpu_freqs[perf_index]) break; =20 + /* If enabled, find the corresponding DDR bandwidth index */ + if (info->bcms && gmu->nr_gpu_bws > 1) { + unsigned int bw =3D dev_pm_opp_get_bw(opp, true, 0); + + for (bw_index =3D 0; bw_index < gmu->nr_gpu_bws - 1; bw_index++) { + if (bw =3D=3D gmu->gpu_bw_table[bw_index]) + break; + } + + /* Vote AB as a fraction of the max bandwidth */ + if (bw) { + u64 tmp; + + /* For now, vote for 25% of the bandwidth */ + tmp =3D bw * 25; + do_div(tmp, 100); + + /* + * The AB vote consists of a 16 bit wide quantized level + * against the maximum supported bandwidth. + * Quantization can be calculated as below: + * vote =3D (bandwidth * 2^16) / max bandwidth + */ + tmp *=3D MAX_AB_VOTE; + do_div(tmp, gmu->gpu_bw_table[gmu->nr_gpu_bws - 1]); + + bw_index |=3D AB_VOTE(clamp(tmp, 1, MAX_AB_VOTE)); + bw_index |=3D AB_VOTE_ENABLE; + } + } + gmu->current_perf_index =3D perf_index; gmu->freq =3D gmu->gpu_freqs[perf_index]; =20 @@ -140,8 +173,10 @@ void a6xx_gmu_set_freq(struct msm_gpu *gpu, struct dev= _pm_opp *opp, return; =20 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; } =20 diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.h b/drivers/gpu/drm/msm/ad= reno/a6xx_gmu.h index 2062a2be224768c1937d7768f7b8439920e9e127..0c888b326cfb485400118f3601f= a5f1949b03374 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.h +++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.h @@ -209,7 +209,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); =20 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/ad= reno/a6xx_hfi.c index fc4bfad51de9a3b6617fbbd03471a5851d43ce88..5c566ce6612ed25763337d20de9= 0d78697dfb801 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_hfi.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_hfi.c @@ -765,13 +765,13 @@ static int a6xx_hfi_send_core_fw_start(struct a6xx_gm= u *gmu) sizeof(msg), NULL, 0); } =20 -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 =3D { 0 }; =20 msg.ack_type =3D 1; /* blocking */ - msg.freq =3D index; - msg.bw =3D 0; /* TODO: bus scaling */ + msg.freq =3D freq_index; + msg.bw =3D bw_index; =20 return a6xx_hfi_send_msg(gmu, HFI_H2F_MSG_GX_BW_PERF_VOTE, &msg, sizeof(msg), NULL, 0); diff --git a/drivers/gpu/drm/msm/adreno/a6xx_hfi.h b/drivers/gpu/drm/msm/ad= reno/a6xx_hfi.h index 528110169398f69f16443a29a1594d19c36fb595..52ba4a07d7b9a709289acd244a7= 51ace9bdaab5d 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; }; =20 +#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 =20 struct a6xx_hfi_prep_slumber_cmd { --=20 2.34.1 From nobody Thu Dec 18 08:13:36 2025 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 92C8F21D589 for ; Thu, 5 Dec 2024 15:01:24 +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=1733410887; cv=none; b=kLEsF6Zmt5yjfkdbOTMMhkE3pHk4qlktnbcPvVO7ORoLQ3FSmn/1Z8a4OPM5Y9DuaEWGOXM8mL8BPrQoRt3bdY29vxvZmgiCt1cLlaLd5qiXBY+QJpAe0c2G3EgGEDgnWX2np+aubdwappIPjkb0Ka50F3jiCh425KDz+IDXXBs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733410887; c=relaxed/simple; bh=xjNH0ZqzPNeRyAGL1QAVeh9hZcwP2oOm7fBqheYEiRE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=O2GNiMN6MoYgmn6A9lohf6+4pjTOpfcvVIes55MW0GQqenOoSbO5DCcei+U+k+C7QmYo/mZZucMjGVIOpSA6DiFdbZwShEtot90M67gCZdJsjtoI1dBkwJyRax6dKCcpjmSMVU0vrC+dGFMnJfrTJLxLvHlIYoZL9Nz5I4SNqhM= 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=V6qWLzIl; 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="V6qWLzIl" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-434a10588f3so7074655e9.1 for ; Thu, 05 Dec 2024 07:01:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733410883; x=1734015683; 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=pVmiCOyrS2ecuSLMnmZgZ6KHsHdqqKLAjno5SAELDnw=; b=V6qWLzIldJNkGhPdS9/LZVUgCDLErzm2l+n6kdkiAR6HX3MILXsmwd9Hn5SdJSdd+B tOI4K2CFNbrolW3+M8simKsu6EdTzbmXSdFvMcl1E+44w9fmQwoU6sT6pwtI24EAJjBd R8TJWbZJiXR8vuiTR+ASta0mnDaB7o1M8WW//+9kbkIyfN8jUfzKf+v4gm9/yKzwwGxq CtlckjwzWYbWSbCj69k2drtR86Nbh5eU0mv2SV2sgAN2Lacb8hM0Afv3oDI97RcJW0nW OmAccun3qy228xowvUkoYpAuTNeW0m2AyUCHbF5QUtIPuW3CkTh21XcJUbrFiF9hL2o3 9Opg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733410883; x=1734015683; 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=pVmiCOyrS2ecuSLMnmZgZ6KHsHdqqKLAjno5SAELDnw=; b=aytpPFtosny3WRIMSx+yKy5iYkRitS9LpU/TvYBqeZJ8wm6gUuXCISc1DBtzCNmbwD TZ8hVZpSHEdc58uLTn+mzDWRuWJrjFFO49maTWWW7SNhSJ2rpqToVDyqufrRVpNVzvRR 4depeXJfHy9EhsLNbXY+4kPGBm4GWyGd/VDTMUgwqtuEBCEXoh0FFVKQia06adhKwHYj cizXk9T/qAOXEnZkYNcdBCIq1mp6uADIFOxmNJz9FRgnvRq+/Y/B3rUAqmcL3lZUQWzB Tnr5tM3OvN6AfawJ8pX/rjD2p1dpJrAI2VMVX7Q4+WI2TPMqCS6U9lcG2LGPrmHufK5U APIw== X-Forwarded-Encrypted: i=1; AJvYcCVsDAandEJL8mJj6i6qUpHFzp+mu8da9759qkWVh4r6lgZ1LDCfo2HCPEkEdcWpT5ccJFjdL7SxDZe3mxA=@vger.kernel.org X-Gm-Message-State: AOJu0Yx64Fw69PrmfXByIsIA4iMrsy2uHwJF5+9qULAZENyQ4TGP24Bk VOPTEVjwNAeZ+QXlUbAca9zHwKS3f3XgVAZUQguudvZiM6UZ/cNXdpaqZyTFI3A= X-Gm-Gg: ASbGnctJcCzwZCeBzGTEMwH19/o44uJoA/d1474XGtH9rbG+UH9cdTm8Awo2FCAQ+Os 3BNdJlAR0m5IIg8Dd32ZlE/O4k0ztXlgiOC7JbhAjoaw1tdOulQcFk8iILfI3N+EljOwueNwJfC fH6+YF4+C9Dc35ILJm9hw+dZ9Gie7GJkDIu4NSmz8VKaUZdDEMKQUYhPb+qMFncMlVCSVThTZFW F7m+3l7R32ddEe5ZszbY3ANCzFH9BJ7mx7Fw9cI6/zoLuMvC1vgP8wQFKE3i8HD0ApEZt0= X-Google-Smtp-Source: AGHT+IF+fI+rBDjJrU+kXFKlTf8czZ3q3nJgnXFs4n0YVqpgD8vtKzBieMa6idDq1qW4Q72VL2TB+g== X-Received: by 2002:a05:600c:4ed0:b0:434:a929:42bb with SMTP id 5b1f17b1804b1-434d3fae263mr79609215e9.18.1733410882347; Thu, 05 Dec 2024 07:01:22 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434d52c0bc7sm62830795e9.35.2024.12.05.07.01.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Dec 2024 07:01:21 -0800 (PST) From: Neil Armstrong Date: Thu, 05 Dec 2024 16:01:09 +0100 Subject: [PATCH v4 5/7] drm/msm: adreno: enable GMU bandwidth for A740 and A750 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241205-topic-sm8x50-gpu-bw-vote-v4-5-9650d15dd435@linaro.org> References: <20241205-topic-sm8x50-gpu-bw-vote-v4-0-9650d15dd435@linaro.org> In-Reply-To: <20241205-topic-sm8x50-gpu-bw-vote-v4-0-9650d15dd435@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=1797; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=xjNH0ZqzPNeRyAGL1QAVeh9hZcwP2oOm7fBqheYEiRE=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBnUcA5gbDK8obKvAzOZxReVLFxhmvbSIw3RBNwoTYb eBXV/3aJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZ1HAOQAKCRB33NvayMhJ0eGJD/ 0Ynhh+/HQyy6sZPO3LnIuwJeGY8Y9+4S/9eTmNUJg8YyWb1a7x2k+zPRMNePAZ+vh7K3ZMgpUCv466 phicYP82gtIjbUWAExMW6zvz8s4p2I8B9+Kz/HKP7yNmLRcvuv+RIPvQv0R7uG0bE8+iJzqTwJmZi+ ihWfnRAWR14OlgLlIGBsdl6gm1yugEwVciJb/07uqykcCjWyC9Yz1m9S9D6F4QbTBoV9bhftD+Jlth PfMixhetpukrzlqJHJEo7HncfbRBErWSM5sE4ZbXsHwJ4BK1rXWvcv0sOJGcU5OB6cNywp07XQqiX+ R3x+PIPZ8iHwM2VJ+u/4PjsXI0hO2ghoCId5VX99LkiPjsfHbjNw9p6toXfcbW8PwA+hjjE8rxtr8G pWlqAD/5pVobtJ12Wg1htaG8w9iN/ooTpKPnGuodATyDRsj4mOIvd5ku+ixCqpmY3hTLG4+Ca4Vh5B JvYQVXl/nlDZLraEQ5SJVg4JJv7uICi2XLJTgxDe6PGfpawpOWC8JWSq8UsTuL7BErY/ZYzzFqDGtf 7Q8n3hQnvcTBuK8AjzaiaNO+IC/YodtKY5NczOnSpZb7V6V8lzcexDZJfDp/2nv4rFERjNFdvbwnDb B6cuycE0gxG5Cjltc2Sjljy7eaQATxwtbzJia0u9Ywx3tfSqdHl9q3kWPolg== 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. Reviewed-by: Dmitry Baryshkov Signed-off-by: Neil Armstrong Reviewed-by: Akhil P Oommen --- 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/ms= m/adreno/a6xx_catalog.c index 0c560e84ad5a53bb4e8a49ba4e153ce9cf33f7ae..edffb7737a97b268bb2986d5579= 69e651988a344 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[] =3D { .pwrup_reglist =3D &a7xx_pwrup_reglist, .gmu_chipid =3D 0x7020100, .gmu_cgc_mode =3D 0x00020202, + .bcms =3D (const struct a6xx_bcm[]) { + { .name =3D "SH0", .buswidth =3D 16 }, + { .name =3D "MC0", .buswidth =3D 4 }, + { + .name =3D "ACV", + .fixed =3D true, + .perfmode =3D BIT(3), + .perfmode_bw =3D 16500000, + }, + { /* sentinel */ }, + }, }, .address_space_size =3D SZ_16G, .preempt_record_size =3D 4192 * SZ_1K, @@ -1432,6 +1443,17 @@ static const struct adreno_info a7xx_gpus[] =3D { .pwrup_reglist =3D &a7xx_pwrup_reglist, .gmu_chipid =3D 0x7090100, .gmu_cgc_mode =3D 0x00020202, + .bcms =3D (const struct a6xx_bcm[]) { + { .name =3D "SH0", .buswidth =3D 16 }, + { .name =3D "MC0", .buswidth =3D 4 }, + { + .name =3D "ACV", + .fixed =3D true, + .perfmode =3D BIT(2), + .perfmode_bw =3D 10687500, + }, + { /* sentinel */ }, + }, }, .address_space_size =3D SZ_16G, .preempt_record_size =3D 3572 * SZ_1K, --=20 2.34.1 From nobody Thu Dec 18 08:13:36 2025 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 0E8A4222561 for ; Thu, 5 Dec 2024 15:01:28 +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=1733410890; cv=none; b=ILtOrG8KvBFooGaooLDMf+qwoo4xQGsJ8rt0JnZHGudT23Q/i0UFCEgJoPFivb+oGRTEk67WTRn5I2pen3v2mmDwk8GQk5j4L3QXynt6/bzgXOvrOKKpW41o1mLyRbZljwUUKZqFmmPZj21XH6pWkBsrnF8cVGe1J4sh59KWCWw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733410890; c=relaxed/simple; bh=RYPtTEAzI0OGTqfRzA/UycF6LcmmOXWAmTfNgMLYnHE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=s5Axf/QRQyHs74c06RQiU6ArxQeE9wcbBP8u8RIqXGyu/8qYfSTaocwhdppMOwZjwfvkcEbGC/77D+Tuamkopgh/MxIq4DgZ1ZyjXPVZq0tRDVsf3UNqTVdrhug0elWAHfGjPtbQ6gTUGEUNWS2QjFLuPIRhvYiS3nkQypH2IHQ= 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=xkhiXAK1; 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="xkhiXAK1" Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-385e87b25f0so1323310f8f.0 for ; Thu, 05 Dec 2024 07:01:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733410887; x=1734015687; 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=PE4EC9PLskFvJMahyM4wT4IIkBhlmTglPbxea814APc=; b=xkhiXAK1WvzQH3u9JwAH/DVlUkeYpok5VBjiqWQoJ4CcePIxwRMsDQjeVKhZpDZ2Bu nCSNv+J6XWxmhWHhQ52Lw3AifJu03Wjv1eGYB1AOqhCTvFuqIWzPlb/rqFD6v4D0FnED ly+BnPjXPKKcsxf++pk4Gm2zz5v7Q4CrjYot6XuZpa6tGjcQ/XBc/2teUHYI1Lu8regZ pu8LpBBpZICC8FVcT7boO8xUuW844kMjB6s7+wpgBJSCjqRybR+UljAfMQDgJzITq/9u eCajE2zqO1zydK8ynY25hsrzwuFsNAGcKVCTinE9Dv7fa8ClmgLC8yZF02RLFgL40O5Q Ekag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733410887; x=1734015687; 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=PE4EC9PLskFvJMahyM4wT4IIkBhlmTglPbxea814APc=; b=i43MDashI2vUphsMigZ+0vfQzcU3DLVLPyc9twInfbCtIAFZRAF5VaSXQSK67TMmJF fmo0FeyU3SD5rxn8Avq5rKD2kzTMAAdPaJXGZeHMGT8EoAEcRgyX+WAJOMxhXCsu09FO l7hITgyqXMygsomcGqa/TOucmWqsmJNAHb2yaXBhWNptgDKbKspBbIYMfj7EjxFy39QG QLmm853G6c+p91A7/veVm3Sx5ZFRtI+EQ4GiJdswSzQmHYcMlz89bfRx76w5VqqEHoVf WHXbx/INI1Mkox8IxMQ7DIVHvBqB6mNJKgSBJs803bcZx0bAgcfrbcSXmQRbFIWw5SD/ HEyg== X-Forwarded-Encrypted: i=1; AJvYcCUTk5sBQUDIuVnHsz1v87OjulxaZjRPBEMXWzp91OuQFBy6z3lZ1SUtvMch5HjZbFYxl6mipAteqOlDIqg=@vger.kernel.org X-Gm-Message-State: AOJu0Yw1w8vHrkHHC+1DC1reOuXj7ee8WUI975T7vFBEaYvE2aSFA7Oj 9MkhsD7kIf0z70TAVK/te9rh7voKmGaQ/z6GT7MCrZvkG91SQ6xJt/IV84sFsoM= X-Gm-Gg: ASbGnctzpNXhk2vy6qwFIoWULEPGtAM6DGYdbJGYTTpJxk2L99cR2FT82xnpTEzR3V9 XlWxZgABDr4WwGGFuTEahc1+KeaFYEJv5hG164IpMOVsJM6cmNv0gMwTfza1SL/FodMrxClMv+e nkqmhuOIgZJqwlUd7u1qQm6h5JJW8h8MFwWzRs9yCOtq/dA9xX3M88bExG+mN+QGx7yTMOrcRCT 6Pb+L4GxD+YTs20DBTd0kNwLdt3xnwzW2Cg1YnJtc/ZcBmlekZeWXLzhpwbyPaE4YV2P7I= X-Google-Smtp-Source: AGHT+IG1XEFDu3IE/3HqjxQTBBrt8eu9bg3PesPAyjLcHPehuhNcC0WrhOXXAhfrJuVWwx7+BGIjaQ== X-Received: by 2002:a05:6000:188f:b0:385:e986:416f with SMTP id ffacd0b85a97d-3861bb5c367mr2698569f8f.10.1733410883551; Thu, 05 Dec 2024 07:01:23 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434d52c0bc7sm62830795e9.35.2024.12.05.07.01.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Dec 2024 07:01:22 -0800 (PST) From: Neil Armstrong Date: Thu, 05 Dec 2024 16:01:10 +0100 Subject: [PATCH v4 6/7] arm64: qcom: dts: sm8550: add interconnect and opp-peak-kBps for GPU Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241205-topic-sm8x50-gpu-bw-vote-v4-6-9650d15dd435@linaro.org> References: <20241205-topic-sm8x50-gpu-bw-vote-v4-0-9650d15dd435@linaro.org> In-Reply-To: <20241205-topic-sm8x50-gpu-bw-vote-v4-0-9650d15dd435@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=2561; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=RYPtTEAzI0OGTqfRzA/UycF6LcmmOXWAmTfNgMLYnHE=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBnUcA5HvZp2PHgJlyryi+bTlFLh+XAS6Z7umgDCPSr Bhe+qHaJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZ1HAOQAKCRB33NvayMhJ0cEQD/ wODdnXV1Ywe5zB0yYtWBWkIJkMscv50bJFauXBQDQKrsMlnPjejHnvtOexsT3FTdUsR5N8k71mCRN9 9pvwbmwekcJEjoL0ovrpHX3rehOU6jX2g7ZhnrCD6GdBG0FwIwOclO0aqKC4d3tmYX57jjNiUsKW8T D4MWl64KScJDqO06jfZnRQpX0EVPONidZlTW7rHieBzdy9hmVLZ2VluH+FZ8u2kzzP7jeccdTKNjFc q6x7uLkv238qH4vSW5Ro4n/TJYVl4K0UOVK7TdhZhJ4HV88DKaAVpi7TSMmDjctxho03QbMFdHssnU 6ucz3F1UBqMhBPfTTvzJli0Gbwp+RkU7pN4RBlKYDVCZs0BgBK1+ikourUJ5u4SiWxkgBYZ9VOBaqY d7+fRs07Zqi/EyRgDj4wIFj3h2UuUAWULqBqo1N0W5W8KO12D5tpD5Jgmi0/QevxVXxmm+5dlSu89A nx+o/PAXzLZb9jxI5aRMntBpSsJ17umoBlY8dtst9Z5YK+MLCL6qRRgBCfGyfHLyjt9YrrYR7JujMk n753RCyZ/lYtv+ubjyo0cqP84rNhuIQtOyyvIwixKTKuQuuOsKcb6BfG/8gUyS4AWaryiQzh0JSsWJ F/mMj5GEreNQ4LWT0+gF/xPUyuXMM7MwyP74tm07Jn9XZBDXc9QNmGWet+6w== 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 Reviewed-by: Akhil P Oommen --- arch/arm64/boot/dts/qcom/sm8550.dtsi | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sm8550.dtsi b/arch/arm64/boot/dts/qco= m/sm8550.dtsi index e7774d32fb6d2288748ecec00bf525b2b3c40fbb..955f58b2cb4e4ca3fd33f1555e3= 6a15cfc82d642 100644 --- a/arch/arm64/boot/dts/qcom/sm8550.dtsi +++ b/arch/arm64/boot/dts/qcom/sm8550.dtsi @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -2114,6 +2115,10 @@ gpu: gpu@3d00000 { qcom,gmu =3D <&gmu>; #cooling-cells =3D <2>; =20 + interconnects =3D <&gem_noc MASTER_GFX3D QCOM_ICC_TAG_ALWAYS + &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>; + interconnect-names =3D "gfx-mem"; + status =3D "disabled"; =20 zap-shader { @@ -2127,41 +2132,49 @@ gpu_opp_table: opp-table { opp-680000000 { opp-hz =3D /bits/ 64 <680000000>; opp-level =3D ; + opp-peak-kBps =3D <16500000>; }; =20 opp-615000000 { opp-hz =3D /bits/ 64 <615000000>; opp-level =3D ; + opp-peak-kBps =3D <16500000>; }; =20 opp-550000000 { opp-hz =3D /bits/ 64 <550000000>; opp-level =3D ; + opp-peak-kBps =3D <12449218>; }; =20 opp-475000000 { opp-hz =3D /bits/ 64 <475000000>; opp-level =3D ; + opp-peak-kBps =3D <8171875>; }; =20 opp-401000000 { opp-hz =3D /bits/ 64 <401000000>; opp-level =3D ; + opp-peak-kBps =3D <6671875>; }; =20 opp-348000000 { opp-hz =3D /bits/ 64 <348000000>; opp-level =3D ; + opp-peak-kBps =3D <6074218>; }; =20 opp-295000000 { opp-hz =3D /bits/ 64 <295000000>; opp-level =3D ; + opp-peak-kBps =3D <6074218>; }; =20 opp-220000000 { opp-hz =3D /bits/ 64 <220000000>; opp-level =3D ; + opp-peak-kBps =3D <6074218>; }; }; }; --=20 2.34.1 From nobody Thu Dec 18 08:13:36 2025 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (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 DBF9222147C for ; Thu, 5 Dec 2024 15:01:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733410890; cv=none; b=HI3ExQmuvaqQEMzBdJveAwc3spChuiAcG3/P7XfAP+ax/uAduL05FwBX7xRagNvtgI23d1JrgjKSb7wqnn37mIikAs270NEtdURPIgz0gH+9Q6/cOUuF1QlR3iUHaTB03LOUcf/Tkcfb/TTJgHgU2hL5Hc1y5b/EMu/dvkfxeCk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733410890; c=relaxed/simple; bh=IgxztTAMWyT29UYzJNKnw7bdbAV70geqeOh7ctUQCIM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=a5F7SYTf9rOwm/yug9tzeoxRyKIkDAe4QJm2k/7+YtNGaS0psUGQ+pCYg6krPrA6WUNBaTRssv6X/OCsMi2r/dbPkCE8E3etJ2mVJTkXSmjEznYoPVqhfRSdHWQmhgpbY+GqdkwHSSLozrfHU+qDW7ga5DgYqIsl3g4jdu0938Q= 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=XPnDUiNU; arc=none smtp.client-ip=209.85.128.42 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="XPnDUiNU" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-434ab938e37so7162415e9.0 for ; Thu, 05 Dec 2024 07:01:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733410887; x=1734015687; 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=TPWex3NjhW2vBY02766onHCegT7hgDE9dyhsg/tMa2g=; b=XPnDUiNUcFP3Cb5p1EoI2tajowtOurA/BvaRvtw6Pl7CQQk9RPpnMO+QylLBXeL1Xa aj45Ecy9EF37i0Z9rawuPdh5YKXNwUhiGbxJDgPpbmQjth3kaRvQDCx1gix6wJ4sOO14 WaRdWD0XRLcLa/ApRbAxCrlnb8R8UpoAgTjpLBP65PMMWkgaoKhtNyIo8hDN3P0K9DHZ nXy2cjqW8mjo/zMaWFSzhS9HOXIFHKn/hd5OZTSSz4TSDIwZQb7FwJzzuPLB9wt99dpX TdddNUI714L37X42wmXAKJTfb94RKbyonL3cMbz1YnLfZudWYdhWrhofLj4y2zgKbRdq RBdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733410887; x=1734015687; 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=TPWex3NjhW2vBY02766onHCegT7hgDE9dyhsg/tMa2g=; b=f8yMLHwyZSqtdrYtU0P/utcRs3X59fCFGPMf6C8b5x4xWLjcmy1nOZhlLks+eP4grc BCumzHRK9o6Xwu8eyoTOaRsn570/AVKAK9cc8HC2Vlew400TEheejurUddqVZFqaxDda mJ4sBjt33SrK+JpT6l+uwxmKBXy3kJhV0ygzdthXyPYWphwZPBmb+fOUf7zrVswppCiY TIVnOiyvcxwIU2phDUY398zPuUj0rDHXvCKlV3QIY+OVUNWRZak7b7qZeGC9mB6pzwCJ aPT281UR6aJypObn2fcPMfjb3CaUElahuG7EL5P23YRBPLqhzFFQKQ+ZwF45GXU5luRz 1H8w== X-Forwarded-Encrypted: i=1; AJvYcCVkMxHaBqWjbg7+nOszG+vch7d6+jECUJ/8GecG8+mg7C0eKq1mDtnIg4gaOdfv5BAgCfNrKpWXIV1MbeQ=@vger.kernel.org X-Gm-Message-State: AOJu0YyGFKeOFVVm1oDoUuiotM6wNyMUORpTAs+J2wfzEF1PJCCRc65m PPEBBJ6Q+53cZnS+QxOg7HxcFbBLEHomICwJyPxPteIn9OiUA/RrDqoYth2q8Eg= X-Gm-Gg: ASbGncsHLED7C1VHq9Z8zaQh7sHgdbwd6ofoQvYrdBJNgm2yHAoYSuaqoDJi1QYx5AD LIsEHQoy7HnYNX1S0tmQXJ060LjmpjyGBD5kokQEAwNOws9DczWFnF9gp2D4Xdt54Vp6c9q7XMd UnkZvRIG8hfvHFhpfQD8C50RQADqi22vVw9HFtVTbudJgo3qOqy3ycyHx/zKQ+WRUAtMp/YxtBw RaP2T0ZLz9vxgYrQn5HJVKDHMd6cZ9Te3H8uqY/dB89CVs8slnGiN4AQXFzFlfWH9dAsQQ= X-Google-Smtp-Source: AGHT+IGKNF8m6/P0t+uOND8u3TqccJB3NWyZR7DF6laJJjSGk7SxVgGuFUCe2VWQPy6USrZuONmIlA== X-Received: by 2002:a05:600c:4ed0:b0:434:a929:42bb with SMTP id 5b1f17b1804b1-434d3fae263mr79611665e9.18.1733410884709; Thu, 05 Dec 2024 07:01:24 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:8261:5fff:fe11:bdda]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434d52c0bc7sm62830795e9.35.2024.12.05.07.01.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Dec 2024 07:01:24 -0800 (PST) From: Neil Armstrong Date: Thu, 05 Dec 2024 16:01:11 +0100 Subject: [PATCH v4 7/7] arm64: qcom: dts: sm8650: add interconnect and opp-peak-kBps for GPU Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241205-topic-sm8x50-gpu-bw-vote-v4-7-9650d15dd435@linaro.org> References: <20241205-topic-sm8x50-gpu-bw-vote-v4-0-9650d15dd435@linaro.org> In-Reply-To: <20241205-topic-sm8x50-gpu-bw-vote-v4-0-9650d15dd435@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=2682; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=IgxztTAMWyT29UYzJNKnw7bdbAV70geqeOh7ctUQCIM=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBnUcA6jBwt5/lJeHAuMw2p6QcJ8KfjQQOOW4fyFl/Y WsBO3zGJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZ1HAOgAKCRB33NvayMhJ0e20EA CdtdyWN37WortzYjsbLjT6L16akMfEu8GAtTyJt4D8BSQ1G0yVf0YbZhZbO+cIksZi9QkgfPsR+9eh 73pd5WF+1wx6Navr5WyAm9I6yO0Cc3M2iVEM/nb00z6p4o5rr+N04AxVyhOnJOTFdzM92wvC9LXySn BBDc18x3Ka+L08ygo/P8c2Yvh4Qurr8lM4OHbwarxYl3+ZqQNC/gyt66qvTy5rohJS7Wb24yKlbl3H Q+8gGmjsohJoT+5Ny3E+EhZkNSWrpL2+pKOHRKpJ37jmPLfR/OM6WsinrPcMWy1WXpz/4oZTEuyjEc mxlspjJITpZQ3bwevUkmSBG2kKzVtTaF6S/xhzKM52T37aaXeuN/yh0vi8h6THpVuvt9d2NUSLT09x xgB/R7HAAD+WBpsTpCj3bVacxYuTWT9JPh0GDTGdrNCnz5rLe6Qag20/ahOEeQ0wIiuXLSdcgkxmgQ xBQnPUBtULm+hS0Q7V+1UFBjHBJY/iKUdT+j1W0Ma5L5tRp8cltsVqp8IsJSVioA5KVQTBw/4DD1+z YK9wGfi3YcITvaWCzrlEIbL2ozgfSzYF14ukaytf/4LszqCyo9PJNQJqTlTCoiW8WIOpw1aM3N2kPH 8Gr/0CneZdDb+EXtaKOZ6Ak0uIhyt54sP9j6tp+zFeCgRGGelx4hp7g2tV9Q== 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 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sm8650.dtsi b/arch/arm64/boot/dts/qco= m/sm8650.dtsi index 25e47505adcb790d09f1d2726386438487255824..6ee7f362dedb73bcee6e8b2a7da= 6b71840de9001 100644 --- a/arch/arm64/boot/dts/qcom/sm8650.dtsi +++ b/arch/arm64/boot/dts/qcom/sm8650.dtsi @@ -2636,6 +2636,10 @@ gpu: gpu@3d00000 { qcom,gmu =3D <&gmu>; #cooling-cells =3D <2>; =20 + interconnects =3D <&gem_noc MASTER_GFX3D QCOM_ICC_TAG_ALWAYS + &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>; + interconnect-names =3D "gfx-mem"; + status =3D "disabled"; =20 zap-shader { @@ -2649,56 +2653,67 @@ gpu_opp_table: opp-table { opp-231000000 { opp-hz =3D /bits/ 64 <231000000>; opp-level =3D ; + opp-peak-kBps =3D <2136718>; }; =20 opp-310000000 { opp-hz =3D /bits/ 64 <310000000>; opp-level =3D ; + opp-peak-kBps =3D <6074218>; }; =20 opp-366000000 { opp-hz =3D /bits/ 64 <366000000>; opp-level =3D ; + opp-peak-kBps =3D <6074218>; }; =20 opp-422000000 { opp-hz =3D /bits/ 64 <422000000>; opp-level =3D ; + opp-peak-kBps =3D <8171875>; }; =20 opp-500000000 { opp-hz =3D /bits/ 64 <500000000>; opp-level =3D ; + opp-peak-kBps =3D <8171875>; }; =20 opp-578000000 { opp-hz =3D /bits/ 64 <578000000>; opp-level =3D ; + opp-peak-kBps =3D <12449218>; }; =20 opp-629000000 { opp-hz =3D /bits/ 64 <629000000>; opp-level =3D ; + opp-peak-kBps =3D <12449218>; }; =20 opp-680000000 { opp-hz =3D /bits/ 64 <680000000>; opp-level =3D ; + opp-peak-kBps =3D <16500000>; }; =20 opp-720000000 { opp-hz =3D /bits/ 64 <720000000>; opp-level =3D ; + opp-peak-kBps =3D <16500000>; }; =20 opp-770000000 { opp-hz =3D /bits/ 64 <770000000>; opp-level =3D ; + opp-peak-kBps =3D <16500000>; }; =20 opp-834000000 { opp-hz =3D /bits/ 64 <834000000>; opp-level =3D ; + opp-peak-kBps =3D <16500000>; }; }; }; --=20 2.34.1