Skip to contentSkip to conversation

Add support for GPU DDR BW scaling

PATCH Superseded Sharat Masetty 7 participants 23 messages May 14, 2020 – May 28, 2020

Subsystems (10)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#1 lore raw

PATCH 1/6 arm64: dts: qcom: sc7180: Add interconnect bindings for GPU

In reply to Sharat Masetty

This patch adds the interconnect bindings to the GPU node. This enables the GPU->DDR path bandwidth voting.

---
 arch/arm64/boot/dts/qcom/sc7180.dtsi | 2 ++
 1 file changed, 2 insertions(+)
arch/arm64/boot/dts/qcom/sc7180.dtsi +2 -0
index b46ee78..0ce9921 100644
@@ -1384,6 +1384,8 @@
 			operating-points-v2 = <&gpu_opp_table>;
 			qcom,gmu = <&gmu>;
 
+			interconnects = <&gem_noc MASTER_GFX3D &mc_virt SLAVE_EBI1>;
+
 			gpu_opp_table: opp-table {
 				compatible = "operating-points-v2";
 

--
2.7.4
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#0 lore raw

cover Add support for GPU DDR BW scaling

This is a rework of my previous series [1], but this time based on the bindings from Georgi [2] + a few fixes which look to be fixed in v8 of Georgi's series [3]. The work is based on the chromeOS tip.

[1]: https://patchwork.freedesktop.org/series/75291/
[2]: https://lore.kernel.org/patchwork/cover/1230626/
[3]: https://lore.kernel.org/patchwork/cover/1240687/

Sharat Masetty (5):
arm64: dts: qcom: sc7180: Add interconnect bindings for GPU
arm64: dts: qcom: sc7180: Add opp-peak-kBps to GPU opp
drm: msm: a6xx: send opp instead of a frequency
drm: msm: a6xx: use dev_pm_opp_set_bw to set DDR bandwidth
dt-bindings: drm/msm/gpu: Document gpu opp table

Sibi Sankar (1):
OPP: Add and export helper to set bandwidth

 .../devicetree/bindings/display/msm/gpu.txt        | 28 +++++++++
 arch/arm64/boot/dts/qcom/sc7180.dtsi               |  9 +++
 drivers/gpu/drm/msm/adreno/a6xx_gmu.c              | 68 +++++++++++-----------
 drivers/gpu/drm/msm/adreno/a6xx_gpu.h              |  2 +-
 drivers/gpu/drm/msm/msm_gpu.c                      |  3 +-
 drivers/gpu/drm/msm/msm_gpu.h                      |  3 +-
 drivers/opp/core.c                                 | 43 ++++++++++++++
 include/linux/pm_opp.h                             |  6 ++
 8 files changed, 125 insertions(+), 37 deletions(-)

--
2.7.4

#5 lore raw

PATCH 3/6 OPP: Add and export helper to set bandwidth

From: Sibi Sankar <[email protected]>

Add and export 'dev_pm_opp_set_bw' to set the bandwidth levels associated with an OPP for a given frequency.

---
 drivers/opp/core.c     | 43 +++++++++++++++++++++++++++++++++++++++++++
 include/linux/pm_opp.h |  6 ++++++
 2 files changed, 49 insertions(+)
drivers/opp/core.c +43 -0
index f42b7c4..0f34077 100644
@@ -828,6 +828,49 @@ static int _set_required_opps(struct device *dev,
 }
 
 /**
+ * dev_pm_opp_set_bw() - sets bandwidth levels corresponding to an available opp
+ * @dev:	device for which we do this operation
+ * @opp:	opp based on which the bandwidth levels are to be configured
+ *
+ * This configures the bandwidth to the levels specified
+ * by the OPP.
+ *
+ * Return: 0 on success or a negative error value.
+ */
+int dev_pm_opp_set_bw(struct device *dev, struct dev_pm_opp *opp)
+{
+	struct opp_table *opp_table;
+	int ret = -EINVAL;
+	int i;
+
+	if (IS_ERR_OR_NULL(opp) || !opp->available) {
+		dev_err(dev, "%s: Invalid parameters\n", __func__);
+		return -EINVAL;
+	}
+
+	opp_table = _find_opp_table(dev);
+	if (IS_ERR(opp_table)) {
+		dev_err(dev, "%s: device opp table doesn't exist\n", __func__);
+		return PTR_ERR(opp_table);
+	}
+
+	if (opp_table->paths) {
+		for (i = 0; i < opp_table->path_count; i++) {
+			ret = icc_set_bw(opp_table->paths[i],
+					 opp->bandwidth[i].avg,
+					 opp->bandwidth[i].peak);
+			if (ret)
+				dev_err(dev, "Failed to set bandwidth[%d]: %d\n",
+					i, ret);
+		}
+	}
+
+	dev_pm_opp_put_opp_table(opp_table);
+	return ret;
+}
+EXPORT_SYMBOL_GPL(dev_pm_opp_set_bw);
+
+/**
  * dev_pm_opp_set_rate() - Configure new OPP based on frequency
  * @dev:	 device for which we do this operation
  * @target_freq: frequency to achieve
include/linux/pm_opp.h +6 -0
index 76f8c6b..04f7fda 100644
@@ -156,6 +156,7 @@ struct dev_pm_opp *dev_pm_opp_xlate_opp(struct opp_table *src_table,
 					struct opp_table *dst_table,
 					struct dev_pm_opp *src_opp);
 int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq);
+int dev_pm_opp_set_bw(struct device *dev, struct dev_pm_opp *opp);
 int dev_pm_opp_set_sharing_cpus(struct device *cpu_dev, const struct cpumask *cpumask);
 int dev_pm_opp_get_sharing_cpus(struct device *cpu_dev, struct cpumask *cpumask);
 void dev_pm_opp_remove_table(struct device *dev);
@@ -354,6 +355,11 @@ static inline int dev_pm_opp_set_rate(struct device *dev, unsigned long target_f
 	return -ENOTSUPP;
 }
 
+static inline int dev_pm_opp_set_bw(struct device *dev, struct dev_pm_opp *opp)
+{
+	return -ENOTSUPP;
+}
+
 static inline int dev_pm_opp_set_sharing_cpus(struct device *cpu_dev, const struct cpumask *cpumask)
 {
 	return -ENOTSUPP;

--
2.7.4

#3 lore raw

PATCH 2/6 arm64: dts: qcom: sc7180: Add opp-peak-kBps to GPU opp

In reply to Sharat Masetty

Add opp-peak-kBps bindings to the GPU opp table, listing the peak GPU -> DDR bandwidth requirement for each opp level. This will be used to scale the DDR bandwidth along with the GPU frequency dynamically.

---
 arch/arm64/boot/dts/qcom/sc7180.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm64/boot/dts/qcom/sc7180.dtsi +7 -0
index 0ce9921..89f7767 100644
@@ -1392,36 +1392,43 @@
 				opp-800000000 {
 					opp-hz = /bits/ 64 <800000000>;
 					opp-level = <RPMH_REGULATOR_LEVEL_TURBO>;
+					opp-peak-kBps = <8532000>;
 				};
 
 				opp-650000000 {
 					opp-hz = /bits/ 64 <650000000>;
 					opp-level = <RPMH_REGULATOR_LEVEL_NOM_L1>;
+					opp-peak-kBps = <7216000>;
 				};
 
 				opp-565000000 {
 					opp-hz = /bits/ 64 <565000000>;
 					opp-level = <RPMH_REGULATOR_LEVEL_NOM>;
+					opp-peak-kBps = <5412000>;
 				};
 
 				opp-430000000 {
 					opp-hz = /bits/ 64 <430000000>;
 					opp-level = <RPMH_REGULATOR_LEVEL_SVS_L1>;
+					opp-peak-kBps = <5412000>;
 				};
 
 				opp-355000000 {
 					opp-hz = /bits/ 64 <355000000>;
 					opp-level = <RPMH_REGULATOR_LEVEL_SVS>;
+					opp-peak-kBps = <3072000>;
 				};
 
 				opp-267000000 {
 					opp-hz = /bits/ 64 <267000000>;
 					opp-level = <RPMH_REGULATOR_LEVEL_LOW_SVS>;
+					opp-peak-kBps = <3072000>;
 				};
 
 				opp-180000000 {
 					opp-hz = /bits/ 64 <180000000>;
 					opp-level = <RPMH_REGULATOR_LEVEL_MIN_SVS>;
+					opp-peak-kBps = <1804000>;
 				};
 			};
 		};

--
2.7.4

#20 lore raw

PATCH 6/6 dt-bindings: drm/msm/gpu: Document gpu opp table

In reply to Sharat Masetty

Update documentation to list the gpu opp table bindings including the newly added "opp-peak-kBps" needed for GPU-DDR bandwidth scaling.

---
 .../devicetree/bindings/display/msm/gpu.txt        | 28 ++++++++++++++++++++++
 1 file changed, 28 insertions(+)
Documentation/devicetree/bindings/display/msm/gpu.txt +28 -0
index 70025cb..48bd4ab 100644
@@ -79,6 +79,34 @@ Example a6xx (with GMU):
 
 		interconnects = <&rsc_hlos MASTER_GFX3D &rsc_hlos SLAVE_EBI1>;
 
+		gpu_opp_table: opp-table {
+			compatible = "operating-points-v2";
+
+			opp-430000000 {
+				opp-hz = /bits/ 64 <430000000>;
+				opp-level = <RPMH_REGULATOR_LEVEL_SVS_L1>;
+				opp-peak-kBps = <5412000>;
+			};
+
+			opp-355000000 {
+				opp-hz = /bits/ 64 <355000000>;
+				opp-level = <RPMH_REGULATOR_LEVEL_SVS>;
+				opp-peak-kBps = <3072000>;
+			};
+
+			opp-267000000 {
+				opp-hz = /bits/ 64 <267000000>;
+				opp-level = <RPMH_REGULATOR_LEVEL_LOW_SVS>;
+				opp-peak-kBps = <3072000>;
+			};
+
+			opp-180000000 {
+				opp-hz = /bits/ 64 <180000000>;
+				opp-level = <RPMH_REGULATOR_LEVEL_MIN_SVS>;
+				opp-peak-kBps = <1804000>;
+			};
+		};
+
 		qcom,gmu = <&gmu>;
 
 		zap-shader {

--
2.7.4

#7 lore raw

PATCH 4/6 drm: msm: a6xx: send opp instead of a frequency

In reply to Sharat Masetty

This patch changes the plumbing to send the devfreq recommended opp rather than the frequency. Also consolidate and rearrange the code in a6xx to set the GPU frequency and the icc vote in preparation for the upcoming changes for GPU->DDR scaling votes.

---
 drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 62 +++++++++++++++++++----------------
 drivers/gpu/drm/msm/adreno/a6xx_gpu.h |  2 +-
 drivers/gpu/drm/msm/msm_gpu.c         |  3 +-
 drivers/gpu/drm/msm/msm_gpu.h         |  3 +-
 4 files changed, 38 insertions(+), 32 deletions(-)
drivers/gpu/drm/msm/adreno/a6xx_gmu.c +34 -28
index 748cd37..2d8124b 100644
@@ -100,17 +100,30 @@ bool a6xx_gmu_gx_is_on(struct a6xx_gmu *gmu)
 		A6XX_GMU_SPTPRAC_PWR_CLK_STATUS_GX_HM_CLK_OFF));
 }
 
-static void __a6xx_gmu_set_freq(struct a6xx_gmu *gmu, int index)
+void a6xx_gmu_set_freq(struct msm_gpu *gpu, struct dev_pm_opp *opp)
 {
-	struct a6xx_gpu *a6xx_gpu = container_of(gmu, struct a6xx_gpu, gmu);
-	struct adreno_gpu *adreno_gpu = &a6xx_gpu->base;
-	struct msm_gpu *gpu = &adreno_gpu->base;
-	int ret;
+	struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
+	struct a6xx_gpu *a6xx_gpu = to_a6xx_gpu(adreno_gpu);
+	struct a6xx_gmu *gmu = &a6xx_gpu->gmu;
+	u32 perf_index;
+	unsigned long gpu_freq;
+	int ret = 0;
+
+	gpu_freq = dev_pm_opp_get_freq(opp);
+
+	if (gpu_freq == gmu->freq)
+		return;
+
+	for (perf_index = 0; perf_index < gmu->nr_gpu_freqs - 1; perf_index++)
+		if (gpu_freq == gmu->gpu_freqs[perf_index])
+			break;
+
+	gmu->current_perf_index = perf_index;
 
 	gmu_write(gmu, REG_A6XX_GMU_DCVS_ACK_OPTION, 0);
 
 	gmu_write(gmu, REG_A6XX_GMU_DCVS_PERF_SETTING,
-		((3 & 0xf) << 28) | index);
+			((3 & 0xf) << 28) | perf_index);
 
 	/*
 	 * Send an invalid index as a vote for the bus bandwidth and let the
@@ -126,7 +139,7 @@ static void __a6xx_gmu_set_freq(struct a6xx_gmu *gmu, int index)
 	if (ret)
 		dev_err(gmu->dev, "GMU set GPU frequency error: %d\n", ret);
 
-	gmu->freq = gmu->gpu_freqs[index];
+	gmu->freq = gmu->gpu_freqs[perf_index];
 
 	/*
 	 * Eventually we will want to scale the path vote with the frequency but
@@ -135,25 +148,6 @@ static void __a6xx_gmu_set_freq(struct a6xx_gmu *gmu, int index)
 	icc_set_bw(gpu->icc_path, 0, MBps_to_icc(7216));
 }
 
-void a6xx_gmu_set_freq(struct msm_gpu *gpu, unsigned long freq)
-{
-	struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
-	struct a6xx_gpu *a6xx_gpu = to_a6xx_gpu(adreno_gpu);
-	struct a6xx_gmu *gmu = &a6xx_gpu->gmu;
-	u32 perf_index = 0;
-
-	if (freq == gmu->freq)
-		return;
-
-	for (perf_index = 0; perf_index < gmu->nr_gpu_freqs - 1; perf_index++)
-		if (freq == gmu->gpu_freqs[perf_index])
-			break;
-
-	gmu->current_perf_index = perf_index;
-
-	__a6xx_gmu_set_freq(gmu, perf_index);
-}
-
 unsigned long a6xx_gmu_get_freq(struct msm_gpu *gpu)
 {
 	struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
@@ -708,6 +702,19 @@ static void a6xx_gmu_force_off(struct a6xx_gmu *gmu)
 	a6xx_gmu_rpmh_off(gmu);
 }
 
+static void a6xx_gmu_set_initial_freq(struct msm_gpu *gpu, struct a6xx_gmu *gmu)
+{
+	struct dev_pm_opp *gpu_opp;
+	unsigned long gpu_freq = gmu->gpu_freqs[gmu->current_perf_index];
+
+	gpu_opp = dev_pm_opp_find_freq_exact(&gpu->pdev->dev, gpu_freq, true);
+	if (IS_ERR_OR_NULL(gpu_opp))
+		return;
+
+	a6xx_gmu_set_freq(gpu, gpu_opp);
+	dev_pm_opp_put(gpu_opp);
+}
+
 int a6xx_gmu_resume(struct a6xx_gpu *a6xx_gpu)
 {
 	struct adreno_gpu *adreno_gpu = &a6xx_gpu->base;
@@ -759,8 +766,7 @@ int a6xx_gmu_resume(struct a6xx_gpu *a6xx_gpu)
 	gmu_write(gmu, REG_A6XX_GMU_GMU2HOST_INTR_MASK, ~A6XX_HFI_IRQ_MASK);
 	enable_irq(gmu->hfi_irq);
 
-	/* Set the GPU to the current freq */
-	__a6xx_gmu_set_freq(gmu, gmu->current_perf_index);
+	a6xx_gmu_set_initial_freq(gpu, gmu);
 
 	/*
 	 * "enable" the GX power domain which won't actually do anything but it
drivers/gpu/drm/msm/adreno/a6xx_gpu.h +1 -1
index 7239b8b..03ba60d 100644
@@ -63,7 +63,7 @@ void a6xx_gmu_clear_oob(struct a6xx_gmu *gmu, enum a6xx_gmu_oob_state state);
 int a6xx_gmu_init(struct a6xx_gpu *a6xx_gpu, struct device_node *node);
 void a6xx_gmu_remove(struct a6xx_gpu *a6xx_gpu);
 
-void a6xx_gmu_set_freq(struct msm_gpu *gpu, unsigned long freq);
+void a6xx_gmu_set_freq(struct msm_gpu *gpu, struct dev_pm_opp *opp);
 unsigned long a6xx_gmu_get_freq(struct msm_gpu *gpu);
 
 void a6xx_show(struct msm_gpu *gpu, struct msm_gpu_state *state,
drivers/gpu/drm/msm/msm_gpu.c +1 -2
index 18f3a5c..f703da0 100644
@@ -13,7 +13,6 @@
 
 #include <generated/utsrelease.h>
 #include <linux/string_helpers.h>
-#include <linux/pm_opp.h>
 #include <linux/devfreq.h>
 #include <linux/devcoredump.h>
 #include <linux/sched/task.h>
@@ -34,7 +33,7 @@ static int msm_devfreq_target(struct device *dev, unsigned long *freq,
 		return PTR_ERR(opp);
 
 	if (gpu->funcs->gpu_set_freq)
-		gpu->funcs->gpu_set_freq(gpu, (u64)*freq);
+		gpu->funcs->gpu_set_freq(gpu, opp);
 	else
 		clk_set_rate(gpu->core_clk, *freq);
 
drivers/gpu/drm/msm/msm_gpu.h +2 -1
index ab8f0f9c..cf0dc6d 100644
@@ -9,6 +9,7 @@
 
 #include <linux/clk.h>
 #include <linux/interconnect.h>
+#include <linux/pm_opp.h>
 #include <linux/regulator/consumer.h>
 
 #include "msm_drv.h"
@@ -63,7 +64,7 @@ struct msm_gpu_funcs {
 	struct msm_gpu_state *(*gpu_state_get)(struct msm_gpu *gpu);
 	int (*gpu_state_put)(struct msm_gpu_state *state);
 	unsigned long (*gpu_get_freq)(struct msm_gpu *gpu);
-	void (*gpu_set_freq)(struct msm_gpu *gpu, unsigned long freq);
+	void (*gpu_set_freq)(struct msm_gpu *gpu, struct dev_pm_opp *opp);
 };
 
 struct msm_gpu {

--
2.7.4
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#10 lore raw

PATCH 5/6 drm: msm: a6xx: use dev_pm_opp_set_bw to set DDR bandwidth

In reply to Sharat Masetty

This patches replaces the previously used static DDR vote and uses dev_pm_opp_set_bw() to scale GPU->DDR bandwidth along with scaling GPU frequency.

---
 drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/msm/adreno/a6xx_gmu.c +1 -5
index 2d8124b..79433d3 100644
@@ -141,11 +141,7 @@ void a6xx_gmu_set_freq(struct msm_gpu *gpu, struct dev_pm_opp *opp)
 
 	gmu->freq = gmu->gpu_freqs[perf_index];
 
-	/*
-	 * Eventually we will want to scale the path vote with the frequency but
-	 * for now leave it at max so that the performance is nominal.
-	 */
-	icc_set_bw(gpu->icc_path, 0, MBps_to_icc(7216));
+	dev_pm_opp_set_bw(&gpu->pdev->dev, opp);
 }
 
 unsigned long a6xx_gmu_get_freq(struct msm_gpu *gpu)

