All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH for-5.10.y+] drm/msm/dpu: always use mdp device to scale bandwidth
@ 2021-06-01 18:51 Amit Pundir
  2021-06-08 14:50 ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Amit Pundir @ 2021-06-01 18:51 UTC (permalink / raw)
  To: Greg KH; +Cc: Stable, Dmitry Baryshkov, Rob Clark

From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

[ Upstream commit a670ff578f1fb855fedc7931fa5bbc06b567af22 ]

Currently DPU driver scales bandwidth and core clock for sc7180 only,
while the rest of chips get static bandwidth votes. Make all chipsets
scale bandwidth and clock per composition requirements like sc7180 does.
Drop old voting path completely.

Tested on RB3 (SDM845) and RB5 (SM8250).

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20210401020533.3956787-2-dmitry.baryshkov@linaro.org
Signed-off-by: Rob Clark <robdclark@chromium.org>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
---
Fixes dpu_runtime_resume() WARN_ON, on db845c/RB3 (sdm845),
introduced by the backport of upstream commit 627dc55c273d
("drm/msm/disp/dpu1: icc path needs to be set before dpu
runtime resume") on v5.10.y.

Verified and smoke tested this fix on v5.12.y as well.

 drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c  |  3 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c | 51 +-----------------------
 2 files changed, 2 insertions(+), 52 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
index e69ea810e18d..c8217f4858a1 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
@@ -931,8 +931,7 @@ static int dpu_kms_hw_init(struct msm_kms *kms)
 		DPU_DEBUG("REG_DMA is not defined");
 	}
 
-	if (of_device_is_compatible(dev->dev->of_node, "qcom,sc7180-mdss"))
-		dpu_kms_parse_data_bus_icc_path(dpu_kms);
+	dpu_kms_parse_data_bus_icc_path(dpu_kms);
 
 	pm_runtime_get_sync(&dpu_kms->pdev->dev);
 
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c
index cd4078807db1..3416e9617ee9 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c
@@ -31,40 +31,8 @@ struct dpu_mdss {
 	void __iomem *mmio;
 	struct dss_module_power mp;
 	struct dpu_irq_controller irq_controller;
-	struct icc_path *path[2];
-	u32 num_paths;
 };
 
