From nobody Sat Nov 23 08:31:54 2024 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 F263E1D26EE for ; Tue, 19 Nov 2024 17:56:47 +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=1732039010; cv=none; b=kwvLtG44g6vNLBFnWO8H9cli3Plmi9/E+tWKnG14U5s4reDwcRoUWg4t/4kW+X/OyUR7I7/LVLtWrlmEsQnLjwdYiwm5MlQA9BkHn0hN2kIzZqamelgWkEPaogQWFju+P5zYSAWf2GjNn2PzAbODvplcgK4JpvC7ZDxe/ApJ7Qc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732039010; c=relaxed/simple; bh=jYCp8TR7dzoclrZB3zyNwAn2VlLPZL58y51ut7TpNS0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oz/uA0Moj5mtkzdS85g2zfunUVSv15PClBT7M8yA/iiyIKGdtkei/NFViEpo2bPGMe1llvMHNqODCP1y8KydxtDU2KqZryfyWyoFG3vK8evXsJPhzIEAC3Ylj2dQ8yfy/0uIBEtH6G4QO5lVcxv73iLIY/77t0BK0wGlUxDg3Zg= 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=OM0a6WbG; 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="OM0a6WbG" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-4314fa33a35so48608545e9.1 for ; Tue, 19 Nov 2024 09:56:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732039006; x=1732643806; 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=77Eoli2JKcfvmzeyZfmZcAC8ruXlT3sz4RV/g2sy6qg=; b=OM0a6WbGN4kRpvTMxCmFJtzlXzPxr4CWzs3RGOG6xaoq9KwxyxSYOf/L9GJEuzVCVQ TO9mXD4n0raQOsNIrc40+LmFP7eG9MPxUICMYAYUixfrzeod9THdZ1noKIiKPEmG8KCx 4uFF0IS+7lbYpPZqizWzQIsCfKz/ojKNRawUyRY7hART8wHErAFNOROWyCZCp1sHOGd7 CkhriO2sGSn6RYaDxMKu0q8N9b8iSqhqlr3ZQLUm6FDX3xexJgucFGXKrVMEuKhS9lxt OUeCHdodzZUdnLMsyngGm2ADRplwu0RTSRVpJv0Dqz29wXpyZ+456h3ScktJlnLla6eO B48A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732039006; x=1732643806; 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=77Eoli2JKcfvmzeyZfmZcAC8ruXlT3sz4RV/g2sy6qg=; b=IadJ8JGJF09vN0S8sNawZ1zhU+dVfPzT9IsiJhiedFDNwF4G0mYbmXAEevFjDN33k6 567sczOTgj2B5vhwsf4UPfks4QYv4OExn2H40d//mhmdfUwxh+3jMIgPNtb1fXb30Kmu MKMhTGW4Vzd1sXIdw1+BrJJEYqA+WmPoYH/MlPklZW8fHLYFARL1X1Msw93YiZkH6Ztx fHR+mvKE5MtDbmyfGC+yFNk3wn+G2Avi96mcsAvIf6xZl+sV6/D9/yO5aeAC7CQyVv6f eNWF//at3NBINPH9gkJoDFPIG67rdz9xZRYhSZuNW1NfvBKpTeIHt6kbQT18EC0xqSaI z83Q== X-Forwarded-Encrypted: i=1; AJvYcCUyK89MBO3hsJ8zvdkxl18q3m6wjZ0iq5v8XLQdqc4CBuV6626w8oRZmjArLRU5UBF0LSAJcDiRPngIFng=@vger.kernel.org X-Gm-Message-State: AOJu0YzIjMYNT9A6zz886TOuQCe7wp95lEKjJOQfuBwvBmtdbID+l+3v yttIzF5RhXwuzncnfuLqUAHrkKRQwvv4VD3FmFMe5U5b4VnlODtCb1nLLmUVbT5LVCzhSoHsKgP 5 X-Google-Smtp-Source: AGHT+IF+Lx7qgtgHAGXdWBZ2QyFola8SI6L7q/xdAwZBh6gOo8f5SFDq9dfDsh2MOCUWBja2J9sv1A== X-Received: by 2002:a05:600c:35c8:b0:430:57f2:bae2 with SMTP id 5b1f17b1804b1-432df791f62mr123906335e9.23.1732039006322; Tue, 19 Nov 2024 09:56:46 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-432da27fe68sm208302275e9.24.2024.11.19.09.56.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Nov 2024 09:56:45 -0800 (PST) From: Neil Armstrong Date: Tue, 19 Nov 2024 18:56:36 +0100 Subject: [PATCH v2 01/11] opp: core: implement dev_pm_opp_get_bw 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: <20241119-topic-sm8x50-gpu-bw-vote-v2-1-4deb87be2498@linaro.org> References: <20241119-topic-sm8x50-gpu-bw-vote-v2-0-4deb87be2498@linaro.org> In-Reply-To: <20241119-topic-sm8x50-gpu-bw-vote-v2-0-4deb87be2498@linaro.org> To: Akhil P Oommen , Viresh Kumar , Nishanth Menon , Stephen Boyd , "Rafael J. Wysocki" , Rob Clark , Sean Paul , Konrad Dybcio , Abhinav Kumar , Dmitry Baryshkov , Marijn Suijten , David Airlie , Simona Vetter , Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Connor Abbott , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2743; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=jYCp8TR7dzoclrZB3zyNwAn2VlLPZL58y51ut7TpNS0=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBnPNFXzHRfip66xeIvRHFGvMRVvKXc3AYGENiBWrVV 6SXuRnuJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZzzRVwAKCRB33NvayMhJ0btFEA CxS/Y3wNk1GVdwKy07e3iKyukBHX2qmyQj6NiA9v2ta5Cz/uPNSaS8Tc32gJESqqwJojuIQlF7k4No DynYwa/WDju9SFUVD1z2cMFL+FCvgSRWaqWCLqR7cGJMvMgyZlMv7zR9WYa7M5wJ/MNzYn91nUDvCa 3//OfR6I3DwpaHFLewgE8rLC9ZB3RLsi4RzMKGsK+IKXcvsbmbPJf+HjgFYMSAc8PW/I2tvWQ/InSy gFFZjfXuvRuLrZWHqT1Gi4rRicne6TRCYpLh4p+BFUxe5KnEGDZg8o3ceWMxwKor4TSaVQQTKsnNWt W/GPR6N7GgzTLxQO6epXobNAUv02VeDNUs66KIY7rUF4qy3sMI6G+aTf9vE0w/g8Fd3u1YaOE3N8o1 nxMzXagpNBdnf9rI110qFeirQMY6ZIp57HyQbmKVK1Vk0R0VM46MLCJdfp5t7I0/NU7NG4If6uYuqK PLKl+kOpOLIq8yaTA/vpvfP5uV0q/3HYIBx/QJAHJIYUtp3PMoCTj+VYqhHaQ6bGrK9iaqwNAorqeO 8VefKlo8kKdPgB6/7ip8k2Y625U0EHqOAdluF4+kCxGD+T0qLHefkoqkSSmaHYSoVHzL7H6hVZZPzq wMkQtSkoWZmSqTLDUZZWPPkznILvnx0n/3S8aVEASCP32GztYdODY1Npp8GQ== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE Add and implement the dev_pm_opp_get_bw() to retrieve the OPP's bandwidth in the same way as the dev_pm_opp_get_voltage() helper. Retrieving bandwidth is required in the case of the Adreno GPU where the GPU Management Unit can handle the Bandwidth scaling. The helper can get the peak or average bandwidth for any of the interconnect path. Signed-off-by: Neil Armstrong --- drivers/opp/core.c | 25 +++++++++++++++++++++++++ include/linux/pm_opp.h | 7 +++++++ 2 files changed, 32 insertions(+) diff --git a/drivers/opp/core.c b/drivers/opp/core.c index 494f8860220d97fc690ebab5ed3b7f5f04f22d73..864b9b99b0129acaffaf45c584c= 5f34b8bababed 100644 --- a/drivers/opp/core.c +++ b/drivers/opp/core.c @@ -106,6 +106,31 @@ static bool assert_single_clk(struct opp_table *opp_ta= ble) return !WARN_ON(opp_table->clk_count > 1); } =20 +/** + * dev_pm_opp_get_bw() - Gets the bandwidth corresponding to an opp + * @opp: opp for which voltage has to be returned for + * @peak: select peak or average bandwidth + * @index: bandwidth index + * + * Return: bandwidth in kBps, else return 0 + */ +unsigned long dev_pm_opp_get_bw(struct dev_pm_opp *opp, bool peak, int ind= ex) +{ + if (IS_ERR_OR_NULL(opp)) { + pr_err("%s: Invalid parameters\n", __func__); + return 0; + } + + if (index > opp->opp_table->path_count) + return 0; + + if (!opp->bandwidth) + return 0; + + return peak ? opp->bandwidth[index].peak : opp->bandwidth[index].avg; +} +EXPORT_SYMBOL_GPL(dev_pm_opp_get_bw); + /** * dev_pm_opp_get_voltage() - Gets the voltage corresponding to an opp * @opp: opp for which voltage has to be returned for diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h index 6424692c30b71fca471a1b7d63e018605dd9324b..cd9a257b8e7766d6c8631351a10= a845c88414a74 100644 --- a/include/linux/pm_opp.h +++ b/include/linux/pm_opp.h @@ -106,6 +106,8 @@ struct dev_pm_opp_data { struct opp_table *dev_pm_opp_get_opp_table(struct device *dev); void dev_pm_opp_put_opp_table(struct opp_table *opp_table); =20 +unsigned long dev_pm_opp_get_bw(struct dev_pm_opp *opp, bool peak, int ind= ex); + unsigned long dev_pm_opp_get_voltage(struct dev_pm_opp *opp); =20 int dev_pm_opp_get_supplies(struct dev_pm_opp *opp, struct dev_pm_opp_supp= ly *supplies); @@ -209,6 +211,11 @@ static inline struct opp_table *dev_pm_opp_get_opp_tab= le_indexed(struct device * =20 static inline void dev_pm_opp_put_opp_table(struct opp_table *opp_table) {} =20 +static inline unsigned long dev_pm_opp_get_bw(struct dev_pm_opp *opp, bool= peak, int index) +{ + return 0; +} + static inline unsigned long dev_pm_opp_get_voltage(struct dev_pm_opp *opp) { return 0; --=20 2.34.1 From nobody Sat Nov 23 08:31:54 2024 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 179411D27A6 for ; Tue, 19 Nov 2024 17:56:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732039013; cv=none; b=d35v4TxFjbohIqjkiwMEHy0BIfYqyeS8xwfSgU/xUjxF84iaYdMu5Dxuv3xZuC7azRV6OO/ctmeaScKlIkazHRoorfcYkFD2B/LAo9MhbOo+cTz6RYyS40Lpdi/n4uLOYg/ZC2oLmqljAsGSoOFBkcWrRnQ9fjNLN+QLJ4SD4vU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732039013; c=relaxed/simple; bh=I07ngYL9Ra1f9h+CP4yA7pd1FaT3h7r+nDReMCfjPD8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hkX50qBa4stYl5jc3RMsWCYebvHanEcTH1RCWktqglnwvpKM63VITioDH0mGGb/wHt8OLejaQy+lnYwh7Yc5GFJTRaTwnV9OkodJB5FM5CH6d+H5zJeR7ozM+7qi/xGLWL1u157jPBombgrtSGpR4qSwRtQZ1mca/3XhMDGIVCM= 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=ymCHFW/e; arc=none smtp.client-ip=209.85.128.51 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="ymCHFW/e" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-432d866f70fso11157295e9.2 for ; Tue, 19 Nov 2024 09:56:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732039007; x=1732643807; 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=TvcxrBjE8Ya+6nKD+reAX7BzLkcovY8zpP7D9Dufu8s=; b=ymCHFW/eUQ/j4J3sSdlSNgQFTOBfGjA0GUAV+0GMKKnnCLi8mEIRYJUB5+pY/4S9Kw pr/xESl459hb3VSFRQDgbENrGwfnXp3rzRk3J65cfH3qS07hPjZt7RkKkuPxorgyWuJG n5dMldqdLyWtyi6y0o6TSqo0uEM4mFZcHyn2zKImnCqMIwjt53DS5iuAH9aRobB57E7O AZeVjem+3ZFlD7iHXfVxurvbNTOxej0tMW7m4M1TepPocXvmS3BAObELNkrKe2IsK5zb bdOQAvYTGdnzsnxxV9pY8ftZqsY005FjXPdRgXZJYWhw/3jAj92YeeGgGdlCOzRVGYh7 jAIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732039007; x=1732643807; 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=TvcxrBjE8Ya+6nKD+reAX7BzLkcovY8zpP7D9Dufu8s=; b=fout8gLbfvXtCYib+xcVS49xSVxUfjJQ+7aj0L9D5B6xYhsS2Qg8p9kNUEfJpEIl79 bRVT12TLOQkqatnVIDGbrKmxGZB8R2sWyZ4AGtIz6/CsntNaQQEz18ax3XUJidf9qq84 Afjs/zLDs2Kw4ceXgSFsuEL/TaCDENIpXMfUNx0G+bJw47ZsIyoYWBm8q+UASqABSkk1 a+OS763dIVbuo2crBZQxi91fi18MUm0v13PTZstVUv013SN3sphZgdNvvgulwzv0hcp8 V0M01G6VC+sxh4TAxU9/xzHzV+nFeBilGKG1YBmDlpc6Xaiyrz0IhFJPOtTfeSeLEJvd qA6g== X-Forwarded-Encrypted: i=1; AJvYcCXzWFppXLJz+ZAzARgQl6sXI5k6aJ49H9Kj8bboA3n//qq/FdTpICRe4/YXh6gZ0TQr9cxDvgBPNPobbwI=@vger.kernel.org X-Gm-Message-State: AOJu0YxNGhwGJhctiT9VZAZSwShcNIms1x4t04C3oDxF4PbOMr6VU0bc 6oGbRQQK93lu+XukuVHzUofnNb67SjJ9D6ZZfAg3ObRZyD4ShPvmBy/JTbsvu0w= X-Google-Smtp-Source: AGHT+IGJ6SMbLsuvIbUQvyMjL/mTN4J7c8RlBSzGTWfBeFIThfOc4xtQI8YH+x4EjBiCjt9kcGEbSg== X-Received: by 2002:a05:600c:3508:b0:42c:b750:1a1e with SMTP id 5b1f17b1804b1-432df67959dmr153185785e9.0.1732039007389; Tue, 19 Nov 2024 09:56:47 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-432da27fe68sm208302275e9.24.2024.11.19.09.56.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Nov 2024 09:56:47 -0800 (PST) From: Neil Armstrong Date: Tue, 19 Nov 2024 18:56:37 +0100 Subject: [PATCH v2 02/11] drm/msm: adreno: rename quirks that are features 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: <20241119-topic-sm8x50-gpu-bw-vote-v2-2-4deb87be2498@linaro.org> References: <20241119-topic-sm8x50-gpu-bw-vote-v2-0-4deb87be2498@linaro.org> In-Reply-To: <20241119-topic-sm8x50-gpu-bw-vote-v2-0-4deb87be2498@linaro.org> To: Akhil P Oommen , Viresh Kumar , Nishanth Menon , Stephen Boyd , "Rafael J. Wysocki" , Rob Clark , Sean Paul , Konrad Dybcio , Abhinav Kumar , Dmitry Baryshkov , Marijn Suijten , David Airlie , Simona Vetter , Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Connor Abbott , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=10146; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=I07ngYL9Ra1f9h+CP4yA7pd1FaT3h7r+nDReMCfjPD8=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBnPNFXvsfG19CuOcSshzsLLrl9P5JiCVdB6NQYWhe+ leGk+k2JAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZzzRVwAKCRB33NvayMhJ0aqAD/ 9BdW9LZzIoIYl35jeVi9cqCgNGXipLp/slLxcES64BRqOg55WgP8C+mC9AQY0K2p40Vh9Km2z9+QXA FonK8lkCmQXlP8i+4UWolxNN5NeQ0TXbzWqovX6t3o26ubGTzeciItmtaR99LfzgRTNVp6EmpUUFME BYXQRayCUWbyjQfpS62gs+vxwc0AdTaBe18Eh/rfbowEmWxH25J9Btc/LrVIubMwDHtqAz+REGSKui bQG7Gv4+Z2w7m8v35UYqWAqJ7bTl8tFTKYZvo0tGCW7lKu1CZji0ZrIAyzTBhrsZljUUzRpCaAqxCA tSGA3yTLPI8U2MdzektRPFBSEfQU/TlTwSNdFhxdNTAacs1HCHpXnSXATf38I2HsT4OR8f9zynEg/n PZqJ67Lv+iOnZx3ESzZ6ublhomHwSM3zL/Nua3WhLwh7S8jABMdjsAJueh7DuQu1ngJPkiqvBZPDUk aVwH27cPcNRTGmDdMefC5vJGwmcI39uedMVCyJ2TeO3ZA7tENg1xvJgn2anAM5rCSzQx2gKlMNGpnI gFqPqxsD5SzgmFhy397X7jvBeEGSTxdQqGrxyQDGa+YfhDY0OwsvX3dvvGIf8zaLTPPvYf3RgV1NfY rKhaYudkqE+JEI+cQm8DQ5SvLjRBeJWr7QeNLTowDyOSKUUOpJLrSGER9tew== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE Half of the current "Quirks" are in fact features, so rename the defines with FEAT instead of QUIRK. They will be moved in a separate bitfield in a second time. No functional changes. Signed-off-by: Neil Armstrong --- drivers/gpu/drm/msm/adreno/a6xx_catalog.c | 62 +++++++++++++++-----------= ---- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 4 +- drivers/gpu/drm/msm/adreno/adreno_device.c | 2 +- drivers/gpu/drm/msm/adreno/adreno_gpu.h | 7 ++-- 4 files changed, 38 insertions(+), 37 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_catalog.c b/drivers/gpu/drm/ms= m/adreno/a6xx_catalog.c index 0c560e84ad5a53bb4e8a49ba4e153ce9cf33f7ae..825c820def315968d508973c8ae= 40c7c7b646569 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_catalog.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_catalog.c @@ -743,7 +743,7 @@ static const struct adreno_info a6xx_gpus[] =3D { }, .gmem =3D SZ_512K, .inactive_period =3D DRM_MSM_INACTIVE_PERIOD, - .quirks =3D ADRENO_QUIRK_HAS_CACHED_COHERENT, + .quirks =3D ADRENO_FEAT_HAS_CACHED_COHERENT, .init =3D a6xx_gpu_init, .zapfw =3D "a615_zap.mbn", .a6xx =3D &(const struct a6xx_info) { @@ -769,7 +769,7 @@ static const struct adreno_info a6xx_gpus[] =3D { }, .gmem =3D SZ_512K, .inactive_period =3D DRM_MSM_INACTIVE_PERIOD, - .quirks =3D ADRENO_QUIRK_HAS_CACHED_COHERENT, + .quirks =3D ADRENO_FEAT_HAS_CACHED_COHERENT, .init =3D a6xx_gpu_init, .a6xx =3D &(const struct a6xx_info) { .protect =3D &a630_protect, @@ -839,7 +839,7 @@ static const struct adreno_info a6xx_gpus[] =3D { }, .gmem =3D SZ_512K, .inactive_period =3D DRM_MSM_INACTIVE_PERIOD, - .quirks =3D ADRENO_QUIRK_HAS_CACHED_COHERENT, + .quirks =3D ADRENO_FEAT_HAS_CACHED_COHERENT, .init =3D a6xx_gpu_init, .zapfw =3D "a615_zap.mdt", .a6xx =3D &(const struct a6xx_info) { @@ -864,8 +864,8 @@ static const struct adreno_info a6xx_gpus[] =3D { }, .gmem =3D SZ_512K, .inactive_period =3D DRM_MSM_INACTIVE_PERIOD, - .quirks =3D ADRENO_QUIRK_HAS_CACHED_COHERENT | - ADRENO_QUIRK_HAS_HW_APRIV, + .quirks =3D ADRENO_FEAT_HAS_CACHED_COHERENT | + ADRENO_FEAT_HAS_HW_APRIV, .init =3D a6xx_gpu_init, .zapfw =3D "a620_zap.mbn", .a6xx =3D &(const struct a6xx_info) { @@ -892,7 +892,7 @@ static const struct adreno_info a6xx_gpus[] =3D { }, .gmem =3D SZ_1M, .inactive_period =3D DRM_MSM_INACTIVE_PERIOD, - .quirks =3D ADRENO_QUIRK_HAS_CACHED_COHERENT, + .quirks =3D ADRENO_FEAT_HAS_CACHED_COHERENT, .init =3D a6xx_gpu_init, .zapfw =3D "a630_zap.mdt", .a6xx =3D &(const struct a6xx_info) { @@ -911,7 +911,7 @@ static const struct adreno_info a6xx_gpus[] =3D { }, .gmem =3D SZ_1M, .inactive_period =3D DRM_MSM_INACTIVE_PERIOD, - .quirks =3D ADRENO_QUIRK_HAS_CACHED_COHERENT, + .quirks =3D ADRENO_FEAT_HAS_CACHED_COHERENT, .init =3D a6xx_gpu_init, .zapfw =3D "a640_zap.mdt", .a6xx =3D &(const struct a6xx_info) { @@ -934,8 +934,8 @@ static const struct adreno_info a6xx_gpus[] =3D { }, .gmem =3D SZ_1M + SZ_128K, .inactive_period =3D DRM_MSM_INACTIVE_PERIOD, - .quirks =3D ADRENO_QUIRK_HAS_CACHED_COHERENT | - ADRENO_QUIRK_HAS_HW_APRIV, + .quirks =3D ADRENO_FEAT_HAS_CACHED_COHERENT | + ADRENO_FEAT_HAS_HW_APRIV, .init =3D a6xx_gpu_init, .zapfw =3D "a650_zap.mdt", .a6xx =3D &(const struct a6xx_info) { @@ -961,8 +961,8 @@ static const struct adreno_info a6xx_gpus[] =3D { }, .gmem =3D SZ_1M + SZ_512K, .inactive_period =3D DRM_MSM_INACTIVE_PERIOD, - .quirks =3D ADRENO_QUIRK_HAS_CACHED_COHERENT | - ADRENO_QUIRK_HAS_HW_APRIV, + .quirks =3D ADRENO_FEAT_HAS_CACHED_COHERENT | + ADRENO_FEAT_HAS_HW_APRIV, .init =3D a6xx_gpu_init, .zapfw =3D "a660_zap.mdt", .a6xx =3D &(const struct a6xx_info) { @@ -981,8 +981,8 @@ static const struct adreno_info a6xx_gpus[] =3D { }, .gmem =3D SZ_1M + SZ_512K, .inactive_period =3D DRM_MSM_INACTIVE_PERIOD, - .quirks =3D ADRENO_QUIRK_HAS_CACHED_COHERENT | - ADRENO_QUIRK_HAS_HW_APRIV, + .quirks =3D ADRENO_FEAT_HAS_CACHED_COHERENT | + ADRENO_FEAT_HAS_HW_APRIV, .init =3D a6xx_gpu_init, .a6xx =3D &(const struct a6xx_info) { .hwcg =3D a690_hwcg, @@ -1000,8 +1000,8 @@ static const struct adreno_info a6xx_gpus[] =3D { }, .gmem =3D SZ_512K, .inactive_period =3D DRM_MSM_INACTIVE_PERIOD, - .quirks =3D ADRENO_QUIRK_HAS_CACHED_COHERENT | - ADRENO_QUIRK_HAS_HW_APRIV, + .quirks =3D ADRENO_FEAT_HAS_CACHED_COHERENT | + ADRENO_FEAT_HAS_HW_APRIV, .init =3D a6xx_gpu_init, .zapfw =3D "a660_zap.mbn", .a6xx =3D &(const struct a6xx_info) { @@ -1028,7 +1028,7 @@ static const struct adreno_info a6xx_gpus[] =3D { }, .gmem =3D SZ_2M, .inactive_period =3D DRM_MSM_INACTIVE_PERIOD, - .quirks =3D ADRENO_QUIRK_HAS_CACHED_COHERENT, + .quirks =3D ADRENO_FEAT_HAS_CACHED_COHERENT, .init =3D a6xx_gpu_init, .zapfw =3D "a640_zap.mdt", .a6xx =3D &(const struct a6xx_info) { @@ -1046,8 +1046,8 @@ static const struct adreno_info a6xx_gpus[] =3D { }, .gmem =3D SZ_4M, .inactive_period =3D DRM_MSM_INACTIVE_PERIOD, - .quirks =3D ADRENO_QUIRK_HAS_CACHED_COHERENT | - ADRENO_QUIRK_HAS_HW_APRIV, + .quirks =3D ADRENO_FEAT_HAS_CACHED_COHERENT | + ADRENO_FEAT_HAS_HW_APRIV, .init =3D a6xx_gpu_init, .zapfw =3D "a690_zap.mdt", .a6xx =3D &(const struct a6xx_info) { @@ -1331,7 +1331,7 @@ static const struct adreno_info a7xx_gpus[] =3D { }, .gmem =3D SZ_128K, .inactive_period =3D DRM_MSM_INACTIVE_PERIOD, - .quirks =3D ADRENO_QUIRK_HAS_HW_APRIV, + .quirks =3D ADRENO_FEAT_HAS_HW_APRIV, .init =3D a6xx_gpu_init, .zapfw =3D "a702_zap.mbn", .a6xx =3D &(const struct a6xx_info) { @@ -1355,9 +1355,9 @@ static const struct adreno_info a7xx_gpus[] =3D { }, .gmem =3D SZ_2M, .inactive_period =3D DRM_MSM_INACTIVE_PERIOD, - .quirks =3D ADRENO_QUIRK_HAS_CACHED_COHERENT | - ADRENO_QUIRK_HAS_HW_APRIV | - ADRENO_QUIRK_PREEMPTION, + .quirks =3D ADRENO_FEAT_HAS_CACHED_COHERENT | + ADRENO_FEAT_HAS_HW_APRIV | + ADRENO_FEAT_PREEMPTION, .init =3D a6xx_gpu_init, .zapfw =3D "a730_zap.mdt", .a6xx =3D &(const struct a6xx_info) { @@ -1377,9 +1377,9 @@ static const struct adreno_info a7xx_gpus[] =3D { }, .gmem =3D 3 * SZ_1M, .inactive_period =3D DRM_MSM_INACTIVE_PERIOD, - .quirks =3D ADRENO_QUIRK_HAS_CACHED_COHERENT | - ADRENO_QUIRK_HAS_HW_APRIV | - ADRENO_QUIRK_PREEMPTION, + .quirks =3D ADRENO_FEAT_HAS_CACHED_COHERENT | + ADRENO_FEAT_HAS_HW_APRIV | + ADRENO_FEAT_PREEMPTION, .init =3D a6xx_gpu_init, .zapfw =3D "a740_zap.mdt", .a6xx =3D &(const struct a6xx_info) { @@ -1400,9 +1400,9 @@ static const struct adreno_info a7xx_gpus[] =3D { }, .gmem =3D 3 * SZ_1M, .inactive_period =3D DRM_MSM_INACTIVE_PERIOD, - .quirks =3D ADRENO_QUIRK_HAS_CACHED_COHERENT | - ADRENO_QUIRK_HAS_HW_APRIV | - ADRENO_QUIRK_PREEMPTION, + .quirks =3D ADRENO_FEAT_HAS_CACHED_COHERENT | + ADRENO_FEAT_HAS_HW_APRIV | + ADRENO_FEAT_PREEMPTION, .init =3D a6xx_gpu_init, .a6xx =3D &(const struct a6xx_info) { .hwcg =3D a740_hwcg, @@ -1422,9 +1422,9 @@ static const struct adreno_info a7xx_gpus[] =3D { }, .gmem =3D 3 * SZ_1M, .inactive_period =3D DRM_MSM_INACTIVE_PERIOD, - .quirks =3D ADRENO_QUIRK_HAS_CACHED_COHERENT | - ADRENO_QUIRK_HAS_HW_APRIV | - ADRENO_QUIRK_PREEMPTION, + .quirks =3D ADRENO_FEAT_HAS_CACHED_COHERENT | + ADRENO_FEAT_HAS_HW_APRIV | + ADRENO_FEAT_PREEMPTION, .init =3D a6xx_gpu_init, .zapfw =3D "gen70900_zap.mbn", .a6xx =3D &(const struct a6xx_info) { diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/ad= reno/a6xx_gpu.c index 019610341df1506c89f44e86b8d1deeb27d61857..2ebd3fac212576a1507e0b6afe2= 560cd0408dd89 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c @@ -2478,7 +2478,7 @@ struct msm_gpu *a6xx_gpu_init(struct drm_device *dev) adreno_gpu->gmu_is_wrapper =3D of_device_is_compatible(node, "qcom,adreno= -gmu-wrapper"); =20 adreno_gpu->base.hw_apriv =3D - !!(config->info->quirks & ADRENO_QUIRK_HAS_HW_APRIV); + !!(config->info->quirks & ADRENO_FEAT_HAS_HW_APRIV); =20 /* gpu->info only gets assigned in adreno_gpu_init() */ is_a7xx =3D config->info->family =3D=3D ADRENO_7XX_GEN1 || @@ -2495,7 +2495,7 @@ struct msm_gpu *a6xx_gpu_init(struct drm_device *dev) } =20 if ((enable_preemption =3D=3D 1) || (enable_preemption =3D=3D -1 && - (config->info->quirks & ADRENO_QUIRK_PREEMPTION))) + (config->info->quirks & ADRENO_FEAT_PREEMPTION))) ret =3D adreno_gpu_init(dev, pdev, adreno_gpu, &funcs_a7xx, 4); else if (is_a7xx) ret =3D adreno_gpu_init(dev, pdev, adreno_gpu, &funcs_a7xx, 1); diff --git a/drivers/gpu/drm/msm/adreno/adreno_device.c b/drivers/gpu/drm/m= sm/adreno/adreno_device.c index 9ffe91920fbfb4841b28aabec9fbde94539fdd83..09d4569f77528c2a20cabc81466= 8c4c930dd07f1 100644 --- a/drivers/gpu/drm/msm/adreno/adreno_device.c +++ b/drivers/gpu/drm/msm/adreno/adreno_device.c @@ -207,7 +207,7 @@ static int adreno_bind(struct device *dev, struct devic= e *master, void *data) =20 priv->is_a2xx =3D info->family < ADRENO_3XX; priv->has_cached_coherent =3D - !!(info->quirks & ADRENO_QUIRK_HAS_CACHED_COHERENT); + !!(info->quirks & ADRENO_FEAT_HAS_CACHED_COHERENT); =20 gpu =3D info->init(drm); if (IS_ERR(gpu)) { diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.h b/drivers/gpu/drm/msm/= adreno/adreno_gpu.h index e71f420f8b3a8e6cfc52dd1c4d5a63ef3704a07f..8782c25e8a393ec7d9dc23ad450= 908d039bd08c5 100644 --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.h +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.h @@ -54,9 +54,10 @@ enum adreno_family { #define ADRENO_QUIRK_TWO_PASS_USE_WFI BIT(0) #define ADRENO_QUIRK_FAULT_DETECT_MASK BIT(1) #define ADRENO_QUIRK_LMLOADKILL_DISABLE BIT(2) -#define ADRENO_QUIRK_HAS_HW_APRIV BIT(3) -#define ADRENO_QUIRK_HAS_CACHED_COHERENT BIT(4) -#define ADRENO_QUIRK_PREEMPTION BIT(5) + +#define ADRENO_FEAT_HAS_HW_APRIV BIT(3) +#define ADRENO_FEAT_HAS_CACHED_COHERENT BIT(4) +#define ADRENO_FEAT_PREEMPTION BIT(5) =20 /* Helper for formating the chip_id in the way that userspace tools like * crashdec expect. --=20 2.34.1 From nobody Sat Nov 23 08:31:54 2024 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 140681D2B39 for ; Tue, 19 Nov 2024 17:56:49 +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=1732039012; cv=none; b=HfHsHvEoJ/RMcmRkVQnBh7JKqSD514zpwRqk3s6IcW/VCq/FW10wabwHxzbcaoC1REczIQiWXKH4NNllcz51eiT0arl/icugKvR8+y6nID9ILuDyBx2t8uppHR3eGeiDfSF1MNQj6IYCFp3kGli18KX/zO0B/bVq0aaQJlVv6F8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732039012; c=relaxed/simple; bh=0AqIInR9yFwbnFyGS/kSzI6BxCp2Vy864c584EPZMck=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=OoErfswx0M2TfPKP0z7E95+FNfvctr1GPXLNby5X+J7dEYfZa21Obk01HFCqMK/7Gzw0NdaK++dWhtMoKXrUt5mulWLklBIwu7v0xWQrmvV5UYBBGqV4r8rKkeCs4RYs2/0ZNPx/1sPCCiIDy0f4fJlVrgNR30BTidxdJifvzRY= 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=RMMS4FUV; 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="RMMS4FUV" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-4315c1c7392so32822865e9.1 for ; Tue, 19 Nov 2024 09:56:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732039008; x=1732643808; 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=yk2K0oVo05Ww0JMnwaO0UbmeEF/lazoIdfJTPpk/Vtc=; b=RMMS4FUV7BY5mEVd5Qru75CRBf4p7cS8sNfnxn4hFs+vzLRYyy4cHg1AAVr3TV8fY4 H219yEl6uKQ3IGk/c/NDezjCVuqbtW812Y09wLimu7ZmXFiI/0X4rFZ3ZV4eEzVeL5+h NZ/Sw+kcLNexZD41aXuL4Dr+1vYHrPNTVHQF+L/Sk5vrLtYYwJt0L+pjeTp0enWPdZsw gYpP257yKQLb+zqPY9BCWz1Dch7aSG3lgb/xqC6txhvbUJiw5Ccb/12dEVOuO5hIEr3+ 3+Ak8iA1RqdZJM86NSAYmG89ExQeOQ3bQIKAUwoTRcmE6DBxF2sFNphgwcPsNZxYxiK9 rzzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732039008; x=1732643808; 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=yk2K0oVo05Ww0JMnwaO0UbmeEF/lazoIdfJTPpk/Vtc=; b=HDYkb4Hjzz+GmyqlZC7mBRAdCAFO3NmkSo46dhewEx1WQS4U9ZQpNEP63+9gignKkw 6NS2EBEoMJ3mEiRUpedaTE9dGVdirmdwZQkAflKpgZD1N63Ik6gfhI8WtpaKAPZT2E5Y VXyYp5AI2IS59TCY3icTP+/w2qQaKyr/qA4/6sNLZD5FzhNr2OW6xZsSACisvnqKB0AQ IXgk4cdryBvydQUzwljqTR8yaM/Kzi2ULaRCCoAOrFSZ0TJ4HN8IIpXht12V8SJ23dQh TgVRzwTxwTaK99JJ/aJZ8qBzAn103drTNwCwiKIzQtHfGEPfXmkJSWTYN7p37l3gzJ9e zMmw== X-Forwarded-Encrypted: i=1; AJvYcCXhM1OAHZedMF+dRPAGDivnPDogpybXv4izPQz68X9YveW9sxnwn82T9/72EPLzBiGY5SREhj4keSz7hDQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yw7onK2FPqU8MB03gkaIHrqRo6XLwQJs5/97QZYMiyb/AMKq/8Y gLLFrkrTeesEMNRKzGI4DOTuM8xGKUgW827uEHXPNDeii1xbpvcFq0AyeloEvdM= X-Google-Smtp-Source: AGHT+IFLcWEe5qWu8x5m4vCYzxI66ajS72i7s4jmj/yVS5iRH7uW+yHCASns+xns7sNbDzPAlyC6JA== X-Received: by 2002:a05:600c:3143:b0:431:9397:9ace with SMTP id 5b1f17b1804b1-432df7411b0mr172022115e9.10.1732039008448; Tue, 19 Nov 2024 09:56:48 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-432da27fe68sm208302275e9.24.2024.11.19.09.56.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Nov 2024 09:56:48 -0800 (PST) From: Neil Armstrong Date: Tue, 19 Nov 2024 18:56:38 +0100 Subject: [PATCH v2 03/11] drm/msm: adreno: move features bits in a separate variable 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: <20241119-topic-sm8x50-gpu-bw-vote-v2-3-4deb87be2498@linaro.org> References: <20241119-topic-sm8x50-gpu-bw-vote-v2-0-4deb87be2498@linaro.org> In-Reply-To: <20241119-topic-sm8x50-gpu-bw-vote-v2-0-4deb87be2498@linaro.org> To: Akhil P Oommen , Viresh Kumar , Nishanth Menon , Stephen Boyd , "Rafael J. Wysocki" , Rob Clark , Sean Paul , Konrad Dybcio , Abhinav Kumar , Dmitry Baryshkov , Marijn Suijten , David Airlie , Simona Vetter , Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Connor Abbott , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=9368; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=0AqIInR9yFwbnFyGS/kSzI6BxCp2Vy864c584EPZMck=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBnPNFY6rTJHRArouHKgcaJro3QHLRsFmspb8PEE2bK nanydiiJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZzzRWAAKCRB33NvayMhJ0fnmD/ 9bX91os7ateFdrwylRii+JOc3pxDsfVPT2napM/PE+NK2gT1KLBFqhCba/Q9w+6flWwIW9DdClnpZl UlwRE95nBjdW0VzPs6b4rL0QMO/PfO9d7um84+sR3NPA9Y1CYSh0iyisTMx943EKiZ7HrBcHqUFRnI sSpp5AJ7HGJE1PHDcCrqMGdvZuE89wX/hnrSfrfkW8WPzOlw4duSBc4rN8yIhieOS9AUXmTxxl0pkC xfL6/K50xTuP4RdLSg6/c7/AtWWV8J8JPH4LO3MUpMVpRMKlhEic1aJmn03Dpu3sQq1wbMaVkiJWUh JvR4vyaZ8xRDP2WZY+ZNefBdZ0xN4WX14lDYFaK5kmknqLdgEbmHkZnQnmL2QKwnK1P+kJkXQ7Xecd okzYpa4VQhmmF1wlpR4Hqt2mICOi7QGYwy23/MmTaT9G6Pyg4Aa3F8pIs5MFQUOOwsNoLJM/uD5M1a 1Pj3aKfNDB9OuL7sXlTApkBYIfZwWaOe8YdjsYG/5XS7btDZsnvGs2yboQi0jQ2ohyO8mwUWMGk83M QU/0BGYjbrbCC5zmiBhAfHGw/RjM5MXaKdubV38zdqAgshmF4NyyqUPyIxWwFMhRLNip0Om6weZA1K GeumTb54WHO3Akqjc0sSKfaXfwmXmciyu5/fuJkNG3MNJpBfrEn8nKKKYfwA== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE Now the features defines have the right name, introduce a features bitfield and move the features defines in it, fixing all code checking for them. No functional changes intended. Signed-off-by: Neil Armstrong --- drivers/gpu/drm/msm/adreno/a6xx_catalog.c | 34 +++++++++++++++-----------= ---- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 4 ++-- drivers/gpu/drm/msm/adreno/adreno_device.c | 2 +- drivers/gpu/drm/msm/adreno/adreno_gpu.h | 7 +++--- 4 files changed, 24 insertions(+), 23 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_catalog.c b/drivers/gpu/drm/ms= m/adreno/a6xx_catalog.c index 825c820def315968d508973c8ae40c7c7b646569..93f0d4bf50ba773ecde93e6c29a= 2fcec24ebb7b3 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_catalog.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_catalog.c @@ -743,7 +743,7 @@ static const struct adreno_info a6xx_gpus[] =3D { }, .gmem =3D SZ_512K, .inactive_period =3D DRM_MSM_INACTIVE_PERIOD, - .quirks =3D ADRENO_FEAT_HAS_CACHED_COHERENT, + .features =3D ADRENO_FEAT_HAS_CACHED_COHERENT, .init =3D a6xx_gpu_init, .zapfw =3D "a615_zap.mbn", .a6xx =3D &(const struct a6xx_info) { @@ -769,7 +769,7 @@ static const struct adreno_info a6xx_gpus[] =3D { }, .gmem =3D SZ_512K, .inactive_period =3D DRM_MSM_INACTIVE_PERIOD, - .quirks =3D ADRENO_FEAT_HAS_CACHED_COHERENT, + .features =3D ADRENO_FEAT_HAS_CACHED_COHERENT, .init =3D a6xx_gpu_init, .a6xx =3D &(const struct a6xx_info) { .protect =3D &a630_protect, @@ -839,7 +839,7 @@ static const struct adreno_info a6xx_gpus[] =3D { }, .gmem =3D SZ_512K, .inactive_period =3D DRM_MSM_INACTIVE_PERIOD, - .quirks =3D ADRENO_FEAT_HAS_CACHED_COHERENT, + .features =3D ADRENO_FEAT_HAS_CACHED_COHERENT, .init =3D a6xx_gpu_init, .zapfw =3D "a615_zap.mdt", .a6xx =3D &(const struct a6xx_info) { @@ -864,7 +864,7 @@ static const struct adreno_info a6xx_gpus[] =3D { }, .gmem =3D SZ_512K, .inactive_period =3D DRM_MSM_INACTIVE_PERIOD, - .quirks =3D ADRENO_FEAT_HAS_CACHED_COHERENT | + .features =3D ADRENO_FEAT_HAS_CACHED_COHERENT | ADRENO_FEAT_HAS_HW_APRIV, .init =3D a6xx_gpu_init, .zapfw =3D "a620_zap.mbn", @@ -892,7 +892,7 @@ static const struct adreno_info a6xx_gpus[] =3D { }, .gmem =3D SZ_1M, .inactive_period =3D DRM_MSM_INACTIVE_PERIOD, - .quirks =3D ADRENO_FEAT_HAS_CACHED_COHERENT, + .features =3D ADRENO_FEAT_HAS_CACHED_COHERENT, .init =3D a6xx_gpu_init, .zapfw =3D "a630_zap.mdt", .a6xx =3D &(const struct a6xx_info) { @@ -911,7 +911,7 @@ static const struct adreno_info a6xx_gpus[] =3D { }, .gmem =3D SZ_1M, .inactive_period =3D DRM_MSM_INACTIVE_PERIOD, - .quirks =3D ADRENO_FEAT_HAS_CACHED_COHERENT, + .features =3D ADRENO_FEAT_HAS_CACHED_COHERENT, .init =3D a6xx_gpu_init, .zapfw =3D "a640_zap.mdt", .a6xx =3D &(const struct a6xx_info) { @@ -934,7 +934,7 @@ static const struct adreno_info a6xx_gpus[] =3D { }, .gmem =3D SZ_1M + SZ_128K, .inactive_period =3D DRM_MSM_INACTIVE_PERIOD, - .quirks =3D ADRENO_FEAT_HAS_CACHED_COHERENT | + .features =3D ADRENO_FEAT_HAS_CACHED_COHERENT | ADRENO_FEAT_HAS_HW_APRIV, .init =3D a6xx_gpu_init, .zapfw =3D "a650_zap.mdt", @@ -961,7 +961,7 @@ static const struct adreno_info a6xx_gpus[] =3D { }, .gmem =3D SZ_1M + SZ_512K, .inactive_period =3D DRM_MSM_INACTIVE_PERIOD, - .quirks =3D ADRENO_FEAT_HAS_CACHED_COHERENT | + .features =3D ADRENO_FEAT_HAS_CACHED_COHERENT | ADRENO_FEAT_HAS_HW_APRIV, .init =3D a6xx_gpu_init, .zapfw =3D "a660_zap.mdt", @@ -981,7 +981,7 @@ static const struct adreno_info a6xx_gpus[] =3D { }, .gmem =3D SZ_1M + SZ_512K, .inactive_period =3D DRM_MSM_INACTIVE_PERIOD, - .quirks =3D ADRENO_FEAT_HAS_CACHED_COHERENT | + .features =3D ADRENO_FEAT_HAS_CACHED_COHERENT | ADRENO_FEAT_HAS_HW_APRIV, .init =3D a6xx_gpu_init, .a6xx =3D &(const struct a6xx_info) { @@ -1000,7 +1000,7 @@ static const struct adreno_info a6xx_gpus[] =3D { }, .gmem =3D SZ_512K, .inactive_period =3D DRM_MSM_INACTIVE_PERIOD, - .quirks =3D ADRENO_FEAT_HAS_CACHED_COHERENT | + .features =3D ADRENO_FEAT_HAS_CACHED_COHERENT | ADRENO_FEAT_HAS_HW_APRIV, .init =3D a6xx_gpu_init, .zapfw =3D "a660_zap.mbn", @@ -1028,7 +1028,7 @@ static const struct adreno_info a6xx_gpus[] =3D { }, .gmem =3D SZ_2M, .inactive_period =3D DRM_MSM_INACTIVE_PERIOD, - .quirks =3D ADRENO_FEAT_HAS_CACHED_COHERENT, + .features =3D ADRENO_FEAT_HAS_CACHED_COHERENT, .init =3D a6xx_gpu_init, .zapfw =3D "a640_zap.mdt", .a6xx =3D &(const struct a6xx_info) { @@ -1046,7 +1046,7 @@ static const struct adreno_info a6xx_gpus[] =3D { }, .gmem =3D SZ_4M, .inactive_period =3D DRM_MSM_INACTIVE_PERIOD, - .quirks =3D ADRENO_FEAT_HAS_CACHED_COHERENT | + .features =3D ADRENO_FEAT_HAS_CACHED_COHERENT | ADRENO_FEAT_HAS_HW_APRIV, .init =3D a6xx_gpu_init, .zapfw =3D "a690_zap.mdt", @@ -1331,7 +1331,7 @@ static const struct adreno_info a7xx_gpus[] =3D { }, .gmem =3D SZ_128K, .inactive_period =3D DRM_MSM_INACTIVE_PERIOD, - .quirks =3D ADRENO_FEAT_HAS_HW_APRIV, + .features =3D ADRENO_FEAT_HAS_HW_APRIV, .init =3D a6xx_gpu_init, .zapfw =3D "a702_zap.mbn", .a6xx =3D &(const struct a6xx_info) { @@ -1355,7 +1355,7 @@ static const struct adreno_info a7xx_gpus[] =3D { }, .gmem =3D SZ_2M, .inactive_period =3D DRM_MSM_INACTIVE_PERIOD, - .quirks =3D ADRENO_FEAT_HAS_CACHED_COHERENT | + .features =3D ADRENO_FEAT_HAS_CACHED_COHERENT | ADRENO_FEAT_HAS_HW_APRIV | ADRENO_FEAT_PREEMPTION, .init =3D a6xx_gpu_init, @@ -1377,7 +1377,7 @@ static const struct adreno_info a7xx_gpus[] =3D { }, .gmem =3D 3 * SZ_1M, .inactive_period =3D DRM_MSM_INACTIVE_PERIOD, - .quirks =3D ADRENO_FEAT_HAS_CACHED_COHERENT | + .features =3D ADRENO_FEAT_HAS_CACHED_COHERENT | ADRENO_FEAT_HAS_HW_APRIV | ADRENO_FEAT_PREEMPTION, .init =3D a6xx_gpu_init, @@ -1400,7 +1400,7 @@ static const struct adreno_info a7xx_gpus[] =3D { }, .gmem =3D 3 * SZ_1M, .inactive_period =3D DRM_MSM_INACTIVE_PERIOD, - .quirks =3D ADRENO_FEAT_HAS_CACHED_COHERENT | + .features =3D ADRENO_FEAT_HAS_CACHED_COHERENT | ADRENO_FEAT_HAS_HW_APRIV | ADRENO_FEAT_PREEMPTION, .init =3D a6xx_gpu_init, @@ -1422,7 +1422,7 @@ static const struct adreno_info a7xx_gpus[] =3D { }, .gmem =3D 3 * SZ_1M, .inactive_period =3D DRM_MSM_INACTIVE_PERIOD, - .quirks =3D ADRENO_FEAT_HAS_CACHED_COHERENT | + .features =3D ADRENO_FEAT_HAS_CACHED_COHERENT | ADRENO_FEAT_HAS_HW_APRIV | ADRENO_FEAT_PREEMPTION, .init =3D a6xx_gpu_init, diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/ad= reno/a6xx_gpu.c index 2ebd3fac212576a1507e0b6afe2560cd0408dd89..654d0cff421f15901cd4bf33b41= e70004634ec75 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c @@ -2478,7 +2478,7 @@ struct msm_gpu *a6xx_gpu_init(struct drm_device *dev) adreno_gpu->gmu_is_wrapper =3D of_device_is_compatible(node, "qcom,adreno= -gmu-wrapper"); =20 adreno_gpu->base.hw_apriv =3D - !!(config->info->quirks & ADRENO_FEAT_HAS_HW_APRIV); + !!(config->info->features & ADRENO_FEAT_HAS_HW_APRIV); =20 /* gpu->info only gets assigned in adreno_gpu_init() */ is_a7xx =3D config->info->family =3D=3D ADRENO_7XX_GEN1 || @@ -2495,7 +2495,7 @@ struct msm_gpu *a6xx_gpu_init(struct drm_device *dev) } =20 if ((enable_preemption =3D=3D 1) || (enable_preemption =3D=3D -1 && - (config->info->quirks & ADRENO_FEAT_PREEMPTION))) + (config->info->features & ADRENO_FEAT_PREEMPTION))) ret =3D adreno_gpu_init(dev, pdev, adreno_gpu, &funcs_a7xx, 4); else if (is_a7xx) ret =3D adreno_gpu_init(dev, pdev, adreno_gpu, &funcs_a7xx, 1); diff --git a/drivers/gpu/drm/msm/adreno/adreno_device.c b/drivers/gpu/drm/m= sm/adreno/adreno_device.c index 09d4569f77528c2a20cabc814668c4c930dd07f1..11a228472fa0cef3b6e4e21a366= 470fbbc3ea8df 100644 --- a/drivers/gpu/drm/msm/adreno/adreno_device.c +++ b/drivers/gpu/drm/msm/adreno/adreno_device.c @@ -207,7 +207,7 @@ static int adreno_bind(struct device *dev, struct devic= e *master, void *data) =20 priv->is_a2xx =3D info->family < ADRENO_3XX; priv->has_cached_coherent =3D - !!(info->quirks & ADRENO_FEAT_HAS_CACHED_COHERENT); + !!(info->features & ADRENO_FEAT_HAS_CACHED_COHERENT); =20 gpu =3D info->init(drm); if (IS_ERR(gpu)) { diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.h b/drivers/gpu/drm/msm/= adreno/adreno_gpu.h index 8782c25e8a393ec7d9dc23ad450908d039bd08c5..4702d4cfca3b58fb3cbb25cb680= 5f1c19be2ebcb 100644 --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.h +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.h @@ -55,9 +55,9 @@ enum adreno_family { #define ADRENO_QUIRK_FAULT_DETECT_MASK BIT(1) #define ADRENO_QUIRK_LMLOADKILL_DISABLE BIT(2) =20 -#define ADRENO_FEAT_HAS_HW_APRIV BIT(3) -#define ADRENO_FEAT_HAS_CACHED_COHERENT BIT(4) -#define ADRENO_FEAT_PREEMPTION BIT(5) +#define ADRENO_FEAT_HAS_HW_APRIV BIT(0) +#define ADRENO_FEAT_HAS_CACHED_COHERENT BIT(1) +#define ADRENO_FEAT_PREEMPTION BIT(2) =20 /* Helper for formating the chip_id in the way that userspace tools like * crashdec expect. @@ -98,6 +98,7 @@ struct adreno_info { uint32_t revn; const char *fw[ADRENO_FW_MAX]; uint32_t gmem; + u64 features; u64 quirks; struct msm_gpu *(*init)(struct drm_device *dev); const char *zapfw; --=20 2.34.1 From nobody Sat Nov 23 08:31:54 2024 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 37CCC1D3567 for ; Tue, 19 Nov 2024 17:56:51 +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=1732039013; cv=none; b=VWSazG9X6a8cBHisSUtJ2aqe3pBMfDH7Wh0xzDuTcpDqCbpoXyyNw/c6pGWgqJs1hfSM40KqSDuhCo7KL8R+O+c1mf8EGK76XCYvbqYy315mmT+j1ciC8E5r48ioTAIw8UkRvlFw2h0jr+ced4JztAFJL9Bi7gGTB//qYbihcZ4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732039013; c=relaxed/simple; bh=n7AjLch9953BuDVwIlWrOSl9FaavH+aib8ySJTyoxTo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=RgYNQk0aTC43wwAepGqVNAV9g4n+yAZ/aCAnPPUIWWvAf1wJNuF1ilYom66Mt7narFHpdiHtQsZ2FAXFTGk8zpMfHoVEYOg6cx52nc8OGFqbix7/66eA7usQdP8ft3JWcymvHRDm/T570OReCfw1oUKBmwkfqvYDJoWCwajnGV8= 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=svV3ij5O; 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="svV3ij5O" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-4315e9e9642so39171595e9.0 for ; Tue, 19 Nov 2024 09:56:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732039009; x=1732643809; 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=aQgC5WDyFd5ZARts+BDdZKaBI93HBlMTdW2TWmW+138=; b=svV3ij5ON4I5ySd/erO7PlqIf/ivL4yGDqbVUmYYAE4Z8kmVCrI2wRmY8JD8S7NSsm PQse0JmxDKQTxc4DP1O1OhPIQ82bh/fNGYOQSwCIPDCVFPs1TNS4PHdmIwISqucl9KgD wo1S00mmnm+1X0hixxTPZbGV1IV6blUCKBoO8AXjJAavvmTCBkMNKdPq54fM+OR/J/gx sLpSM9GIAz9N3lPpYVzrdgvZO/RNkJZnGckq8JeseygfjdFl1nJU/EJHoIvNUR8iMZXe vNm2hT7b38OGBOzVDXRz9BwRYBg3rCrcECIo/B1gdsuAyKdYAeXW6BgvXbMin+SojqUT jYEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732039009; x=1732643809; 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=aQgC5WDyFd5ZARts+BDdZKaBI93HBlMTdW2TWmW+138=; b=KtXA0z8/f9XPphhS+OiVVQJIEuzdzU0GLgiPwfq3IEwMaQ5gp/UAtyQv5jIOfkClRI aYF59i58IxcTj2V/+Ru6kG4Ez4uFtIBy8pDRQ+qaHPKARLMAf6Qg3I/Lr7fttQpeJlLz 35DCT9qZLJzg/Pa+36gGtQW6I93D+Z4MTg9ZQZum3ppyfdafMij8KFrjv7qUxuvndtdG gkB+PLhPyu/sl1EWIy1ARemwTQJTuToh2e047nW8f0pMMx5wBDb+Eio2htEoELNsVV1Z W6DwYOX3HPHLcyKbKSeDgnkynCAiUU+igFhCm21aN+uoXy8kkO3dIn7WweSeUrW+k99+ PnGQ== X-Forwarded-Encrypted: i=1; AJvYcCWOplg5/BMPEHojTFR39Kx5nIXzZGJD/v+se3XDqO+hXiQuIVMlzLtmaQHlj8HOTQuBGo27IlNymywghHM=@vger.kernel.org X-Gm-Message-State: AOJu0YwfPP6l0Sv6Xeg74S6owIZnjBpl8ex8eWTNc7aU8SscZqlGQ1t8 ii1yKz1oej2xn1D1JyuA8YhDs5kdMtjJK3SM+A6Ispj28qhlSbwycFre559CuMU= X-Google-Smtp-Source: AGHT+IEngRh+IxWr8NTNcl4pSwSHfVHmqMZw/rE7nd+rJm48pJkx+H7BQiX2WTMCM9X1hFGV7eEFHQ== X-Received: by 2002:a05:600c:1ca9:b0:431:5bf2:2d4 with SMTP id 5b1f17b1804b1-432df792cfdmr141960035e9.29.1732039009494; Tue, 19 Nov 2024 09:56:49 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-432da27fe68sm208302275e9.24.2024.11.19.09.56.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Nov 2024 09:56:49 -0800 (PST) From: Neil Armstrong Date: Tue, 19 Nov 2024 18:56:39 +0100 Subject: [PATCH v2 04/11] drm/msm: adreno: add GMU_BW_VOTE feature flag 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: <20241119-topic-sm8x50-gpu-bw-vote-v2-4-4deb87be2498@linaro.org> References: <20241119-topic-sm8x50-gpu-bw-vote-v2-0-4deb87be2498@linaro.org> In-Reply-To: <20241119-topic-sm8x50-gpu-bw-vote-v2-0-4deb87be2498@linaro.org> To: Akhil P Oommen , Viresh Kumar , Nishanth Menon , Stephen Boyd , "Rafael J. Wysocki" , Rob Clark , Sean Paul , Konrad Dybcio , Abhinav Kumar , Dmitry Baryshkov , Marijn Suijten , David Airlie , Simona Vetter , Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Connor Abbott , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1306; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=n7AjLch9953BuDVwIlWrOSl9FaavH+aib8ySJTyoxTo=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBnPNFYMO7EyC4T4TF/e7BGzAu0nBPzu5e8pKgbvKGl RBFXRhKJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZzzRWAAKCRB33NvayMhJ0fSpEA Cw3SShkE7iSaedv/beI78snfZ1LAHYcu9+c9tv42VvGDREihcCBoe3XopqonDAGrx1AXztqeSu5Pz+ 5wrYOc2TTfOSQO//QRHjDNpNPBO9tmrrnf3+aXTMDGlYNtcWpfvY21x7XjKdj4sc4wLzDYVZsehNec cdqKihmWrxbMJEQBWI7vOyDI62OVapFRm589i2jwA8etBaC62AV3fPT2qKkc+0saKe61lgjJLamTWu Uf6uBXvV2n9/ke2JNjgyAI13yG8Z9lumnXayLGTUU3rGmHIFYxev82ZAZpLQDtEeve7hZPQQnqz/c1 YGdOqxcxAK+w0edPQZiqakrPS2TgBCDC2WJwsOUrqmaowXOzhjTNH89iMJksIcc90rPQtSszCK3vib cS4+tweYJJhV0MWolbL0JMFJvaRoPLmCAuiIWY1j8M51AQgS8tn2cgivPmavajsqQhvluHFVrAEI4f 3I4o29J5dozRXWuvbuvyQEWQI6q05TpnAqq6WjYE0PW99ajcvEUXT+oU0+mMCbLl+P/sRYsAD3Niem 2IRU5SkNbdoDSWwa8XwxtIJzE3G+Yk7M33gUfGvqo4CQUhEq+M4c2FCTjTv8DyzmpYg5u8xHS7Fn/y nlVYppeOmQ0H3paslgGx62JPgrw+73piVyUILInwYQXVyoRZuDwY7wfzdTtg== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE The Adreno GMU Management Unit (GNU) can also scale the DDR Bandwidth along the Frequency and Power Domain level, but by default we leave the OPP core vote for 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. While the feature will require some data in a6xx_info, it's safer to only enable tested platforms with this flag first. Add a new feature enabling DDR Bandwidth vote via GMU. Signed-off-by: Neil Armstrong --- drivers/gpu/drm/msm/adreno/adreno_gpu.h | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.h b/drivers/gpu/drm/msm/= adreno/adreno_gpu.h index 4702d4cfca3b58fb3cbb25cb6805f1c19be2ebcb..394b96eb6c83354ae008b15b562= bedb96cd391dd 100644 --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.h +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.h @@ -58,6 +58,7 @@ enum adreno_family { #define ADRENO_FEAT_HAS_HW_APRIV BIT(0) #define ADRENO_FEAT_HAS_CACHED_COHERENT BIT(1) #define ADRENO_FEAT_PREEMPTION BIT(2) +#define ADRENO_FEAT_GMU_BW_VOTE BIT(3) =20 /* Helper for formating the chip_id in the way that userspace tools like * crashdec expect. --=20 2.34.1 From nobody Sat Nov 23 08:31:54 2024 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.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 D60141D364C for ; Tue, 19 Nov 2024 17:56:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732039015; cv=none; b=utBXjMtBFLe6jGL/VzgNd7Fk/3+mcBO9ZJt8ccBbLrYKHFH+aMCwy7pkDaxD0DP/YYOk2BzxFUbYs6F3Qh5nNy6r4LAzslCYAVe6ICq2hR7y13gKzPfiiE/Hz1P6PWJaa87NubWB4XKFTqKzOkFzkThv1aIviz2A90DHkVSb6C8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732039015; c=relaxed/simple; bh=HBRDsNw9Gt6y+bhLpW3yKrF6dqOXzdwZOiJPQuFbYDc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=uWqIxq8ggSSowUnHxGrJahtNJb0NPKX5KtO9bNb5POnnzFKxUK6rOnu6dd5CzONV360G7mHLVvO22KwQ9W+seHU5XXxlvq/WZj+mkDZO3cmSKwSPM1X8pw2PT6YOW8NdefLSoWng+eSw53Usr+aFo5SWKOfiufKSsyTqEMCVpM0= 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=RT06i5g1; arc=none smtp.client-ip=209.85.221.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="RT06i5g1" Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-381ee2e10dfso2125432f8f.0 for ; Tue, 19 Nov 2024 09:56:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732039011; x=1732643811; 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=mODA27TpHEFSjNHYuAShnzvbkOsJQWCOCgpBEnmiNV0=; b=RT06i5g1tfhNIHtgYxBXHZENYinzqHw7t3YQJMeSfrdw4Klb/1czWsjdedFXLjw62l rso889QLxCdwczviWVeRqpWt1+jv6LhNzaxYVyJ3mvWmnrp0vrAIN4wsa4I3l+N3RO7m 9w3Ig3XcVDvn15Ru8b95bJQz0q9tpeVFy1maAIjyMsixRjfgZ8MqdbZvfBd5JsgRisB2 KRTJ6mHMidRzl1Qh5dQFBPSxywUKEqWSsj3/o7Wz21SRdquB2ksXhsyK/Twy80NaPqg1 zo65Wfl/a1+9rNbfO81khGTQlaxHHhcNpI4rvj2Ic/lLJc4Fm6NkOGjA78kF6WfFAVXD lV2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732039011; x=1732643811; 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=mODA27TpHEFSjNHYuAShnzvbkOsJQWCOCgpBEnmiNV0=; b=q8BlexI2Fstp7nV2ymDsHFWkEsK5qQmgaIPg/Wbkn3CFYHfntZUgA6ICq/6p1ViKeH ZEkNnXfdpM83kz76l4cCi6bt8fldx5AZWiR5ql8v90/QvGd4A90Q8xTsU0xH7rSEckTk 3oyW74p+aIAyv+GKS2Y8DgUQtNAIBvNQ8JS6xTtEnHvhmcwsO4PPcdrJ9Kd45LcO+A85 xnA9GOJcz4YfaF3QLweWL7kQgYN7GUNw9+CC0BtCvjS4vM8KUNEwFmFc7ayzwr2YTCua DtrauBudOiLP7oLxzQakRdl0ocROx+EyDzRWSeUq8KGhBb+QESOA8C4EcMR1eBUr67Ic B8Cg== X-Forwarded-Encrypted: i=1; AJvYcCVMNyToovmLB2iC3sXX32XzPnX88hLYBNCbjSwXn7W0ta53MruQ/x3RmUXygZkWSXXqpcbFspYXmEhogjo=@vger.kernel.org X-Gm-Message-State: AOJu0YxqgVg8konlADe/5Ult2H+nrjJQEwCKbvC+G3LMTMj22LCv0+9o VL7kxGYZjU9qp+CF4fJXZNO1tKrV/CpNeTKVlBpmKcmq+cPpSct+witb1qF0COqJ4tdfvhBxumA U X-Google-Smtp-Source: AGHT+IEIh9guwWafoOVzdqcqMneTNzLlCikQcix1Okd/2UKoGGg8dRIr6nVL5DMBiKYUjsiH20i5VQ== X-Received: by 2002:a5d:6489:0:b0:382:4b5c:4199 with SMTP id ffacd0b85a97d-3824b5c443cmr4155056f8f.23.1732039011254; Tue, 19 Nov 2024 09:56:51 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-432da27fe68sm208302275e9.24.2024.11.19.09.56.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Nov 2024 09:56:50 -0800 (PST) From: Neil Armstrong Date: Tue, 19 Nov 2024 18:56:40 +0100 Subject: [PATCH v2 05/11] 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: <20241119-topic-sm8x50-gpu-bw-vote-v2-5-4deb87be2498@linaro.org> References: <20241119-topic-sm8x50-gpu-bw-vote-v2-0-4deb87be2498@linaro.org> In-Reply-To: <20241119-topic-sm8x50-gpu-bw-vote-v2-0-4deb87be2498@linaro.org> To: Akhil P Oommen , Viresh Kumar , Nishanth Menon , Stephen Boyd , "Rafael J. Wysocki" , Rob Clark , Sean Paul , Konrad Dybcio , Abhinav Kumar , Dmitry Baryshkov , Marijn Suijten , David Airlie , Simona Vetter , Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Connor Abbott , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=8513; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=HBRDsNw9Gt6y+bhLpW3yKrF6dqOXzdwZOiJPQuFbYDc=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBnPNFZciGIWjU99nYrv3NSOQ4FRH3hxQiDaFs6246i RlQfCXiJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZzzRWQAKCRB33NvayMhJ0XaXD/ 9sxJ6sLTAV3AQgvaxK3VtgOkK+SIdgj3aSi5wz27qL4RyV6y8qbCEQDyjmgugrb4QYpZjFjKGoMHgZ YQuzel7XHdq1WQpRC08mWPYYIBqBbIBiRK6LxAJfxS+MpzMaXOv5eljv9M8OvC1eBO4fTpivZVdfBI ckMBHf5ni7J/VHBtjiBMU9p8oTx6MjAlBAemWJ5+q0BJxRUrqsOcqNRxnZRR5gpBj6C9/4SpTMx2kd NHxi14GAmYbOAxGEc8I1iN6v1tmuplGrOoohUd7ANZ2Dp1jYGB8/SKG5cvdTo6JoLZhsadzl/ySp6F KrC0UVqEe+g2tle59g2P7UPPlVr+mHXvEROL8olESrRZuRkDRKoU/W01Aopj2nuaRBiAA0/U95TnZ0 SGxr8hJufYk7h4Z/IdRJwMk24t1126U9Vw5cQJRrJMWPqA+Y9XT+aVxCgBfPr/GpE3Q4YN/MKDRwTH diwf21IVK9cJjkEY6Nu0Z4XcF0LL6cXiilJekN5OjXLdJ4iACvdu5OUAbkbW9rA+lSABkd904VlmbV VNALPpQEHDOXe0sNN6Ih0aWXG0wtPCYSJQJbiabzo39J5LH+7sHwg3ATv2NlxcmNZgKF7GRufL9CPr 3OgJ4F7mJPn/TG2j64jwiI7kN2QrkYKpPQFskVaySRgn9sSKHHecU1LLZ0cg== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE The Adreno GMU 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. 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. 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 | 153 ++++++++++++++++++++++++++++++= ++++ drivers/gpu/drm/msm/adreno/a6xx_gmu.h | 14 ++++ drivers/gpu/drm/msm/adreno/a6xx_gpu.h | 1 + 3 files changed, 168 insertions(+) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/ad= reno/a6xx_gmu.c index 14db7376c712d19446b38152e480bd5a1e0a5198..f6814d92a4edb29ba8a34a34aab= b8b2324e9c6a4 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,109 @@ 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 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] =3D { 0 }; + unsigned int bcm_index, bw_index; + + /* Retrieve BCM data from cmd-db */ + for (bcm_index =3D 0; bcm_index < GMU_MAX_BCMS; bcm_index++) { + size_t count; + + /* Skip unconfigured BCM */ + if (!info->bcm[bcm_index].name) + continue; + + bcm_data[bcm_index] =3D cmd_db_read_aux_data( + info->bcm[bcm_index].name, + &count); + if (IS_ERR(bcm_data[bcm_index])) + return PTR_ERR(bcm_data[bcm_index]); + + if (!count) + return -EINVAL; + } + + /* 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_bw_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 < GMU_MAX_BCMS; bcm_index++) { + bool commit =3D false; + u64 peak, vote; + u16 width; + u32 unit; + + /* Skip unconfigured BCM */ + if (!info->bcm[bcm_index].name || !bcm_data[bcm_index]) + continue; + + if (bcm_index =3D=3D GMU_MAX_BCMS - 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->bcm[bcm_index].fixed) { + u32 perfmode =3D 0; + + if (bw >=3D info->bcm[bcm_index].perfmode_bw) + perfmode =3D info->bcm[bcm_index].perfmode; + + data[bcm_index] =3D BCM_TCS_CMD(commit, true, 0, perfmode); + continue; + } + + /* Multiply the bandwidth by the width of the connection */ + width =3D le16_to_cpu(bcm_data[bcm_index]->width); + peak =3D bcm_div((u64)bw * width, info->bcm[bcm_index].buswidth); + + /* Input bandwidth value is in KBps, scale the value to BCM unit */ + unit =3D le32_to_cpu(bcm_data[bcm_index]->unit); + vote =3D bcm_div(peak * 1000ULL, unit); + + if (vote > BCM_TCS_CMD_VOTE_MASK) + vote =3D 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 +1494,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 +1514,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 (adreno_gpu->info->features & ADRENO_FEAT_GMU_BW_VOTE) + ret |=3D a6xx_gmu_rpmh_bw_votes_init(info, gmu); + return ret; } =20 @@ -1442,6 +1553,38 @@ 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); @@ -1472,6 +1615,16 @@ 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 (adreno_gpu->info->features & ADRENO_FEAT_GMU_BW_VOTE) + gmu->nr_gpu_bws =3D a6xx_gmu_build_bw_table(&gpu->pdev->dev, + gmu->gpu_bw_table, ARRAY_SIZE(gmu->gpu_bw_table)); + + gmu->current_perf_index =3D gmu->nr_gpu_freqs - 1; + /* 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 b4a79f88ccf45cfe651c86d2a9da39541c5772b3..03603eadc0f9ed866899c95e99f= 333a511ebc3c1 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.h +++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.h @@ -19,6 +19,16 @@ struct a6xx_gmu_bo { u64 iova; }; =20 +#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 * CPU and the GMU bring up the hardware @@ -82,6 +92,10 @@ struct a6xx_gmu { unsigned long gpu_freqs[16]; u32 gx_arc_votes[16]; =20 + int nr_gpu_bws; + unsigned long gpu_bw_table[16]; + u32 gpu_bw_votes[16][GMU_MAX_BCMS]; + int nr_gmu_freqs; unsigned long gmu_freqs[4]; u32 cx_arc_votes[4]; diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.h b/drivers/gpu/drm/msm/ad= reno/a6xx_gpu.h index 4aceffb6aae89c781facc2a6e4a82b20b341b6cb..5b80919e595fa1ba0a3afcca55f= eb89e60870cb1 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 bcm[GMU_MAX_BCMS]; }; =20 struct a6xx_gpu { --=20 2.34.1 From nobody Sat Nov 23 08:31:54 2024 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 505A51D5ABA for ; Tue, 19 Nov 2024 17:56:54 +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=1732039016; cv=none; b=panOrPI2ZaG/UBxKkVALz/B+LQTDtwOf61bBsgy3tK7hDKBWWXheyfpfdsnNimyFimGANxPv+ElaHwnrxK45MuIINkgefIV4Z3oNi3A2C1T2OlVcsf3+rXnK21UHNWJNUGKIughvUcNObzPoZ0m67vgjkjaqwa4W2qRuIfFDnJM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732039016; c=relaxed/simple; bh=8YGZ9WKDiwlY9CXdycHEn+g53UomsCDyNV7cpV/GbpI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Bi9lw8v2gdgJ5318HyT56fAChRIwqJBFAL3EYiWKYJLUZcYZ/7HWH0eaWkwCIAHzcnfe51zzh5r9tqymOjsHpYBqRJgzNLYVF32VKd8b1J6EVod6UnOtZX8fM2wfIsG36girn4EkszHAdn/Hm/otfm7Y7J5AmzLaqaH9rw6W8Qc= 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=J2zYMKTC; 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="J2zYMKTC" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-4319399a411so11382195e9.2 for ; Tue, 19 Nov 2024 09:56:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732039012; x=1732643812; 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=zN/NhtIKWV0JWgHtrKAVVv8gpmbYvF+U20QAevdC0aI=; b=J2zYMKTC62AsxtBtRVYwdAvkw2t8XkWj/ecXqJ9hAju1pGiMjZx/HGs6PtfnQMqgLJ RIu09C4bW6159g76eBCcKcwmiI3t6aDkj1pi/sgKHTzsv4OKXBDIQiHILyrPqYCuE7m0 0A+yh90BTRMc6p9nP9DDvOe0bXTCP675RSeBQm1Wj7G6Lm2QwlAj5RLQxHWTzn/N1IvV 35blm3gbzClryGkTnhfKEvMezPwjtWm9pWY4ARsJe4I+CeKrNU9Akntf63EeNQoFuIdB DRYgZFJgNNtaCCP1E1+pEEKQpNmYrni6Pk9LEzO7fxceCCBaFmltbdXr8T+6FP/hnMah qePw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732039012; x=1732643812; 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=zN/NhtIKWV0JWgHtrKAVVv8gpmbYvF+U20QAevdC0aI=; b=JqzktlE+C7DxTXOoFIg6Cex0wl7nvdqM5C5AcIk8nnim8V0iXdC8ETWFR2GstQkHg/ AseNoLKrMmaGdyjktHe+uvMRiv4j1ZEfOboivUxzgr6KdXt0jwCjYE0CoepZzPvvCtLS cY6X9/Aco42eblIcaKfjGmIbTJRZXLSxVP4MenZ4Be1H2WrpKbxUTMFaa+TDIDiOQu7U cDeuJs3Dclr9+MoojQEeQCaqc6nPDx5UpA3DBoc5fohVQIFtzcFafxdsnMaQH7Zr+Oof Vc6gvp0Hf/46nLX400OhMoc9VcCjqsUWl8lWNG9EO5+7yTzsNJEuqeriB/70mXsNg0aT M+qQ== X-Forwarded-Encrypted: i=1; AJvYcCWJ0VeJUrd0Il9exW65L7op2n1zkDmM86YkgvXDV2tUg1J/CKHF6oHUfLBMIiooSExpSuP3u+nsaoHmbCk=@vger.kernel.org X-Gm-Message-State: AOJu0YzzJGYCCMdhxIHH0wyCJLrLzsnF3vx86Ql1HFxMAz8h6yxKInR/ xLH5IFzuye3DNPIuuSKd/6uKCHG5zuI1nyeUHlqpTq5m2o92v1O1KwEv1l0ISmM= X-Google-Smtp-Source: AGHT+IHbURW1yV1GM9BVVgDb8HTgtd4EPVwidgPIsYm8KnFRO+oKjNCO959EqmNWOulCKA3bRMMHag== X-Received: by 2002:a05:600c:4689:b0:431:9397:9ac9 with SMTP id 5b1f17b1804b1-432df746a1bmr163880285e9.15.1732039012427; Tue, 19 Nov 2024 09:56:52 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-432da27fe68sm208302275e9.24.2024.11.19.09.56.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Nov 2024 09:56:52 -0800 (PST) From: Neil Armstrong Date: Tue, 19 Nov 2024 18:56:41 +0100 Subject: [PATCH v2 06/11] 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: <20241119-topic-sm8x50-gpu-bw-vote-v2-6-4deb87be2498@linaro.org> References: <20241119-topic-sm8x50-gpu-bw-vote-v2-0-4deb87be2498@linaro.org> In-Reply-To: <20241119-topic-sm8x50-gpu-bw-vote-v2-0-4deb87be2498@linaro.org> To: Akhil P Oommen , Viresh Kumar , Nishanth Menon , Stephen Boyd , "Rafael J. Wysocki" , Rob Clark , Sean Paul , Konrad Dybcio , Abhinav Kumar , Dmitry Baryshkov , Marijn Suijten , David Airlie , Simona Vetter , Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Connor Abbott , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2755; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=8YGZ9WKDiwlY9CXdycHEn+g53UomsCDyNV7cpV/GbpI=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBnPNFZkDlMgucCKOVG3spwNDcQZ0ZydMSrArihhW/Y vFgoe8OJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZzzRWQAKCRB33NvayMhJ0bjFD/ 9Mm8Si6vY3yrr2jLQmK9hIOxIo7VQGaygEeTkajDIJBFkFAFPQXGV5BNeb7ZEWXTXcNYlDIqs0qRb1 JOF/h1vPRq3pDdOEnG5JcF45su6IX9V935mkZDOhynF9D4dfaVySkMl8vSYI8PbBxLQSzj/vLcVd8o YGiWIm+8ZzZ5yT5UxZLeEeyjrBP5tOcyw6EmgiLf0snPQYsDadgXnpDO3+E71tmdcUHMsVGwJsEqTr g0uYhy3CsZK9eGEcyH3BvnjPQg2xP4ln6pEXC49Et1S9kpcpRzlZ6NPvBK5Li+TNX3GCL3eg3/ciUw 0x4TkUHAtlTQl2K7c/Ucm6rhadLnn8y86WWnlVepGCHZx1K3upgvczZbs/6mtob5xrp8xgfJWH/vbB BmTy+I6vhg+a9nle+Scw+KpcTF2L7UMam1Kiu4vKcXiniSHVO3GMwAp4845Mpc4PrwYiIofLS/0mUX zdMoAGfH8G7hzfQ/B4YNsXQAZ3cIuvC5XESP35Whkjtd635QbmeB6XFkhUrkofR6A8bY81WRuWltqP XuTJ4hq777J3vSZB/xSkBbj6T40vviF+j+CiwcJOLnja5qAYzgbmbi1jNRDstLj68//tK3vEU/gKW6 menmwvCUhLMg4vKU3j5zhTxgQRw3ZlwdCmTDWchXJnGvzssONP8cVOc1nQ/g== 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/ad= reno/a6xx_hfi.c index cb8844ed46b29c4569d05eb7a24f7b27e173190f..0c8aa9f8cabe1d9cb20445a4274= b728236a99fad 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_hfi.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_hfi.c @@ -621,6 +621,36 @@ static void a740_build_bw_table(struct a6xx_hfi_msg_bw= _table *msg) msg->cnoc_cmds_data[1][0] =3D 0x60000001; } =20 +static void a740_generate_bw_table(struct adreno_gpu *adreno_gpu, struct a= 6xx_gmu *gmu, + struct a6xx_hfi_msg_bw_table *msg) +{ + const struct a6xx_info *info =3D adreno_gpu->info->a6xx; + unsigned int i, j; + + msg->ddr_wait_bitmask =3D 0x7; + + for (i =3D 0; i < 3; i++) { + if (!info->bcm[i].name) + break; + msg->ddr_cmds_addrs[i] =3D cmd_db_read_addr(info->bcm[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_bw_votes[i][j]; + msg->bw_level_num =3D gmu->nr_gpu_bws; + + /* TODO also generate CNOC commands */ + + msg->cnoc_cmds_num =3D 1; + msg->cnoc_wait_bitmask =3D 0x1; + + msg->cnoc_cmds_addrs[0] =3D cmd_db_read_addr("CN0"); + msg->cnoc_cmds_data[0][0] =3D 0x40000000; + msg->cnoc_cmds_data[1][0] =3D 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 */ @@ -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 ((adreno_gpu->info->features & ADRENO_FEAT_GMU_BW_VOTE) && gmu->nr_gp= u_bws) + a740_generate_bw_table(adreno_gpu, gmu, msg); + else + a740_build_bw_table(msg); + } else a6xx_build_bw_table(msg); =20 gmu->bw_table =3D msg; --=20 2.34.1 From nobody Sat Nov 23 08:31:54 2024 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 0C5441D7984 for ; Tue, 19 Nov 2024 17:56:55 +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=1732039018; cv=none; b=cbQi4PObyv0vzqYpaJ8T0eIMpuMu05DnFO6KkhsmL4ykiaNmfkgDecrF0uMVYkdQGERJPb2iHJRQuK5sFElw7eROJwj4wetRkp1Rl3PJV49nEUG2oy3Mex8oikqss6N17aNzCkwLqoOtw3W1SelfUqCaIbXz7awSQhh7XsVUhYQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732039018; c=relaxed/simple; bh=c7fkpIfYHl8TuODfNcVaZw49taK0J/XE1pU9iIsovJs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hPJ6wha6tlvXx8V4K0ZIeou+wo5edM6ibZ4LhYw8KaKmfEBN+TKGDHGr/uEny8FdR963OP3Ivw43exT8/pIlvANRdLOIDTaE1/5AfohSwMNnNxEoosGxS2VKJyKksduOGzSj6mXrbWpN+Ujtdcd2Dfl6vcaj45PDbzsG63q2wuI= 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=DaJa/tmo; 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="DaJa/tmo" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-43193678216so11558415e9.0 for ; Tue, 19 Nov 2024 09:56:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732039014; x=1732643814; 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=wn5aQ1VZ2cxhVTPH7fiwE992qDBRsZA9HeBuSYk4nmE=; b=DaJa/tmohZv0R6UZTrw0vsybKNTW/TeCcdigCFEruzjJaZkUItrTomc/m2GN0Zf7kU xAGufy55rIJE1NR/Vix2jxU5BewxaNYPetbvC1yO6eCKM4Bw1PHc/EW4Lt9l+ObEk7kw 6dmAdYadugxH/vcEzLYbqnFGHDd0HDdxaCuk5aSGR9WKgfMQhDDyklkmn/ZPFAMcBcKT FPs9wHHpAAveuyz8CNiFLtxI1xex3HlY9VK/EqBJBlOJ8CK9zvhsIx5c7bFAVC9L1unj nPkDeukj3elOXnzebR7NvJ+ArFf5HfQWzrC2YhiUoxhbiqPa10IQHz9Xf5w2hmJKNlf/ wxMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732039014; x=1732643814; 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=wn5aQ1VZ2cxhVTPH7fiwE992qDBRsZA9HeBuSYk4nmE=; b=nibIv3p5sVnn84c/33LnyFOy7k4hAwIjjUVLecza13SuxsDWoNiY4zqlxjqy5LvUAA 8gxgYW3cTgJiT4LIi2nud3o3JHwEb5nKWCef4NyaKNQUWchpOIxzOD59tn6ebZd9rkyP hSAEHQP+YLUvPgHGfWx4ULfI3Erm4oHFFwNdAsZ+MjndtwnbeqqR5A3GAV+uSXn6w3OW VRRxxNqjtf1sXLvytBzmztEKUpyHW6eLEjB5NqwSlLhFuuW9kXbSRn3itT+Wb8SqJuf6 6zeZ2HhU5Rulmcet8WG17iUsalRkYzOBtcepUnPJxujb/UGdEYTVf2Bb6w80P5Wpjqfu QBpw== X-Forwarded-Encrypted: i=1; AJvYcCUOpkW/NG4CQJPmL/9kVzLowKVh1o6jEFF/7132Y13vN5etlxYSoChe+7XV5adUmLpd8M2k/Sf2P/v4RAs=@vger.kernel.org X-Gm-Message-State: AOJu0Yw1PgU3niEafT20nMV4LIDgp4FA4uiCEhvMd+NINBr3FhjFlW/p 5ytbvi9McPWjH0odZSwLjfKe55KXbpHAuWFn3AbCcvqPJPLEQjELq4VCqLGxgV4= X-Google-Smtp-Source: AGHT+IGonSiK32KUAYzr3bXRvSM2l2jcCxpdauXS4D5r3lT1PjorSljA4zTM71dFsaYPCcA/f5gJEw== X-Received: by 2002:a05:6000:1789:b0:382:4a75:57f4 with SMTP id ffacd0b85a97d-3824a755bd4mr5956661f8f.56.1732039014255; Tue, 19 Nov 2024 09:56:54 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-432da27fe68sm208302275e9.24.2024.11.19.09.56.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Nov 2024 09:56:53 -0800 (PST) From: Neil Armstrong Date: Tue, 19 Nov 2024 18:56:42 +0100 Subject: [PATCH v2 07/11] 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: <20241119-topic-sm8x50-gpu-bw-vote-v2-7-4deb87be2498@linaro.org> References: <20241119-topic-sm8x50-gpu-bw-vote-v2-0-4deb87be2498@linaro.org> In-Reply-To: <20241119-topic-sm8x50-gpu-bw-vote-v2-0-4deb87be2498@linaro.org> To: Akhil P Oommen , Viresh Kumar , Nishanth Menon , Stephen Boyd , "Rafael J. Wysocki" , Rob Clark , Sean Paul , Konrad Dybcio , Abhinav Kumar , Dmitry Baryshkov , Marijn Suijten , David Airlie , Simona Vetter , Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Connor Abbott , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=4053; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=c7fkpIfYHl8TuODfNcVaZw49taK0J/XE1pU9iIsovJs=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBnPNFasiiUa76I7e45RA1Hi7Q21xQOjgCMFbyW66oO L9CsJWiJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZzzRWgAKCRB33NvayMhJ0U1ID/ 9TgCEMSBNEoWaJNnj7wI7ZeW8V0mFeGvJuZbG+m0iDktGvAgf48GWNp32l2ez1Ae2hlcTT/ipCedq+ KX3gG7jEthsl4UJK54VwuKNobkGuTWAUOGnEUJ4dmS48nGKzq1lGLAedYW09jAlP/VL8eU5DflyZ88 mVuTFgv1sUkArErC/hYLXIAJvS4XHrKWBlxjAOwD5ntq+/1QTN+DWdpeOcAx+DT/7/FKXAZGOntZoa TC+8v2VeBUaKdlkycdGOiW/ja5YhxzgyvGwA0GTu8Lx+/sAG9MPknUzrX/NX0odjFilaJwYaeD91QJ VSvWijltOjhC9zG7xwisx67iNp7n2zpYTWj+/E82teMa+Kg2cY3l1coBqf6E6Hz4u0Y9qOnzgkMc3S cY8X+Yfrz5ZoBB1fSYLbczhJC42JdHDn9Qxus6lDZaIXcPdhDJz+E/x0iQ/WfIx57FEFpAaIxf/8iW WZFDvnqaOf82kMr1Z00A+fQuaEkstUEs106qjUmzVtj5Z5snqph8WXr4UrlRNe8lHGga4/xO/tJHAZ prZ4OHjmO8VDlSxaLHXk18wbA5vNavwpG4twgbMpkI4wMLCZB0D65lNfxe6cj7zFwIYIkSogwJx9zO Mai061ny1cuNbLBBAjIf02c91+tWBreDcn5/cDa528U2c/yNNf/UIFtcyPhg== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE The Adreno GMU 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. 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 Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 17 +++++++++++++++-- drivers/gpu/drm/msm/adreno/a6xx_gmu.h | 2 +- drivers/gpu/drm/msm/adreno/a6xx_hfi.c | 6 +++--- 3 files changed, 19 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 f6814d92a4edb29ba8a34a34aabb8b2324e9c6a4..dc2d0035544e7848e5c4ea27f1e= a9a191f9c4991 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c @@ -113,6 +113,7 @@ void a6xx_gmu_set_freq(struct msm_gpu *gpu, struct dev_= pm_opp *opp, 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 +126,16 @@ 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 ((adreno_gpu->info->features & ADRENO_FEAT_GMU_BW_VOTE) && gmu->nr_gpu= _bws) { + 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; + } + } + gmu->current_perf_index =3D perf_index; gmu->freq =3D gmu->gpu_freqs[perf_index]; =20 @@ -140,8 +151,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 03603eadc0f9ed866899c95e99f333a511ebc3c1..a42cdd0261872a08033a368af14= 34492c075b3fd 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.h +++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.h @@ -207,7 +207,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, int perf_index, int 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 0c8aa9f8cabe1d9cb20445a4274b728236a99fad..2d8e144e3453b30e7d3a22c9252= e516763c39b83 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_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, int freq_index, int 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); --=20 2.34.1 From nobody Sat Nov 23 08:31:54 2024 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 2D43C1D7E42 for ; Tue, 19 Nov 2024 17:56:57 +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=1732039020; cv=none; b=LDCncyraLpZFruSYQSdrOy4hVB2jbdO2uNzBwns/PPrGLlWBlebpM6ObmbbYcXk42F1qOXEA1Yjnzg0OKL6iFtOMO/7hXjUUbHNkhwfB8jJyLpWg8vGg4jQXrKTYLfaHYFD5Ed2t17+AVSlaZw+9l4WbaD5EyeaPP3MWGZnd2Kg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732039020; c=relaxed/simple; bh=oXkj1C6Jx8yUMHy3C9MjrWlRZXnbo4AjWBLbi4B14uI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tbJf/d5TvLFIxaFwTHVkh9EHQquGO6QIbom7KqgdsmpDYUs/rhnevTAzWOhiPIcQ1dG4IsY+YiHckBl7htA6Tp1NaGeH4noek5FOkNaScMnObQouCPcSFXIZkwpCK4lo3yToZ4szc0sru8PiMYbXdSVan9l+iQb3q/Y6sPUKgFY= 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=llnqIwk7; 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="llnqIwk7" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-431481433bdso41410915e9.3 for ; Tue, 19 Nov 2024 09:56:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732039015; x=1732643815; 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=hjXGo5viMHe7/zGLjLLL+XFyV/IDG+n2c4d5eIBcvfQ=; b=llnqIwk7DU3RTRv7MSKnlSi/i7tOPCL3LYfgntzbVxQacf0+DJlpmwOAHcTYzLLN6z qo9kDDZBbGfM4XFsOkitwY8f5JmGNq183FsW1q+diSJTp1X/qABXMUjo8feaWgT5mYRZ SWUxYFT7Qc1fE+Ue5fg9ZKsByPSGD8mOdV4kxpL8gGSTvMaLaGMUY5NhUd0JdnXCLukG kEc8iOoBTpuvFHC+dHvdCXC9xk74xrASsTQ/GsQqw/SEWnZt9Rjgh94Eo4wb+DajLAVs BCYj3k6aSHMB7JrUAWrx/NRUKc2nEqZp0Rlhkh6B6BBpodlPtKH7cb3aU1MfO2T49U8o +0CA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732039015; x=1732643815; 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=hjXGo5viMHe7/zGLjLLL+XFyV/IDG+n2c4d5eIBcvfQ=; b=ESXJX2fi9MuMhDXowIOrV6acj/+iW7nlPb6zxDjKEVDVVOWmbPsXg8tvMTg25C42Wy TO9hNG4H6BV82n53QM6R1smKOw1Tps19uqfsoALdKS2y59M9ynrj0c90390cGGYezxTg D/OM7vDEpnrYvlcVQaUMqtpqK+iNuukzBz+BIgaPLc/yCugGGC6kqPVWAl17BFwwaf0C IpeG2LOhEbtB8DmlnYNKfIoNL9PjNpVGY+4vJncMXC4lHQrdijM3Y/cJUO2Ww4PDKNff 7BsNiQKExPmoLk+h6auR70r3bpxU+eYwyJwbyOBa0ikPHa9ifRPZ0JV2akHKG0f36Bdx o+XQ== X-Forwarded-Encrypted: i=1; AJvYcCVKqVQQ2gaUBq4PwJIa/eBzWgiNRGmD5U23ib4GLaMEJ3SJR+pLcvjyCosUxFLEdvPC/sKiVx4EbuPBU/M=@vger.kernel.org X-Gm-Message-State: AOJu0Yy1K/0VKNdz3+ZiyJDNEhwspMqqWXB3aIazfyjWM9zszoNOK5JM prnqewgKQ/NWtn/A9BAdPghiWOiOo1Hd6AjEPDJqWMlKqUMqe5a4ieVjAgGD+6w= X-Google-Smtp-Source: AGHT+IETH0Hm2buMkvy/Ll4++F3Vi1yZx/qAIhcIkteGjWjEm1IVZlr1JHBK3iJywT3czzSrxctNNg== X-Received: by 2002:a05:600c:3491:b0:431:58bc:ad5e with SMTP id 5b1f17b1804b1-432df7901femr123471485e9.28.1732039015397; Tue, 19 Nov 2024 09:56:55 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-432da27fe68sm208302275e9.24.2024.11.19.09.56.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Nov 2024 09:56:55 -0800 (PST) From: Neil Armstrong Date: Tue, 19 Nov 2024 18:56:43 +0100 Subject: [PATCH v2 08/11] drm/msm: adreno: request for maximum bus bandwidth usage 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: <20241119-topic-sm8x50-gpu-bw-vote-v2-8-4deb87be2498@linaro.org> References: <20241119-topic-sm8x50-gpu-bw-vote-v2-0-4deb87be2498@linaro.org> In-Reply-To: <20241119-topic-sm8x50-gpu-bw-vote-v2-0-4deb87be2498@linaro.org> To: Akhil P Oommen , Viresh Kumar , Nishanth Menon , Stephen Boyd , "Rafael J. Wysocki" , Rob Clark , Sean Paul , Konrad Dybcio , Abhinav Kumar , Dmitry Baryshkov , Marijn Suijten , David Airlie , Simona Vetter , Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Connor Abbott , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1851; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=oXkj1C6Jx8yUMHy3C9MjrWlRZXnbo4AjWBLbi4B14uI=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBnPNFaHpmsc8d0QhqhvhKQzuhIHbOW/nweLHVI4J4K yOvheo2JAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZzzRWgAKCRB33NvayMhJ0a6wD/ wMgXLGer+Gwmpc2QXN/wUIVfxGxIJekwSowXEGKXdUnynbp8xruE7XqMXPRugx8J70wKaRkPVIDBAq YlvzhmgygfqOd99bB4cxv/m+LhYaB/sqeIpGxXxIFg9JUTmOww07+g5wSg8uS6g4x/6m/AE1QW6inw 6Vi/BiDDegOqKGTC04oXy/3wuJGJkjx/hLAsfoQnmKO6rNLc7nlepQN+a86EgENOC9uP5dWo51XxiH Qcw0D+UEhPz7Sywxlxx7/x7hYR42vAQ9XIZE6df2tJtl+qSn5RqVSdnuk+VpVOZeN5GLzycCdaAQZZ +BpzDDGet1cB9RPKolF1+3rtxHRPKGaf44xlgrXdngpLlCDX3feji1t2DqUyVLy26qj+wBGcF3yC62 5zcZUam9IXez+ZA6dmDUpWQ8bDHDUN8pH/tnJQ5NxqC5H2AUPhl6X7UgH1GVhn4wBI6oACdLFbfRLS cMR6fJTddxi7KPzvhhZo+GYeEA1oP/PnjjCSPMzGW/h+tSi/RVAGm5s/NBp+sO//57MwUqIIcmMYhO 74L35njgwh0bb2h+YhE8Sbonu83uTFPWOvTov/B+Qp8FRQOiZkHZnmAgPO6L5jvzvJUZhLOTrl/Tda bmMyLXaUOA/pQYp//Bky30nqQHwALOEFRZJO8MR5XVxt+ciFfsVHs8vCb7uQ== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE When requesting a DDR bandwidth level along a GPU frequency level via the GMU, we can also specify the bus bandwidth usage in a 16bit quantitized value. For now simply request the maximum bus usage. Signed-off-by: Neil Armstrong --- drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 11 +++++++++++ drivers/gpu/drm/msm/adreno/a6xx_hfi.h | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/ad= reno/a6xx_gmu.c index dc2d0035544e7848e5c4ea27f1ea9a191f9c4991..36c0f67fd8e109aabf09a0804ba= cbed3593c39d7 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c @@ -134,6 +134,17 @@ void a6xx_gmu_set_freq(struct msm_gpu *gpu, struct dev= _pm_opp *opp, if (bw =3D=3D gmu->gpu_bw_table[bw_index]) break; } + + if (bw_index) { + /* + * Append AB vote to the maximum bus usage. + * AB represents a quantitized 16bit value of the + * max ddr bandwidth we could use, let's simply + * request the maximum for now. + */ + bw_index |=3D AB_VOTE(MAX_AB_VOTE); + bw_index |=3D AB_VOTE_ENABLE; + } } =20 gmu->current_perf_index =3D perf_index; 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 Sat Nov 23 08:31:54 2024 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 23F1D1D86D2 for ; Tue, 19 Nov 2024 17:56:57 +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=1732039020; cv=none; b=Joyq1XG6FJuGqNOhvaGoNOz7ogo28QW3Gx66/7eTe6Qo7iy4H/aadOmQ2jH7384Qhp4HaGDZ5dP9YQDoDM5Qb+uI3vck2a0luQ/qrkX+TsFF+OlupgvH4dUnpDYbezJUpaTDbWFWJAOdHixeFz0e/cXbkZGNnupXOOdq3cFYKt4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732039020; c=relaxed/simple; bh=L856afxfFYTrzTjleMcDff0M5LSJvcUyglLdt4As0hg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=fPtjT3mvO0wR1zIco3HnAkOSs5AEaMLSHWlqe9vBmWap1IVZ+f7MXSY80E6MZISFTVblJYlKl62uSBcSDksbkSLTOYtbdkZgXfl49UciPi2R73ncnGJKrUt0NzXr8DbOFRp3q+MBtDnRGWV8JtkOcKsidKV0SN6ccyEntUsV5LQ= 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=ZBNKVA5f; 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="ZBNKVA5f" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-4319399a411so11382835e9.2 for ; Tue, 19 Nov 2024 09:56:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732039016; x=1732643816; 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=5sOdhCwiSh3xkI7uU9B1Lb49u97b/k8HIRiPISm4XY8=; b=ZBNKVA5f4Lu1HQgZkEWNOeRFCq6Va0unQq0hfRCjR5PO4bNsdS1lC7eRbnSl0Wn8O0 ee1sWPLHNujMA+TGN3qPFlKZ28VkcmtCUXGCdflmKy2klD0JUvAHjxAJNbrr6rl3rtym f5GINNFSBs2OiNeNCR5ESEszQ9M4ITzu6bSNSoyU5kHNhW9GywHheZ3CfjIOUoszCNCA kDaN5XgHDGIlUA8LDbS6H/qu4c+XfHm8ILh+O8+wSw8ZoT76H+VQGvehJ0ECdJT6UEy/ fjSBLZsuur10JHWAJ7j4mGCl38GpyDqOXBOY15KvwLc7ROuzfwvbW9xAYoekG2v8H0kc B8Qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732039016; x=1732643816; 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=5sOdhCwiSh3xkI7uU9B1Lb49u97b/k8HIRiPISm4XY8=; b=TsAW8EiYOUBdoAve1SF9dHhmlX3VdVTdLNjLovMiCpZ6rp4dGQRw49CIcQNi3ONr+D yjgZRArVaiW7vXtQEdFw0KthDB+sPC7SxqEMYrt3u7YEG7qgfAiBCzzqz0eFK1gfFjko 6WbFRx11lqxxetSltEmjM0LCPtY6ifaKs9HHcEjKgpp3s78wMPFhoe8cMKLkpSU+VrJw clkcYyXHWKGBAfj3+1RhMsAigmk06RNKCCn0VipPEUCFk4Ji16MZHoF5Iepjmk+mWbHa 3M9mA50ZBnBRgabNQM68KnCteu9KUzaYHdu4Ft2XocwA+hbmg3yJ3Q0LWFV8+O8b/teI BO1w== X-Forwarded-Encrypted: i=1; AJvYcCVVGq7fDgwzw/qRJFISn3SjsjFB8sT1Ci05z6rvIBvUdtcKyJS5IPe/1nrj/abiCfUt23kgL69Q/XUOxPE=@vger.kernel.org X-Gm-Message-State: AOJu0Yxrpw/icLLpvXWlNchILILIl4ZBnq0qgUCov9eU1GYIYNEKEAl7 tqSqy5FcUsRuZ+L8X594mGaUCxXdg5pT6yDT6BER/ZftbIwNEYb+W41R/Prag60= X-Google-Smtp-Source: AGHT+IHApaxnzvnBHMhgfGhZ0ZVtiOtON2gIMaKaToPdOP4xBZY1h1uuKuZxErPzNHlrhhyIABadNw== X-Received: by 2002:a5d:6484:0:b0:382:3e51:4b1d with SMTP id ffacd0b85a97d-3823e514deamr7632572f8f.20.1732039016495; Tue, 19 Nov 2024 09:56:56 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-432da27fe68sm208302275e9.24.2024.11.19.09.56.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Nov 2024 09:56:56 -0800 (PST) From: Neil Armstrong Date: Tue, 19 Nov 2024 18:56:44 +0100 Subject: [PATCH v2 09/11] 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: <20241119-topic-sm8x50-gpu-bw-vote-v2-9-4deb87be2498@linaro.org> References: <20241119-topic-sm8x50-gpu-bw-vote-v2-0-4deb87be2498@linaro.org> In-Reply-To: <20241119-topic-sm8x50-gpu-bw-vote-v2-0-4deb87be2498@linaro.org> To: Akhil P Oommen , Viresh Kumar , Nishanth Menon , Stephen Boyd , "Rafael J. Wysocki" , Rob Clark , Sean Paul , Konrad Dybcio , Abhinav Kumar , Dmitry Baryshkov , Marijn Suijten , David Airlie , Simona Vetter , Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Connor Abbott , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2528; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=L856afxfFYTrzTjleMcDff0M5LSJvcUyglLdt4As0hg=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBnPNFaONQvWVA4bP4yQAg2u1VE2uFOJH4JqIlyKjuL E+b5cDeJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZzzRWgAKCRB33NvayMhJ0QTMD/ 9Ym4y6wn5ANBhacJSlVGVq+pieT1LNiuwmZiuqSYT3/FAUZxjXIcuGnBVPWROkU8WG/7Ea0BV6zx7G GaAg7kVOc6fwaAXUEgidaO+BO0d/C6XjOF75YoaVwNzEQ632acKIeBWDCPnPKv58KD+Nqw/LQTpl+2 Pl+4ZitIKwP5OlbelgcghCk+KiNxKPRxpiOi4OXJeJPLGh2eAKQCWQae7uSKmHofFvSefqK3+3DIlJ HBQpyNslSFCzh5BZ/CPPCBfyc+rNP7TYAxZHT3EbolVv2Ti8Q2PuAcFJcKHVjZKAsQU5TB/y1Hikhx 3900PeUp1zuXz+LiCiACvsOKvnDAQAEsHUtMwEj6rSyUdixVbGCZHOsCpCMxtfeVyxm/A7b7R96CNN xCIkhzd//K64UKDkLx/oARBg/KC5TWNblhqNWee2XVrc2civdB1OWbFWSk2mt6J8S2/TL6h17/Vb9v vJl1D4wrMkfcsQ+48D6qY8vzG4BYACQGe3qw7xXqmgaj24pHeBPGfRMTI5/3obZsMIzHSAWzenpqDT EccOZwyzZtuPN2FJzDiPPdkiqoQV82UdKrsyKgNjS6l9NYraZ+Pwc/G9njaCkRkMW8OSHPGulWOj3O 8QmSiYESfdbe44ubCXHV1PNcAlfkTHDA1s/n1O9Q4+qzWx0rV5ujJhUziC8Q== 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 | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_catalog.c b/drivers/gpu/drm/ms= m/adreno/a6xx_catalog.c index 93f0d4bf50ba773ecde93e6c29a2fcec24ebb7b3..7cb96d524f76df67c6ee4377827= a38384c1b343a 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_catalog.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_catalog.c @@ -1379,7 +1379,8 @@ static const struct adreno_info a7xx_gpus[] =3D { .inactive_period =3D DRM_MSM_INACTIVE_PERIOD, .features =3D ADRENO_FEAT_HAS_CACHED_COHERENT | ADRENO_FEAT_HAS_HW_APRIV | - ADRENO_FEAT_PREEMPTION, + ADRENO_FEAT_PREEMPTION | + ADRENO_FEAT_GMU_BW_VOTE, .init =3D a6xx_gpu_init, .zapfw =3D "a740_zap.mdt", .a6xx =3D &(const struct a6xx_info) { @@ -1388,6 +1389,16 @@ static const struct adreno_info a7xx_gpus[] =3D { .pwrup_reglist =3D &a7xx_pwrup_reglist, .gmu_chipid =3D 0x7020100, .gmu_cgc_mode =3D 0x00020202, + .bcm =3D { + [0] =3D { .name =3D "SH0", .buswidth =3D 16 }, + [1] =3D { .name =3D "MC0", .buswidth =3D 4 }, + [2] =3D { + .name =3D "ACV", + .fixed =3D true, + .perfmode =3D BIT(3), + .perfmode_bw =3D 16500000, + }, + }, }, .address_space_size =3D SZ_16G, .preempt_record_size =3D 4192 * SZ_1K, @@ -1424,7 +1435,8 @@ static const struct adreno_info a7xx_gpus[] =3D { .inactive_period =3D DRM_MSM_INACTIVE_PERIOD, .features =3D ADRENO_FEAT_HAS_CACHED_COHERENT | ADRENO_FEAT_HAS_HW_APRIV | - ADRENO_FEAT_PREEMPTION, + ADRENO_FEAT_PREEMPTION | + ADRENO_FEAT_GMU_BW_VOTE, .init =3D a6xx_gpu_init, .zapfw =3D "gen70900_zap.mbn", .a6xx =3D &(const struct a6xx_info) { @@ -1432,6 +1444,16 @@ static const struct adreno_info a7xx_gpus[] =3D { .pwrup_reglist =3D &a7xx_pwrup_reglist, .gmu_chipid =3D 0x7090100, .gmu_cgc_mode =3D 0x00020202, + .bcm =3D { + [0] =3D { .name =3D "SH0", .buswidth =3D 16 }, + [1] =3D { .name =3D "MC0", .buswidth =3D 4 }, + [2] =3D { + .name =3D "ACV", + .fixed =3D true, + .perfmode =3D BIT(2), + .perfmode_bw =3D 10687500, + }, + }, }, .address_space_size =3D SZ_16G, .preempt_record_size =3D 3572 * SZ_1K, --=20 2.34.1 From nobody Sat Nov 23 08:31:54 2024 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 1A14E1D3567 for ; Tue, 19 Nov 2024 17:56:58 +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=1732039021; cv=none; b=ZSrrFfgvX7f3fSZ/L0P7mxQ9NFmNErF4uCi0Me+19fK0uoD5ZJpCFYyuq+LvITky8XQMeV47vm8fJ71o7yPBLv0x3QMydfnLjv1UiuLfHaO3P0zTmQacbVyi0k9jpMtH2Nk2p8NkFRk0k0G6ItTkN6pTtYjgZOsdcztY45hlqVA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732039021; c=relaxed/simple; bh=xTy0814t50k26n3IdWEnCW6RpXe9FNt3pkGR9JMo8Wo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WIMu22Xnyq5FMOjh6OCFi2GJnIb4bXonJJkr8QX0SnaYlly0OvOaLCwpXQKnmhzEZISGcqE32Y4u2gqyXAAj8Q/R5LWeuzhFkanoRp2SFanrauJx0jPZdjCj0pFy0RfeDoNzBWnUQH2dH7MeofxQ5RHh5AL1RcdqTVo05f7Ivko= 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=ami6pZiz; 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="ami6pZiz" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-43163667f0eso30885495e9.0 for ; Tue, 19 Nov 2024 09:56:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732039017; x=1732643817; 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=9QLp1s6RunFlEIPDGsvb0lHzi+DB0IAKSMWyP0xL4Qc=; b=ami6pZizYYug6inMcS9g+gW7sbkXUWmX01xO9L9jYxk21sMfWqPX9Jfsjg2VCLyPXN B9FXC/L8TfKUby3KDD4idVuQNIurRrvCRilW7mwLzL2o4IRnDsmjTx4tQm2mlNKpftWE ykdvzZgq3r6kvYzMypFLgCh1UyjDD86Q5TPiUoV7uy2eqmJF3ADyv2iwypRutRedfzP3 EN0XNFYJx2ElTGzpdn6EeZbWA31/BkfgTnyd4KnU8TzSbVM3gevqP/RUI1+gB2SdehFW J5LohhClJqnZnmX4fjg3qrtPwXOZ1g+3qhJbIv5NvtMUV9AhWWD/6i5B4Mawz2l02v67 Cnyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732039017; x=1732643817; 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=9QLp1s6RunFlEIPDGsvb0lHzi+DB0IAKSMWyP0xL4Qc=; b=Nl2V7xHJSjqlrX/ufVDhQaKnvYiG0Zsue+LKxEqLqYeHBNVfJGKMM5tVE0VjLXGXMM 59MACY2kEhJGHiqFBRQA50VKzhxRoReEWFZGMejlW5vV7ufUHSgDZTUVoEG769bbVSw+ qdoAQrHUv/tcy+XRAl5YdTzWXSCFbuD1p+krAZsVZ3B/cvdA5dYoICwJmB38hS2BYf4A MBZAwLF0yh5ux6kvSWjIl/JJtC3NjE8MV8X5EyHJgVlTkNloJ1pxx17EQqJld+nXLSV1 +RQplp///UdLNJH03x6gwuTJMC74jEsIqe7WKAfEyNYrZm1JH3+IuLSnwUkYK3BGSGiS irAw== X-Forwarded-Encrypted: i=1; AJvYcCUUiaPHuVIvQXj2kV0dFufIx2CPnLaYmDWUef+70o+psB8jmMLPxXV0Yg3fFaIfrydcTasLZp5ZfNO5mSE=@vger.kernel.org X-Gm-Message-State: AOJu0YxBh2haTVDjMpbj0UL5OT+U4jvhEkBfBmv99GX4y2RMVhac/NIb dQYUKb0z9kIwmFEdV95bxKlmebdiF7v9fws4q0xXhcikAuRyCU5UeRo4jmOTy7I= X-Google-Smtp-Source: AGHT+IGVsBGgDLeziU/OzjRWtYuWJehF5iLVaaBSNw6aG2zEDYNlB3n01ca6GHiJX62rmk6DiM4//g== X-Received: by 2002:a05:600c:4f06:b0:431:5533:8f0b with SMTP id 5b1f17b1804b1-432df78e7demr126208745e9.32.1732039017561; Tue, 19 Nov 2024 09:56:57 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-432da27fe68sm208302275e9.24.2024.11.19.09.56.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Nov 2024 09:56:57 -0800 (PST) From: Neil Armstrong Date: Tue, 19 Nov 2024 18:56:45 +0100 Subject: [PATCH v2 10/11] 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: <20241119-topic-sm8x50-gpu-bw-vote-v2-10-4deb87be2498@linaro.org> References: <20241119-topic-sm8x50-gpu-bw-vote-v2-0-4deb87be2498@linaro.org> In-Reply-To: <20241119-topic-sm8x50-gpu-bw-vote-v2-0-4deb87be2498@linaro.org> To: Akhil P Oommen , Viresh Kumar , Nishanth Menon , Stephen Boyd , "Rafael J. Wysocki" , Rob Clark , Sean Paul , Konrad Dybcio , Abhinav Kumar , Dmitry Baryshkov , Marijn Suijten , David Airlie , Simona Vetter , Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Connor Abbott , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.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=xTy0814t50k26n3IdWEnCW6RpXe9FNt3pkGR9JMo8Wo=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBnPNFbd07WfUX+D3DO8S9DCJmtm3fmLCUXBbP0PPX5 yQHxYC6JAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZzzRWwAKCRB33NvayMhJ0dxhD/ 0eLXNGnWTLn0HhT5yDPUlg/ODVerSk5fLn5D0uGYbMNd6xHehmhMi7HzPEVFIlHAqzm0mbVZ8aXz3U xV7/qI2EAkv70rCMw9s269YKLo4UBvAc5DL0pflSy+gJaMeEPH3pCpCoRzVahSWTnYnfKEbUDTLaHV sO13U/ZkaHm4B3RCHbdglvwFS9kRz5Snqw/kXBzvsFTWhJfO25VsGiGE3iiWOtN3t8mKq19B59WCK1 aMzFlsensMqpdXOMPihgc3TkDXleatgpi6n+p/shVsUeyrxLvLp0LSxI0fiUCB3k/JDK/MiR4nKNeJ 9d9YgeuCEaPajGFk/H1MsfJ8HjjxPQhfLzrNcd51u+dJxlOOSqLXdWAfNDJFvqJWLd28yUSBeclw3j iGerbFp9eGbfn2PNDJgA73NmDT/e81goHVXesCs00ET40y5TPrcvq+PN1hZ6H4gYId4QVmNioMIu7Q cvFagAEBfgItx/18KTFIxatu6J8x/f4ZSetvCgU3e3tUgrHi5m2Av4bMoZkjn7pVnlycEXq2+bAbVy L8Pc8dHEGHh0+EZPumH9bYKCUiv85Odas2Mg7k0HrYcSRGIULlh7XMhc7j8Bi+o+KQLwc35xsj2+Pn eKCapM6aujBfwjSimn9B4NP0SvuYrtbyAe+AjnBKhhEEu3q6wf0JpwBD0LWA== 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/qco= m/sm8550.dtsi index 9dc0ee3eb98f8711e01934e47331b99e3bb73682..808dce3a624197d38222f53fffa= 280e63088c1c1 100644 --- a/arch/arm64/boot/dts/qcom/sm8550.dtsi +++ b/arch/arm64/boot/dts/qcom/sm8550.dtsi @@ -2113,6 +2113,9 @@ gpu: gpu@3d00000 { qcom,gmu =3D <&gmu>; #cooling-cells =3D <2>; =20 + interconnects =3D <&gem_noc MASTER_GFX3D 0 &mc_virt SLAVE_EBI1 0>; + interconnect-names =3D "gfx-mem"; + status =3D "disabled"; =20 zap-shader { @@ -2126,41 +2129,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 Sat Nov 23 08:31:54 2024 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (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 79CFC1D9591 for ; Tue, 19 Nov 2024 17:57:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732039023; cv=none; b=aiO2ZOFGlKxKk2vTsaNld4GRXIP/i3TutO8FUQo/lHnUKJLF5j6pXAKuduGoEwdf2Kvhmxp4Xm+16JMbSCav+F1NTkmR022IcQemovwMtUyMDYIq3VJ1rfxHJiyeQUpYk3nzp8JQTSt3Vpc4sp/vo8JeZjQGNCTOrjwP7H9D23I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732039023; c=relaxed/simple; bh=kMBG33vo/TOc40mVibFxMI9MiLmVj3cBO8HFx/GtxHk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=fVItw+pIWXGIUY6//0N9iUzZS8eMoiX41fyVBcdnqz8mGjSZai7fRFvWWpTqBw5VkcU0SaAA4IOTSzSQmvS5iBNE9moPtSAHeXbsafpA9YBadDWAOxVor9c413p2v4gzJ1hHwgi6dGtCDJPZ54q20CVYA0Bo8KjXS/Io0gKteBY= 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=q6xG3nad; arc=none smtp.client-ip=209.85.128.52 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="q6xG3nad" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-431548bd1b4so30755515e9.3 for ; Tue, 19 Nov 2024 09:57:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732039018; x=1732643818; 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=gHpOD3kUgP0NZgNkpxEn7+M6CVhgca5HnhadSgnc1wM=; b=q6xG3nadyd5V+SEMvb4T3EEI6lXl7JmViz1HK2dPPkDTSMPX1yh+wwHHmcfs4sX1ga ravHF4jAYoVnFsGfw19Lg3MKHDZpu0wWQoNrV0/ples/GxdHplyAEwkemDUugkqGpJ38 Ufo9k6gJ7LWtonagMMxdtDQmn0JO6EYRwctTtM3dbzSP/pQ5ovJB/qPcg4Wbcqja72Gy CJyyxXE43k7aZFEMIe8tXUBEroCEc01MvV3dRNuPlfaRhQpJtCZKHtao0+Dv6jvq1IY7 GCrfBJDJ1DUapaXb/HM+sAKNhttp2tmOPOlrV4/BVGvBPiJxqwVKH6vy100AAiyuTkct nu4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732039018; x=1732643818; 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=gHpOD3kUgP0NZgNkpxEn7+M6CVhgca5HnhadSgnc1wM=; b=AbFSVO6efLYY8//cJm+NGLTNAI/MCshVTcdIOXX5YkWZqj9w9pnnqfXyedFqx75YcT dam0SFe+eQLUdpxapp662OEwaAVqac7V8slYAQA/Gku4ri4B0SCl0ZCwui8vOze58BqQ eF24ko3461s6CLo4PCKCXsdkD6JpmNoW17bgXhKwBd3IATSni6U8W3bHxLBDLvvJv+S4 W+0gnCXtF57Yq5rR4lUILybmxpOKcYp7LwMgQVrPifAobgKh4oWCuxAVkDqtPV4MVxXL 5/wsF6433zlf6NO/4DPv/HM/6vpSQcSRVHWMhVTC1mFws90ksoNui2NZh6KcRWpR0nAN 5Apg== X-Forwarded-Encrypted: i=1; AJvYcCXAV0lOY+6tExWXlXttZKxy8HHTLl9Yumk5m3pVQ9CorrS2L43xR8/zM+DLifpXjz6r2S2EDQPMWw/FywA=@vger.kernel.org X-Gm-Message-State: AOJu0YyCCQe6H4ezRYNeiQlSOi7yFq+Uuv40COa55zM10yOlRwwdLxTF aKkwjxtBrshy8p8ezZef3vGaESS73r/eamzSnnLzHoBY65Qagoo+V928E8RAP0s= X-Google-Smtp-Source: AGHT+IFPDNX6KLXFLn/SU6zrsFO0OInhb1Q9wiuJ7LRR3o8jd+59g6Yz543jn9+v12PfjDHzMkSYog== X-Received: by 2002:a05:600c:3111:b0:431:5c7b:e937 with SMTP id 5b1f17b1804b1-432df74c8bdmr168114705e9.17.1732039018583; Tue, 19 Nov 2024 09:56:58 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-432da27fe68sm208302275e9.24.2024.11.19.09.56.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Nov 2024 09:56:58 -0800 (PST) From: Neil Armstrong Date: Tue, 19 Nov 2024 18:56:46 +0100 Subject: [PATCH v2 11/11] 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: <20241119-topic-sm8x50-gpu-bw-vote-v2-11-4deb87be2498@linaro.org> References: <20241119-topic-sm8x50-gpu-bw-vote-v2-0-4deb87be2498@linaro.org> In-Reply-To: <20241119-topic-sm8x50-gpu-bw-vote-v2-0-4deb87be2498@linaro.org> To: Akhil P Oommen , Viresh Kumar , Nishanth Menon , Stephen Boyd , "Rafael J. Wysocki" , Rob Clark , Sean Paul , Konrad Dybcio , Abhinav Kumar , Dmitry Baryshkov , Marijn Suijten , David Airlie , Simona Vetter , Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Connor Abbott , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.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=kMBG33vo/TOc40mVibFxMI9MiLmVj3cBO8HFx/GtxHk=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBnPNFbEK25BwtwTu1JMvsqoiBYwcvGuuHxuWkwKltH JiltqguJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZzzRWwAKCRB33NvayMhJ0SqJD/ 9i9oT1zcWnuyY+2ojc3JgiG8RZ8/za1lypAPHpIoWVyEqom9FIhYIr5FQhaBl8JzvTyLgD5dWllI46 xxzzMukeW1ktiB/KPRpfA/qz1LbqwExPkNQVl8ruAMbqBYXAUVPHxmlYxEkD0WuUga+D/CX9Xik71k EENR+lA4BtGV7oMNCM1bQ1ov1HNA2p3jmOY7Km2JYzI0lzXkuwskSHjiN1B6wDVtQgdBfU2SJK2gTS mxXzExfxB9VsQDtMgcy9ejIRVoidE9NeFJUYAbTflhXprqiPS08t6S6FoVv6lIA/l6cQPprydHYCGL Jj7gxQv6t1+boECssBZUnNCqepbKsacMzl+b4KJ8RPrOaE9xJMvVMIwvJWlBhyzSqCVCBVEU3dGnzk O/bOXlwFhF4bWgUR+Qu/VTw7QvCQ6JGkY66Mn9mp2Vyx646XSu/L/tCYvP5j70I8k7gg2RlPJKjSWq 4U0AX/V3yGRATzqzGJMvvWraXnglSRW0OVivH9GCNMsGpbdpz5oUWi3KOyHyE+l2p6anawxBOGxx2J ZhkTaJCDFFiNapDGgPEpDSsj+j0KXa3TIR/G5IL3zC7ZFigY3hFKs0q4+cvAg9LCE106xwAem7Qvd1 UsfFkATgF/Hg9N4PH2GzIJYmYirtoOjIshEu/UTgSZhQiBWYSMcV0yqVUm3g== 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/qco= m/sm8650.dtsi index 01ac3769ffa62ffb83c5c51878e2823e1982eb67..331c5140c16bf013190d6da136c= 0920009d2646b 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 =3D <&gmu>; #cooling-cells =3D <2>; =20 + interconnects =3D <&gem_noc MASTER_GFX3D 0 &mc_virt SLAVE_EBI1 0>; + interconnect-names =3D "gfx-mem"; + status =3D "disabled"; =20 zap-shader { @@ -2649,56 +2652,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