--
2.7.4

#2 lore raw

Re: [PATCH 1/6] arm64: dts: qcom: sc7180: Add interconnect bindings for GPU

In reply to Sharat Masetty

Hi Sharat,

Quoted 4 lines · Sharat Masetty

Subject: arm64: dts: qcom: sc7180: Add interconnect bindings for GPU

This patch adds the interconnect bindings to the GPU node. This enables the GPU->DDR path bandwidth voting.

This patch doesn't add any bindings, it adds the interconnects/interconnect configuration for the GPU

The order of the patches in this series is a bit odd. Typically you would start with the binding changes ("dt-bindings: drm/msm/gpu: Document gpu opp table" in this case), then the code needed to support these changes, and finally the DT bits for the specific devices/platforms making use of the new 'feature'.

It doesn't really matter once the series has landed since the end result is exactly the same, however it's the logical order in which most reviewers read your patches, and typically also the order in which the patches land (especially when multiple trees are involved).

Reviewed-by on v1 2/6
#4 lore raw

Re: [PATCH 2/6] arm64: dts: qcom: sc7180: Add opp-peak-kBps to GPU opp

In reply to Sharat Masetty
Quoted 1 line · Sharat Masetty

Subject: arm64: dts: qcom: sc7180: Add opp-peak-kBps to GPU opp