-static int dpu_mdss_parse_data_bus_icc_path(struct drm_device *dev,
-						struct dpu_mdss *dpu_mdss)
-{
-	struct icc_path *path0 = of_icc_get(dev->dev, "mdp0-mem");
-	struct icc_path *path1 = of_icc_get(dev->dev, "mdp1-mem");
-
-	if (IS_ERR_OR_NULL(path0))
-		return PTR_ERR_OR_ZERO(path0);
-
-	dpu_mdss->path[0] = path0;
-	dpu_mdss->num_paths = 1;
-
-	if (!IS_ERR_OR_NULL(path1)) {
-		dpu_mdss->path[1] = path1;
-		dpu_mdss->num_paths++;
-	}
-
-	return 0;
-}
-
-static void dpu_mdss_icc_request_bw(struct msm_mdss *mdss)
-{
-	struct dpu_mdss *dpu_mdss = to_dpu_mdss(mdss);
-	int i;
-	u64 avg_bw = dpu_mdss->num_paths ? MAX_BW / dpu_mdss->num_paths : 0;
-
-	for (i = 0; i < dpu_mdss->num_paths; i++)
-		icc_set_bw(dpu_mdss->path[i], avg_bw, kBps_to_icc(MAX_BW));
-}
-
 static void dpu_mdss_irq(struct irq_desc *desc)
 {
 	struct dpu_mdss *dpu_mdss = irq_desc_get_handler_data(desc);
@@ -178,8 +146,6 @@ static int dpu_mdss_enable(struct msm_mdss *mdss)
 	struct dss_module_power *mp = &dpu_mdss->mp;
 	int ret;
 
-	dpu_mdss_icc_request_bw(mdss);
-
 	ret = msm_dss_enable_clk(mp->clk_config, mp->num_clk, true);
 	if (ret) {
 		DPU_ERROR("clock enable failed, ret:%d\n", ret);
@@ -213,15 +179,12 @@ static int dpu_mdss_disable(struct msm_mdss *mdss)
 {
 	struct dpu_mdss *dpu_mdss = to_dpu_mdss(mdss);
 	struct dss_module_power *mp = &dpu_mdss->mp;
-	int ret, i;
+	int ret;
 
 	ret = msm_dss_enable_clk(mp->clk_config, mp->num_clk, false);
 	if (ret)
 		DPU_ERROR("clock disable failed, ret:%d\n", ret);
 
-	for (i = 0; i < dpu_mdss->num_paths; i++)
-		icc_set_bw(dpu_mdss->path[i], 0, 0);
-
 	return ret;
 }
 
@@ -232,7 +195,6 @@ static void dpu_mdss_destroy(struct drm_device *dev)
 	struct dpu_mdss *dpu_mdss = to_dpu_mdss(priv->mdss);
 	struct dss_module_power *mp = &dpu_mdss->mp;
 	int irq;
-	int i;
 
 	pm_runtime_suspend(dev->dev);
 	pm_runtime_disable(dev->dev);
@@ -242,9 +204,6 @@ static void dpu_mdss_destroy(struct drm_device *dev)
 	msm_dss_put_clk(mp->clk_config, mp->num_clk);
 	devm_kfree(&pdev->dev, mp->clk_config);
 
-	for (i = 0; i < dpu_mdss->num_paths; i++)
-		icc_put(dpu_mdss->path[i]);
-
 	if (dpu_mdss->mmio)
 		devm_iounmap(&pdev->dev, dpu_mdss->mmio);
 	dpu_mdss->mmio = NULL;
@@ -276,12 +235,6 @@ int dpu_mdss_init(struct drm_device *dev)
 
 	DRM_DEBUG("mapped mdss address space @%pK\n", dpu_mdss->mmio);
 
-	if (!of_device_is_compatible(dev->dev->of_node, "qcom,sc7180-mdss")) {
-		ret = dpu_mdss_parse_data_bus_icc_path(dev, dpu_mdss);
-		if (ret)
-			return ret;
-	}
-
 	mp = &dpu_mdss->mp;
 	ret = msm_dss_parse_clock(pdev, mp);
 	if (ret) {
@@ -307,8 +260,6 @@ int dpu_mdss_init(struct drm_device *dev)
 
 	pm_runtime_enable(dev->dev);
 
-	dpu_mdss_icc_request_bw(priv->mdss);
-
 	return ret;
 
 irq_error:
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH for-5.10.y+] drm/msm/dpu: always use mdp device to scale bandwidth
  2021-06-01 18:51 [PATCH for-5.10.y+] drm/msm/dpu: always use mdp device to scale bandwidth Amit Pundir
@ 2021-06-08 14:50 ` Greg KH
  0 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2021-06-08 14:50 UTC (permalink / raw)
  To: Amit Pundir; +Cc: Stable, Dmitry Baryshkov, Rob Clark

On Wed, Jun 02, 2021 at 12:21:37AM +0530, Amit Pundir wrote:
> From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> 
> [ Upstream commit a670ff578f1fb855fedc7931fa5bbc06b567af22 ]
> 
> Currently DPU driver scales bandwidth and core clock for sc7180 only,
> while the rest of chips get static bandwidth votes. Make all chipsets
> scale bandwidth and clock per composition requirements like sc7180 does.
> Drop old voting path completely.
> 
> Tested on RB3 (SDM845) and RB5 (SM8250).
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> Link: https://lore.kernel.org/r/20210401020533.3956787-2-dmitry.baryshkov@linaro.org
> Signed-off-by: Rob Clark <robdclark@chromium.org>
> Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
> ---
> Fixes dpu_runtime_resume() WARN_ON, on db845c/RB3 (sdm845),
> introduced by the backport of upstream commit 627dc55c273d
> ("drm/msm/disp/dpu1: icc path needs to be set before dpu
> runtime resume") on v5.10.y.
> 
> Verified and smoke tested this fix on v5.12.y as well.

Now queued up to both, thanks

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH for-5.10.y] drm/msm/dpu: always use mdp device to scale bandwidth
  2021-05-30 12:24 ` Greg KH
@ 2021-05-31  7:55   ` Amit Pundir
  0 siblings, 0 replies; 5+ messages in thread
From: Amit Pundir @ 2021-05-31  7:55 UTC (permalink / raw)
  To: Greg KH; +Cc: Stable, Dmitry Baryshkov, Rob Clark

On Sun, 30 May 2021 at 17:54, Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Fri, May 28, 2021 at 05:01:02PM +0530, Amit Pundir wrote:
> > From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> >
> > [ Upstream commit a670ff578f1fb855fedc7931fa5bbc06b567af22 ]
> >
> > Currently DPU driver scales bandwidth and core clock for sc7180 only,
> > while the rest of chips get static bandwidth votes. Make all chipsets
> > scale bandwidth and clock per composition requirements like sc7180 does.
> > Drop old voting path completely.
> >
> > Tested on RB3 (SDM845) and RB5 (SM8250).
> >
> > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> > Link: https://lore.kernel.org/r/20210401020533.3956787-2-dmitry.baryshkov@linaro.org
> > Signed-off-by: Rob Clark <robdclark@chromium.org>
> > Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
> > ---
> > Fixes dpu_runtime_resume() WARN_ON on db845c/RB3 (sdm845),
> > introduced by the backport of upstream commit 627dc55c273d
> > ("drm/msm/disp/dpu1: icc path needs to be set before dpu
> > runtime resume") on v5.10.y.
> >
> >  drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c  |  3 +-
> >  drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c | 51 +-----------------------
> >  2 files changed, 2 insertions(+), 52 deletions(-)
>
> What about a version of this for 5.12?  I can't take one for 5.10 and
> not a newer kernel, right?

My bad. I'll verify/smoke-test it on 5.12 as well and resubmit.

Regards,
Amit Pundir

>
> thanks,
>
> greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH for-5.10.y] drm/msm/dpu: always use mdp device to scale bandwidth
  2021-05-28 11:31 [PATCH for-5.10.y] " Amit Pundir
@ 2021-05-30 12:24 ` Greg KH
  2021-05-31  7:55   ` Amit Pundir
  0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2021-05-30 12:24 UTC (permalink / raw)
  To: Amit Pundir; +Cc: Stable, Dmitry Baryshkov, Rob Clark

On Fri, May 28, 2021 at 05:01:02PM +0530, Amit Pundir wrote:
> From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> 
> [ Upstream commit a670ff578f1fb855fedc7931fa5bbc06b567af22 ]
> 
> Currently DPU driver scales bandwidth and core clock for sc7180 only,
> while the rest of chips get static bandwidth votes. Make all chipsets
> scale bandwidth and clock per composition requirements like sc7180 does.
> Drop old voting path completely.
> 
> Tested on RB3 (SDM845) and RB5 (SM8250).
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> Link: https://lore.kernel.org/r/20210401020533.3956787-2-dmitry.baryshkov@linaro.org
> Signed-off-by: Rob Clark <robdclark@chromium.org>
> Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
> ---
> Fixes dpu_runtime_resume() WARN_ON on db845c/RB3 (sdm845),
> introduced by the backport of upstream commit 627dc55c273d
> ("drm/msm/disp/dpu1: icc path needs to be set before dpu
> runtime resume") on v5.10.y.
> 
>  drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c  |  3 +-
>  drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c | 51 +-----------------------
>  2 files changed, 2 insertions(+), 52 deletions(-)

What about a version of this for 5.12?  I can't take one for 5.10 and
not a newer kernel, right?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH for-5.10.y] drm/msm/dpu: always use mdp device to scale bandwidth
@ 2021-05-28 11:31 Amit Pundir
  2021-05-30 12:24 ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Amit Pundir @ 2021-05-28 11:31 UTC (permalink / raw)
  To: Greg KH; +Cc: Stable, Dmitry Baryshkov, Rob Clark

From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

[ Upstream commit a670ff578f1fb855fedc7931fa5bbc06b567af22 ]

Currently DPU driver scales bandwidth and core clock for sc7180 only,
while the rest of chips get static bandwidth votes. Make all chipsets
scale bandwidth and clock per composition requirements like sc7180 does.
Drop old voting path completely.

Tested on RB3 (SDM845) and RB5 (SM8250).

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20210401020533.3956787-2-dmitry.baryshkov@linaro.org
Signed-off-by: Rob Clark <robdclark@chromium.org>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
---
Fixes dpu_runtime_resume() WARN_ON on db845c/RB3 (sdm845),
introduced by the backport of upstream commit 627dc55c273d
("drm/msm/disp/dpu1: icc path needs to be set before dpu
runtime resume") on v5.10.y.

 drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c  |  3 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c | 51 +-----------------------
 2 files changed, 2 insertions(+), 52 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
index e69ea810e18d..c8217f4858a1 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
@@ -931,8 +931,7 @@ static int dpu_kms_hw_init(struct msm_kms *kms)
 		DPU_DEBUG("REG_DMA is not defined");
 	}
 
-	if (of_device_is_compatible(dev->dev->of_node, "qcom,sc7180-mdss"))
-		dpu_kms_parse_data_bus_icc_path(dpu_kms);
+	dpu_kms_parse_data_bus_icc_path(dpu_kms);
 
 	pm_runtime_get_sync(&dpu_kms->pdev->dev);
 
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c
index cd4078807db1..3416e9617ee9 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c
@@ -31,40 +31,8 @@ struct dpu_mdss {
 	void __iomem *mmio;
 	struct dss_module_power mp;
 	struct dpu_irq_controller irq_controller;
-	struct icc_path *path[2];
-	u32 num_paths;
 };
 
-static int dpu_mdss_parse_data_bus_icc_path(struct drm_device *dev,
-						struct dpu_mdss *dpu_mdss)
-{
-	struct icc_path *path0 = of_icc_get(dev->dev, "mdp0-mem");
-	struct icc_path *path1 = of_icc_get(dev->dev, "mdp1-mem");
-
-	if (IS_ERR_OR_NULL(path0))
-		return PTR_ERR_OR_ZERO(path0);
-
-	dpu_mdss->path[0] = path0;
-	dpu_mdss->num_paths = 1;
-
-	if (!IS_ERR_OR_NULL(path1)) {
-		dpu_mdss->path[1] = path1;
-		dpu_mdss->num_paths++;
-	}
-
-	return 0;
-}
-
-static void dpu_mdss_icc_request_bw(struct msm_mdss *mdss)
-{
-	struct dpu_mdss *dpu_mdss = to_dpu_mdss(mdss);
-	int i;
-	u64 avg_bw = dpu_mdss->num_paths ? MAX_BW / dpu_mdss->num_paths : 0;
-
-	for (i = 0; i < dpu_mdss->num_paths; i++)
-		icc_set_bw(dpu_mdss->path[i], avg_bw, kBps_to_icc(MAX_BW));
-}
-
 static void dpu_mdss_irq(struct irq_desc *desc)
 {
 	struct dpu_mdss *dpu_mdss = irq_desc_get_handler_data(desc);
@@ -178,8 +146,6 @@ static int dpu_mdss_enable(struct msm_mdss *mdss)
 	struct dss_module_power *mp = &dpu_mdss->mp;
 	int ret;
 
-	dpu_mdss_icc_request_bw(mdss);
-
 	ret = msm_dss_enable_clk(mp->clk_config, mp->num_clk, true);
 	if (ret) {
 		DPU_ERROR("clock enable failed, ret:%d\n", ret);
@@ -213,15 +179,12 @@ static int dpu_mdss_disable(struct msm_mdss *mdss)
 {
 	struct dpu_mdss *dpu_mdss = to_dpu_mdss(mdss);
 	struct dss_module_power *mp = &dpu_mdss->mp;
-	int ret, i;
+	int ret;
 
 	ret = msm_dss_enable_clk(mp->clk_config, mp->num_clk, false);
 	if (ret)
 		DPU_ERROR("clock disable failed, ret:%d\n", ret);
 
-	for (i = 0; i < dpu_mdss->num_paths; i++)
-		icc_set_bw(dpu_mdss->path[i], 0, 0);
-
 	return ret;
 }
 
@@ -232,7 +195,6 @@ static void dpu_mdss_destroy(struct drm_device *dev)
 	struct dpu_mdss *dpu_mdss = to_dpu_mdss(priv->mdss);
 	struct dss_module_power *mp = &dpu_mdss->mp;
 	int irq;
-	int i;
 
 	pm_runtime_suspend(dev->dev);
 	pm_runtime_disable(dev->dev);
@@ -242,9 +204,6 @@ static void dpu_mdss_destroy(struct drm_device *dev)
 	msm_dss_put_clk(mp->clk_config, mp->num_clk);
 	devm_kfree(&pdev->dev, mp->clk_config);
 
-	for (i = 0; i < dpu_mdss->num_paths; i++)
-		icc_put(dpu_mdss->path[i]);
-
 	if (dpu_mdss->mmio)
 		devm_iounmap(&pdev->dev, dpu_mdss->mmio);
 	dpu_mdss->mmio = NULL;
@@ -276,12 +235,6 @@ int dpu_mdss_init(struct drm_device *dev)
 
 	DRM_DEBUG("mapped mdss address space @%pK\n", dpu_mdss->mmio);
 
-	if (!of_device_is_compatible(dev->dev->of_node, "qcom,sc7180-mdss")) {
-		ret = dpu_mdss_parse_data_bus_icc_path(dev, dpu_mdss);
-		if (ret)
-			return ret;
-	}
-
 	mp = &dpu_mdss->mp;
 	ret = msm_dss_parse_clock(pdev, mp);
 	if (ret) {
@@ -307,8 +260,6 @@ int dpu_mdss_init(struct drm_device *dev)
 
 	pm_runtime_enable(dev->dev);
 
-	dpu_mdss_icc_request_bw(priv->mdss);
-
 	return ret;
 
 irq_error:
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-06-08 14:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-01 18:51 [PATCH for-5.10.y+] drm/msm/dpu: always use mdp device to scale bandwidth Amit Pundir
2021-06-08 14:50 ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2021-05-28 11:31 [PATCH for-5.10.y] " Amit Pundir
2021-05-30 12:24 ` Greg KH
2021-05-31  7:55   ` Amit Pundir

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.