nit: s/opp/OPPs/

Quoted 27 lines

Add opp-peak-kBps bindings to the GPU opp table, listing the peak GPU -> DDR bandwidth requirement for each opp level. This will be used to scale the DDR bandwidth along with the GPU frequency dynamically.

---
 arch/arm64/boot/dts/qcom/sc7180.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm64/boot/dts/qcom/sc7180.dtsi +2 -0
index 0ce9921..89f7767 100644
@@ -1392,36 +1392,43 @@
 				opp-800000000 {
 					opp-hz = /bits/ 64 <800000000>;
 					opp-level = <RPMH_REGULATOR_LEVEL_TURBO>;
+					opp-peak-kBps = <8532000>;
 				};
 
 				opp-650000000 {
 					opp-hz = /bits/ 64 <650000000>;
 					opp-level = <RPMH_REGULATOR_LEVEL_NOM_L1>;
+					opp-peak-kBps = <7216000>;
 				};
 

arch/arm64/boot/dts/qcom/sc7180.dtsi line 1413

Quoted 10 lines
arch/arm64/boot/dts/qcom/sc7180.dtsi +2 -0
 				opp-565000000 {
 					opp-hz = /bits/ 64 <565000000>;
 					opp-level = <RPMH_REGULATOR_LEVEL_NOM>;
+					opp-peak-kBps = <5412000>;
 				};
 
 				opp-430000000 {
 					opp-hz = /bits/ 64 <430000000>;
 					opp-level = <RPMH_REGULATOR_LEVEL_SVS_L1>;
+					opp-peak-kBps = <5412000>;

I suppose it's intentional that the bandwidth is the same as for opp-565000000, just want to mention it for if it's a C&P error.

arch/arm64/boot/dts/qcom/sc7180.dtsi line 1426

Quoted 13 lines
arch/arm64/boot/dts/qcom/sc7180.dtsi +2 -0
 				};
 
 				opp-355000000 {
 					opp-hz = /bits/ 64 <355000000>;
 					opp-level = <RPMH_REGULATOR_LEVEL_SVS>;
+					opp-peak-kBps = <3072000>;
 				};
 
 				opp-267000000 {
 					opp-hz = /bits/ 64 <267000000>;
 					opp-level = <RPMH_REGULATOR_LEVEL_LOW_SVS>;
+					opp-peak-kBps = <3072000>;
 				};

ditto

arch/arm64/boot/dts/qcom/sc7180.dtsi line 1434

Quoted 7 lines
arch/arm64/boot/dts/qcom/sc7180.dtsi +1 -0
 				opp-180000000 {
 					opp-hz = /bits/ 64 <180000000>;
 					opp-level = <RPMH_REGULATOR_LEVEL_MIN_SVS>;
+					opp-peak-kBps = <1804000>;
 				};
 			};
 		};

assuming the repeated bandwidths are indeed intentional:

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#22 lore raw
In reply to Sharat Masetty
Quoted 1 line · Sharat Masetty

Subject: [PATCH 0/6] Add support for GPU DDR BW scaling

For anything but the first version the subject (for all patches) should include the version (i.e. [v2, 0/6], etc for this series).

Quoted 3 lines

This is a rework of my previous series [1], but this time based on the bindings from Georgi [2] + a few fixes which look to be fixed in v8 of Georgi's series [3]. The work is based on the chromeOS tip.

Chrome OS is irrelevant here, the series should be based on Linus' or one of the relevant maintainer trees (+ the patches it depends on). If it is actually based on the Chrome OS kernel tree (v5.4 I imagine) there will likely be conflicts which will make maintainers unhappy.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#6 lore raw

Re: [PATCH 3/6] OPP: Add and export helper to set bandwidth

In reply to Sharat Masetty
Quoted 4 lines · Sharat Masetty

From: Sibi Sankar <[email protected]>

Add and export 'dev_pm_opp_set_bw' to set the bandwidth levels associated with an OPP for a given frequency.

Wait, this looks very much like Sibi's patch from v4 of the "DDR/L3 Scaling support on SDM845 and SC7180 SoCs" series
(https://patchwork.kernel.org/patch/11527571/). Please don't repost patches from other series (unless the series/patch was clearly abandonded, which isn't the case here). Instead mention the patch as a dependency.

#8 lore raw

Re: [PATCH 4/6] drm: msm: a6xx: send opp instead of a frequency

In reply to Sharat Masetty
Quoted 4 lines · Sharat Masetty

This patch changes the plumbing to send the devfreq recommended opp rather than the frequency. Also consolidate and rearrange the code in a6xx to set the GPU frequency and the icc vote in preparation for the upcoming changes for GPU->DDR scaling votes.

Could this be relatively easily split in two patches, one passing the OPP instead of the frequency, and another doing the consolidation? It typically makes reviewing easier when logically unrelated changes are done in separate patches.

#9 lore raw

Re: [PATCH 4/6] drm: msm: a6xx: send opp instead of a frequency

Quoted 10 lines · Matthias Kaehlcke
Quoted 4 lines · Sharat Masetty

This patch changes the plumbing to send the devfreq recommended opp rather than the frequency. Also consolidate and rearrange the code in a6xx to set the GPU frequency and the icc vote in preparation for the upcoming changes for GPU->DDR scaling votes.

Could this be relatively easily split in two patches, one passing the OPP instead of the frequency, and another doing the consolidation? It typically makes reviewing easier when logically unrelated changes are done in separate patches.

After looking at the "upcoming changes for GPU->DDR scaling votes", which is essentially one line I'm doubting if the splitting would actually make sense. I'm now rather inclined to see "drm: msm: a6xx: use dev_pm_opp_set_bw to set DDR bandwidth" squashed into this patch.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#11 lore raw

Re: [PATCH 5/6] drm: msm: a6xx: use dev_pm_opp_set_bw to set DDR bandwidth

In reply to Sharat Masetty
Quoted 14 lines · Sharat Masetty

This patches replaces the previously used static DDR vote and uses dev_pm_opp_set_bw() to scale GPU->DDR bandwidth along with scaling GPU frequency.

---
 drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/msm/adreno/a6xx_gmu.c +0 -0
index 2d8124b..79433d3 100644

drivers/gpu/drm/msm/adreno/a6xx_gmu.c void a6xx_gmu_set_freq(struct msm_gpu *gpu, struct dev_pm_opp *opp) · line 144

Quoted 9 lines
drivers/gpu/drm/msm/adreno/a6xx_gmu.c +1 -5
@@ -141,11 +141,7 @@ void a6xx_gmu_set_freq(struct msm_gpu *gpu, struct dev_pm_opp *opp)
 
 	gmu->freq = gmu->gpu_freqs[perf_index];
 
-	/*
-	 * Eventually we will want to scale the path vote with the frequency but
-	 * for now leave it at max so that the performance is nominal.
-	 */
-	icc_set_bw(gpu->icc_path, 0, MBps_to_icc(7216));
+	dev_pm_opp_set_bw(&gpu->pdev->dev, opp);

Is there a particular reason to keep this one liner in a separate patch? I think it would make sense to squash it into "drm: msm: a6xx: send opp instead of a frequency" and change the subject of the combined patch to something like "drm: msm: a6xx: Scale the DDR bandwidth dynamically".

#12 lore raw

Re: [PATCH 5/6] drm: msm: a6xx: use dev_pm_opp_set_bw to set DDR bandwidth

In reply to Sharat Masetty
Quoted 14 lines · Sharat Masetty

This patches replaces the previously used static DDR vote and uses dev_pm_opp_set_bw() to scale GPU->DDR bandwidth along with scaling GPU frequency.

---
 drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/msm/adreno/a6xx_gmu.c +0 -0
index 2d8124b..79433d3 100644

drivers/gpu/drm/msm/adreno/a6xx_gmu.c void a6xx_gmu_set_freq(struct msm_gpu *gpu, struct dev_pm_opp *opp) · line 145

Quoted 10 lines
drivers/gpu/drm/msm/adreno/a6xx_gmu.c +1 -5
@@ -141,11 +141,7 @@ void a6xx_gmu_set_freq(struct msm_gpu *gpu, struct dev_pm_opp *opp)
 
 	gmu->freq = gmu->gpu_freqs[perf_index];
 
-	/*
-	 * Eventually we will want to scale the path vote with the frequency but
-	 * for now leave it at max so that the performance is nominal.
-	 */
-	icc_set_bw(gpu->icc_path, 0, MBps_to_icc(7216));
+	dev_pm_opp_set_bw(&gpu->pdev->dev, opp);
 }

This adds an implicit requirement that all targets need bandwidth settings defined in the OPP or they won't get a bus vote at all. I would prefer that there be an default escape valve but if not you'll need to add bandwidth values for the sdm845 OPP that target doesn't regress.

Jordan

Quoted 4 lines
drivers/gpu/drm/msm/adreno/a6xx_gmu.c +0 -1
 unsigned long a6xx_gmu_get_freq(struct msm_gpu *gpu)
--

2.7.4

Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
#13 lore raw

Re: [Freedreno] [PATCH 5/6] drm: msm: a6xx: use dev_pm_opp_set_bw to set DDR bandwidth

Quoted 19 lines · Jordan Crouse
Quoted 17 lines · Sharat Masetty

This patches replaces the previously used static DDR vote and uses dev_pm_opp_set_bw() to scale GPU->DDR bandwidth along with scaling GPU frequency.

---
 drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/msm/adreno/a6xx_gmu.c +0 -0
index 2d8124b..79433d3 100644
@@ -141,11 +141,7 @@ void a6xx_gmu_set_freq(struct msm_gpu *gpu, struct dev_pm_opp *opp)
 
      gmu->freq = gmu->gpu_freqs[perf_index];
 
Quoted 13 lines

drivers/gpu/drm/msm/adreno/a6xx_gmu.c void a6xx_gmu_set_freq(struct msm_gpu *gpu, struct dev_pm_opp *opp) · line 145

Quoted 7 lines
drivers/gpu/drm/msm/adreno/a6xx_gmu.c +1 -5
-     /*
-      * Eventually we will want to scale the path vote with the frequency but
-      * for now leave it at max so that the performance is nominal.
-      */
-     icc_set_bw(gpu->icc_path, 0, MBps_to_icc(7216));
+     dev_pm_opp_set_bw(&gpu->pdev->dev, opp);
 }

This adds an implicit requirement that all targets need bandwidth settings defined in the OPP or they won't get a bus vote at all. I would prefer that there be an default escape valve but if not you'll need to add bandwidth values for the sdm845 OPP that target doesn't regress.

it looks like we could maybe do something like:

  ret = dev_pm_opp_set_bw(...);
  if (ret) {
      dev_warn_once(dev, "no bandwidth settings");
      icc_set_bw(...);
  }

?

BR,
-R

Quoted 14 lines

Jordan

Quoted 4 lines
drivers/gpu/drm/msm/adreno/a6xx_gmu.c +0 -1
 unsigned long a6xx_gmu_get_freq(struct msm_gpu *gpu)
--

2.7.4

--
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
_______________________________________________
Freedreno mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/freedreno

#14 lore raw

Re: [Freedreno] [PATCH 5/6] drm: msm: a6xx: use dev_pm_opp_set_bw to set DDR bandwidth

+ more folks

Quoted 39 lines · Rob Clark
Quoted 18 lines · Jordan Crouse
Quoted 17 lines · Sharat Masetty

This patches replaces the previously used static DDR vote and uses dev_pm_opp_set_bw() to scale GPU->DDR bandwidth along with scaling GPU frequency.

---
  drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 6 +-----
  1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/msm/adreno/a6xx_gmu.c +0 -0
index 2d8124b..79433d3 100644
@@ -141,11 +141,7 @@ void a6xx_gmu_set_freq(struct msm_gpu *gpu, struct dev_pm_opp *opp)
 
       gmu->freq = gmu->gpu_freqs[perf_index];
 
Quoted 12 lines

drivers/gpu/drm/msm/adreno/a6xx_gmu.c void a6xx_gmu_set_freq(struct msm_gpu *gpu, struct dev_pm_opp *opp) · line 145

Quoted 7 lines
drivers/gpu/drm/msm/adreno/a6xx_gmu.c +1 -5
-     /*
-      * Eventually we will want to scale the path vote with the frequency but
-      * for now leave it at max so that the performance is nominal.
-      */
-     icc_set_bw(gpu->icc_path, 0, MBps_to_icc(7216));
+     dev_pm_opp_set_bw(&gpu->pdev->dev, opp);
  }

This adds an implicit requirement that all targets need bandwidth settings defined in the OPP or they won't get a bus vote at all. I would prefer that there be an default escape valve but if not you'll need to add bandwidth values for the sdm845 OPP that target doesn't regress.

it looks like we could maybe do something like:

   ret = dev_pm_opp_set_bw(...);
   if (ret) {
       dev_warn_once(dev, "no bandwidth settings");
       icc_set_bw(...);
   }
Quoted 4 lines

?

BR,
-R

There is a bit of an issue here - Looks like its not possible to two icc handles to the same path.  Its causing double enumeration of the paths in the icc core and messing up path votes. With [1] Since opp/core already gets a handle to the icc path as part of table add,  drm/msm could do either

a) Conditionally enumerate gpu->icc_path handle only when pm/opp core has not got the icc path handle. I could use something like [2] to determine if should initialize gpu->icc_path*

b) Add peak-opp-configs in 845 dt and mandate all future versions to use this bindings. With this, I can remove gpu->icc_path from msm/drm completely and only rely on opp/core for bw voting.

[1] - https://lore.kernel.org/patchwork/cover/1240687/

[2] - https://patchwork.kernel.org/patch/11527573/

Let me know your thoughts

Sharat

Quoted 14 lines
Quoted 14 lines

Jordan

Quoted 4 lines
drivers/gpu/drm/msm/adreno/a6xx_gmu.c +0 -1
  unsigned long a6xx_gmu_get_freq(struct msm_gpu *gpu)
--

2.7.4

--
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
_______________________________________________
Freedreno mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/freedreno

#15 lore raw

Re: [Freedreno] [PATCH 5/6] drm: msm: a6xx: use dev_pm_opp_set_bw to set DDR bandwidth

Quoted 54 lines · Sharat Masetty

+ more folks

Quoted 39 lines · Rob Clark
Quoted 18 lines · Jordan Crouse
Quoted 17 lines · Sharat Masetty

This patches replaces the previously used static DDR vote and uses dev_pm_opp_set_bw() to scale GPU->DDR bandwidth along with scaling GPU frequency.

---
  drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 6 +-----
  1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/msm/adreno/a6xx_gmu.c +0 -0
index 2d8124b..79433d3 100644
@@ -141,11 +141,7 @@ void a6xx_gmu_set_freq(struct msm_gpu *gpu, struct dev_pm_opp *opp)
 
       gmu->freq = gmu->gpu_freqs[perf_index];
 
Quoted 12 lines

drivers/gpu/drm/msm/adreno/a6xx_gmu.c void a6xx_gmu_set_freq(struct msm_gpu *gpu, struct dev_pm_opp *opp) · line 145

Quoted 7 lines
drivers/gpu/drm/msm/adreno/a6xx_gmu.c +1 -5
-     /*
-      * Eventually we will want to scale the path vote with the frequency but
-      * for now leave it at max so that the performance is nominal.
-      */
-     icc_set_bw(gpu->icc_path, 0, MBps_to_icc(7216));
+     dev_pm_opp_set_bw(&gpu->pdev->dev, opp);
  }

This adds an implicit requirement that all targets need bandwidth settings defined in the OPP or they won't get a bus vote at all. I would prefer that there be an default escape valve but if not you'll need to add bandwidth values for the sdm845 OPP that target doesn't regress.

it looks like we could maybe do something like:

   ret = dev_pm_opp_set_bw(...);
   if (ret) {
       dev_warn_once(dev, "no bandwidth settings");
       icc_set_bw(...);
   }
Quoted 4 lines

?

BR,
-R

There is a bit of an issue here - Looks like its not possible to two icc handles to the same path. Its causing double enumeration of the paths in the icc core and messing up path votes. With [1] Since opp/core already gets a handle to the icc path as part of table add, drm/msm could do either

Quoted 7 lines

a) Conditionally enumerate gpu->icc_path handle only when pm/opp core has not got the icc path handle. I could use something like [2] to determine if should initialize gpu->icc_path*

b) Add peak-opp-configs in 845 dt and mandate all future versions to use this bindings. With this, I can remove gpu->icc_path from msm/drm completely and only rely on opp/core for bw voting.

The main thing is that we want to make sure newer dtb always works on an older kernel without regression.. but, hmm.. I guess the interconnects/interconnects-names properties haven't landed yet in sdm845.dtsi? Maybe that lets us go with the simpler approach (b). Looks like we haven't wired up interconnect for 8916 or 8996 either, so probably we can just mandate this for all of them?

If we have landed the interconnect dts hookup for gpu somewhere that I'm overlooking, I guess we would have to go with (a) and keep the existing interconnects/interconnects-names properties.

BR,
-R

Quoted 22 lines

[1] - https://lore.kernel.org/patchwork/cover/1240687/

[2] - https://patchwork.kernel.org/patch/11527573/

Let me know your thoughts

Sharat

Quoted 14 lines
Quoted 14 lines

Jordan

Quoted 4 lines
drivers/gpu/drm/msm/adreno/a6xx_gmu.c +0 -1
  unsigned long a6xx_gmu_get_freq(struct msm_gpu *gpu)
--

2.7.4

--
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
_______________________________________________
Freedreno mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/freedreno

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#16 lore raw

Re: [Freedreno] [PATCH 5/6] drm: msm: a6xx: use dev_pm_opp_set_bw to set DDR bandwidth

Quoted 47 lines · Rob Clark
Quoted 45 lines · Sharat Masetty

+ more folks

Quoted 41 lines · Rob Clark
Quoted 18 lines · Jordan Crouse
Quoted 17 lines · Sharat Masetty

This patches replaces the previously used static DDR vote and uses dev_pm_opp_set_bw() to scale GPU->DDR bandwidth along with scaling GPU frequency.

---
  drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 6 +-----
  1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/msm/adreno/a6xx_gmu.c +0 -0
index 2d8124b..79433d3 100644
@@ -141,11 +141,7 @@ void a6xx_gmu_set_freq(struct msm_gpu *gpu, struct dev_pm_opp *opp)
 
       gmu->freq = gmu->gpu_freqs[perf_index];
 
Quoted 12 lines

drivers/gpu/drm/msm/adreno/a6xx_gmu.c void a6xx_gmu_set_freq(struct msm_gpu *gpu, struct dev_pm_opp *opp) · line 145

Quoted 7 lines
drivers/gpu/drm/msm/adreno/a6xx_gmu.c +1 -5
-     /*
-      * Eventually we will want to scale the path vote with the frequency but
-      * for now leave it at max so that the performance is nominal.
-      */
-     icc_set_bw(gpu->icc_path, 0, MBps_to_icc(7216));
+     dev_pm_opp_set_bw(&gpu->pdev->dev, opp);
  }

This adds an implicit requirement that all targets need bandwidth settings defined in the OPP or they won't get a bus vote at all. I would prefer that there be an default escape valve but if not you'll need to add bandwidth values for the sdm845 OPP that target doesn't regress.

it looks like we could maybe do something like:

   ret = dev_pm_opp_set_bw(...);
   if (ret) {
       dev_warn_once(dev, "no bandwidth settings");
       icc_set_bw(...);
   }

?

Quoted 8 lines
Quoted 8 lines
Quoted 2 lines

BR,
-R

There is a bit of an issue here - Looks like its not possible to two icc handles to the same path. Its causing double enumeration of the paths in the icc core and messing up path votes. With [1] Since opp/core already gets a handle to the icc path as part of table add, drm/msm could do either

Are you sure this is the real issue? I'd be surprised if this is a real limitation. And if it is, it either needs to be fixed in the ICC framework or OPP shouldn't be getting path handles by default (and maybe let the driver set the handles before using OPP APIs to change BW). I'd lean towards the former.

Quoted 3 lines
Quoted 3 lines

a) Conditionally enumerate gpu->icc_path handle only when pm/opp core has not got the icc path handle. I could use something like [2] to determine if should initialize gpu->icc_path*

This seems like a bandaid. Let's fix it correctly in ICC framework or OPP framework.

Quoted 3 lines
Quoted 3 lines

b) Add peak-opp-configs in 845 dt and mandate all future versions to use this bindings. With this, I can remove gpu->icc_path from msm/drm completely and only rely on opp/core for bw voting.

I don't know what you mean by "peak-opp-configs" but I guess you are referring to some kind of DT flag to say if you should vote for BW directly or use the OPP framework? If so, I'm pretty sure that won't fly. That's an OS implementation specific flag.

-Saravana

#17 lore raw

Re: [Freedreno] [PATCH 5/6] drm: msm: a6xx: use dev_pm_opp_set_bw to set DDR bandwidth

Quoted 57 lines · Saravana Kannan
Quoted 47 lines · Rob Clark
Quoted 45 lines · Sharat Masetty

+ more folks

Quoted 41 lines · Rob Clark
Quoted 18 lines · Jordan Crouse
Quoted 17 lines · Sharat Masetty

This patches replaces the previously used static DDR vote and uses dev_pm_opp_set_bw() to scale GPU->DDR bandwidth along with scaling GPU frequency.

---
  drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 6 +-----
  1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/msm/adreno/a6xx_gmu.c +0 -0
index 2d8124b..79433d3 100644
@@ -141,11 +141,7 @@ void a6xx_gmu_set_freq(struct msm_gpu *gpu, struct dev_pm_opp *opp)
 
       gmu->freq = gmu->gpu_freqs[perf_index];
 
Quoted 12 lines

drivers/gpu/drm/msm/adreno/a6xx_gmu.c void a6xx_gmu_set_freq(struct msm_gpu *gpu, struct dev_pm_opp *opp) · line 145

Quoted 7 lines
drivers/gpu/drm/msm/adreno/a6xx_gmu.c +1 -5
-     /*
-      * Eventually we will want to scale the path vote with the frequency but
-      * for now leave it at max so that the performance is nominal.
-      */
-     icc_set_bw(gpu->icc_path, 0, MBps_to_icc(7216));
+     dev_pm_opp_set_bw(&gpu->pdev->dev, opp);
  }

This adds an implicit requirement that all targets need bandwidth settings defined in the OPP or they won't get a bus vote at all. I would prefer that there be an default escape valve but if not you'll need to add bandwidth values for the sdm845 OPP that target doesn't regress.

it looks like we could maybe do something like:

   ret = dev_pm_opp_set_bw(...);
   if (ret) {
       dev_warn_once(dev, "no bandwidth settings");
       icc_set_bw(...);
   }

?

Quoted 8 lines
Quoted 8 lines
Quoted 2 lines

BR,
-R

There is a bit of an issue here - Looks like its not possible to two icc handles to the same path. Its causing double enumeration of the paths in the icc core and messing up path votes. With [1] Since opp/core already gets a handle to the icc path as part of table add, drm/msm could do either

Quoted 3 lines

Are you sure this is the real issue? I'd be surprised if this is a real limitation. And if it is, it either needs to be fixed in the ICC framework or OPP shouldn't be getting path handles by default (and

not really, this is already handled well
in the icc framework. In this case
the max peak vote would be considered
among the two paths.

Quoted 2 lines

maybe let the driver set the handles before using OPP APIs to change BW). I'd lean towards the former.

https://patchwork.kernel.org/patch/11573827/
Yes the core shouldn't get paths
by default unless the bw values
are specified in the opps.

Quoted 9 lines
Quoted 4 lines
Quoted 4 lines

a) Conditionally enumerate gpu->icc_path handle only when pm/opp core has not got the icc path handle. I could use something like [2] to determine if should initialize gpu->icc_path*

This seems like a bandaid. Let's fix it correctly in ICC framework or OPP framework.

Quoted 1 line
Quoted 1 line

b) Add peak-opp-configs in 845 dt and mandate all future versions to use

I can't understand ^^ proposal as well.
We would ideally want to add scaling
support for SDM845 as well while we are
at it.

Quoted 9 lines
Quoted 2 lines
Quoted 2 lines

this bindings. With this, I can remove gpu->icc_path from msm/drm completely and only rely on opp/core for bw voting.

I don't know what you mean by "peak-opp-configs" but I guess you are referring to some kind of DT flag to say if you should vote for BW directly or use the OPP framework? If so, I'm pretty sure that won't fly. That's an OS implementation specific flag.

-Saravana

Signature · 6 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#18 lore raw

Re: [Freedreno] [PATCH 5/6] drm: msm: a6xx: use dev_pm_opp_set_bw to set DDR bandwidth

In reply to Rob Clark
Quoted 70 lines · Rob Clark
Quoted 54 lines · Sharat Masetty

+ more folks

Quoted 39 lines · Rob Clark
Quoted 18 lines · Jordan Crouse
Quoted 17 lines · Sharat Masetty

This patches replaces the previously used static DDR vote and uses dev_pm_opp_set_bw() to scale GPU->DDR bandwidth along with scaling GPU frequency.

---
  drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 6 +-----
  1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/msm/adreno/a6xx_gmu.c +0 -0
index 2d8124b..79433d3 100644
@@ -141,11 +141,7 @@ void a6xx_gmu_set_freq(struct msm_gpu *gpu, struct dev_pm_opp *opp)
 
       gmu->freq = gmu->gpu_freqs[perf_index];
 
Quoted 12 lines

drivers/gpu/drm/msm/adreno/a6xx_gmu.c void a6xx_gmu_set_freq(struct msm_gpu *gpu, struct dev_pm_opp *opp) · line 145

Quoted 7 lines
drivers/gpu/drm/msm/adreno/a6xx_gmu.c +1 -5
-     /*
-      * Eventually we will want to scale the path vote with the frequency but
-      * for now leave it at max so that the performance is nominal.
-      */
-     icc_set_bw(gpu->icc_path, 0, MBps_to_icc(7216));
+     dev_pm_opp_set_bw(&gpu->pdev->dev, opp);
  }

This adds an implicit requirement that all targets need bandwidth settings defined in the OPP or they won't get a bus vote at all. I would prefer that there be an default escape valve but if not you'll need to add bandwidth values for the sdm845 OPP that target doesn't regress.

it looks like we could maybe do something like:

   ret = dev_pm_opp_set_bw(...);
   if (ret) {
       dev_warn_once(dev, "no bandwidth settings");
       icc_set_bw(...);
   }
Quoted 4 lines

?

BR,
-R

There is a bit of an issue here - Looks like its not possible to two icc handles to the same path. Its causing double enumeration of the paths in the icc core and messing up path votes. With [1] Since opp/core already gets a handle to the icc path as part of table add, drm/msm could do either

Quoted 7 lines

a) Conditionally enumerate gpu->icc_path handle only when pm/opp core has not got the icc path handle. I could use something like [2] to determine if should initialize gpu->icc_path*

b) Add peak-opp-configs in 845 dt and mandate all future versions to use this bindings. With this, I can remove gpu->icc_path from msm/drm completely and only rely on opp/core for bw voting.

The main thing is that we want to make sure newer dtb always works on an older kernel without regression.. but, hmm.. I guess the interconnects/interconnects-names properties haven't landed yet in sdm845.dtsi? Maybe that lets us go with the simpler approach (b). Looks like we haven't wired up interconnect for 8916 or 8996 either, so probably we can just mandate this for all of them?

Quoted 3 lines

If we have landed the interconnect dts hookup for gpu somewhere that I'm overlooking, I guess we would have to go with (a) and keep the existing interconnects/interconnects-names properties.

The main problem is that (on sdm845 at least) the path comes up with a very slow default so even if we don't do scaling we had to set _something_. Perhaps if we solved that problem somewhere else (inerconnect, rpmh?) then we wouldn't need to worry about it in the leaf driver unless the full opp tables are described.

Jordan

Quoted 25 lines

BR,
-R

Quoted 22 lines

[1] - https://lore.kernel.org/patchwork/cover/1240687/

[2] - https://patchwork.kernel.org/patch/11527573/

Let me know your thoughts

Sharat

Quoted 14 lines
Quoted 14 lines

Jordan

Quoted 4 lines
drivers/gpu/drm/msm/adreno/a6xx_gmu.c +0 -1
  unsigned long a6xx_gmu_get_freq(struct msm_gpu *gpu)
--

2.7.4

--
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
_______________________________________________
Freedreno mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/freedreno

Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
#19 lore raw

Re: [Freedreno] [PATCH 5/6] drm: msm: a6xx: use dev_pm_opp_set_bw to set DDR bandwidth

In reply to Rob Clark
Quoted 60 lines · Rob Clark
Quoted 52 lines · Sharat Masetty

+ more folks

Quoted 39 lines · Rob Clark
Quoted 18 lines · Jordan Crouse
Quoted 17 lines · Sharat Masetty

This patches replaces the previously used static DDR vote and uses dev_pm_opp_set_bw() to scale GPU->DDR bandwidth along with scaling GPU frequency.

---
   drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 6 +-----
   1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/msm/adreno/a6xx_gmu.c +0 -0
index 2d8124b..79433d3 100644
@@ -141,11 +141,7 @@ void a6xx_gmu_set_freq(struct msm_gpu *gpu, struct dev_pm_opp *opp)
 
        gmu->freq = gmu->gpu_freqs[perf_index];
 
Quoted 12 lines

drivers/gpu/drm/msm/adreno/a6xx_gmu.c void a6xx_gmu_set_freq(struct msm_gpu *gpu, struct dev_pm_opp *opp) · line 145

Quoted 7 lines
drivers/gpu/drm/msm/adreno/a6xx_gmu.c +1 -5
-     /*
-      * Eventually we will want to scale the path vote with the frequency but
-      * for now leave it at max so that the performance is nominal.
-      */
-     icc_set_bw(gpu->icc_path, 0, MBps_to_icc(7216));
+     dev_pm_opp_set_bw(&gpu->pdev->dev, opp);
   }

This adds an implicit requirement that all targets need bandwidth settings defined in the OPP or they won't get a bus vote at all. I would prefer that there be an default escape valve but if not you'll need to add bandwidth values for the sdm845 OPP that target doesn't regress.

it looks like we could maybe do something like:

    ret = dev_pm_opp_set_bw(...);
    if (ret) {
        dev_warn_once(dev, "no bandwidth settings");
        icc_set_bw(...);
    }
Quoted 4 lines

?

BR,
-R

There is a bit of an issue here - Looks like its not possible to two icc handles to the same path. Its causing double enumeration of the paths in the icc core and messing up path votes. With [1] Since opp/core already gets a handle to the icc path as part of table add, drm/msm could do either

Quoted 7 lines

a) Conditionally enumerate gpu->icc_path handle only when pm/opp core has not got the icc path handle. I could use something like [2] to determine if should initialize gpu->icc_path*

b) Add peak-opp-configs in 845 dt and mandate all future versions to use this bindings. With this, I can remove gpu->icc_path from msm/drm completely and only rely on opp/core for bw voting.

Quoted 6 lines

The main thing is that we want to make sure newer dtb always works on an older kernel without regression.. but, hmm.. I guess the interconnects/interconnects-names properties haven't landed yet in sdm845.dtsi? Maybe that lets us go with the simpler approach (b). Looks like we haven't wired up interconnect for 8916 or 8996 either, so probably we can just mandate this for all of them?

I checked all three 845, 820 and 8916 and none of them have the interconnect configs for GPU. So, I think we are good here. I'll go with option (b) and re-spin v3. Adding interconnects and opp-peak-kBps configs for previous chips can be taken up as a separate activity.

Sharat

Quoted 4 lines

If we have landed the interconnect dts hookup for gpu somewhere that I'm overlooking, I guess we would have to go with (a) and keep the existing interconnects/interconnects-names properties.

Quoted 24 lines

BR,
-R

Quoted 21 lines

[1] - https://lore.kernel.org/patchwork/cover/1240687/

[2] - https://patchwork.kernel.org/patch/11527573/

Let me know your thoughts

Sharat

Quoted 13 lines
Quoted 13 lines

Jordan

Quoted 4 lines
drivers/gpu/drm/msm/adreno/a6xx_gmu.c +0 -1
   unsigned long a6xx_gmu_get_freq(struct msm_gpu *gpu)
--

2.7.4

--
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
_______________________________________________
Freedreno mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/freedreno

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

maintainer Acked-by on v1 6/6
#21 lore raw

Re: [PATCH 6/6] dt-bindings: drm/msm/gpu: Document gpu opp table

In reply to Sharat Masetty
Quoted 8 lines · Sharat Masetty

Update documentation to list the gpu opp table bindings including the newly added "opp-peak-kBps" needed for GPU-DDR bandwidth scaling.

---
 .../devicetree/bindings/display/msm/gpu.txt        | 28 ++++++++++++++++++++++
 1 file changed, 28 insertions(+)

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel