linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] drm/msm: few small cleanups
@ 2019-06-30 13:14 Rob Clark
  2019-06-30 13:14 ` [PATCH 1/3] drm/msm: don't open-code governor name Rob Clark
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Rob Clark @ 2019-06-30 13:14 UTC (permalink / raw)
  To: dri-devel; +Cc: freedreno, linux-arm-msm, Rob Clark

From: Rob Clark <robdclark@chromium.org>

2 and 3 are some early prep-work to deal with bootloader enabled
displays, where we want to avoid runpm get/put cycles until we know
that we won't -EPROBE_DEFER.  (Otherwise, it will kill the display,
and it's not terribly nice to kill efifb and leave the user with no
good way to debug what dependency they are missing.)

Rob Clark (3):
  drm/msm: don't open-code governor name
  drm/msm/dpu: remove dpu_mdss:hwversion
  drm/msm/dsi: make sure we have panel or bridge earlier

 drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c |  5 ----
 drivers/gpu/drm/msm/dsi/dsi.h            |  2 +-
 drivers/gpu/drm/msm/dsi/dsi_host.c       | 30 ++++++++++++------------
 drivers/gpu/drm/msm/dsi/dsi_manager.c    |  9 +++----
 drivers/gpu/drm/msm/msm_gpu.c            |  2 +-
 5 files changed, 20 insertions(+), 28 deletions(-)

-- 
2.20.1


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

* [PATCH 1/3] drm/msm: don't open-code governor name
  2019-06-30 13:14 [PATCH 0/3] drm/msm: few small cleanups Rob Clark
@ 2019-06-30 13:14 ` Rob Clark
  2019-07-11 18:46   ` Jordan Crouse
  2019-06-30 13:14 ` [PATCH 2/3] drm/msm/dpu: remove dpu_mdss:hwversion Rob Clark
  2019-06-30 13:14 ` [PATCH 3/3] drm/msm/dsi: make sure we have panel or bridge earlier Rob Clark
  2 siblings, 1 reply; 10+ messages in thread
From: Rob Clark @ 2019-06-30 13:14 UTC (permalink / raw)
  To: dri-devel
  Cc: freedreno, linux-arm-msm, Rob Clark, Rob Clark, Sean Paul,
	David Airlie, Daniel Vetter, linux-kernel

From: Rob Clark <robdclark@chromium.org>

Signed-off-by: Rob Clark <robdclark@chromium.org>
---
 drivers/gpu/drm/msm/msm_gpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c
index 0a4c77fb3d94..e323259a16d3 100644
--- a/drivers/gpu/drm/msm/msm_gpu.c
+++ b/drivers/gpu/drm/msm/msm_gpu.c
@@ -106,7 +106,7 @@ static void msm_devfreq_init(struct msm_gpu *gpu)
 	 */
 
 	gpu->devfreq.devfreq = devm_devfreq_add_device(&gpu->pdev->dev,
-			&msm_devfreq_profile, "simple_ondemand", NULL);
+			&msm_devfreq_profile, DEVFREQ_GOV_SIMPLE_ONDEMAND, NULL);
 
 	if (IS_ERR(gpu->devfreq.devfreq)) {
 		DRM_DEV_ERROR(&gpu->pdev->dev, "Couldn't initialize GPU devfreq\n");
-- 
2.20.1


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

* [PATCH 2/3] drm/msm/dpu: remove dpu_mdss:hwversion
  2019-06-30 13:14 [PATCH 0/3] drm/msm: few small cleanups Rob Clark
  2019-06-30 13:14 ` [PATCH 1/3] drm/msm: don't open-code governor name Rob Clark
@ 2019-06-30 13:14 ` Rob Clark
  2019-07-11 18:47   ` [Freedreno] " Jordan Crouse
  2019-06-30 13:14 ` [PATCH 3/3] drm/msm/dsi: make sure we have panel or bridge earlier Rob Clark
  2 siblings, 1 reply; 10+ messages in thread
From: Rob Clark @ 2019-06-30 13:14 UTC (permalink / raw)
  To: dri-devel
  Cc: freedreno, linux-arm-msm, Rob Clark, Rob Clark, Sean Paul,
	David Airlie, Daniel Vetter, Jordan Crouse, Jayant Shekhar,
	Abhinav Kumar, Stephen Boyd, Jeykumar Sankaran, linux-kernel

From: Rob Clark <robdclark@chromium.org>

Unused and the extra rpm get/put interferes with handover from
bootloader (ie. happens before we have a chance to check if
things are already enabled).

Signed-off-by: Rob Clark <robdclark@chromium.org>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c
index 986915bbbc02..e83dd4c6ec58 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c
@@ -22,7 +22,6 @@ struct dpu_mdss {
 	struct msm_mdss base;
 	void __iomem *mmio;
 	unsigned long mmio_len;
-	u32 hwversion;
 	struct dss_module_power mp;
 	struct dpu_irq_controller irq_controller;
 	struct icc_path *path[2];
@@ -287,10 +286,6 @@ int dpu_mdss_init(struct drm_device *dev)
 
 	dpu_mdss_icc_request_bw(priv->mdss);
 
-	pm_runtime_get_sync(dev->dev);
-	dpu_mdss->hwversion = readl_relaxed(dpu_mdss->mmio);
-	pm_runtime_put_sync(dev->dev);
-
 	return ret;
 
 irq_error:
-- 
2.20.1


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

* [PATCH 3/3] drm/msm/dsi: make sure we have panel or bridge earlier
  2019-06-30 13:14 [PATCH 0/3] drm/msm: few small cleanups Rob Clark
  2019-06-30 13:14 ` [PATCH 1/3] drm/msm: don't open-code governor name Rob Clark
  2019-06-30 13:14 ` [PATCH 2/3] drm/msm/dpu: remove dpu_mdss:hwversion Rob Clark
@ 2019-06-30 13:14 ` Rob Clark
  2019-07-02 20:30   ` [Freedreno] " Jeffrey Hugo
  2019-07-04  6:39   ` Andrzej Hajda
  2 siblings, 2 replies; 10+ messages in thread
From: Rob Clark @ 2019-06-30 13:14 UTC (permalink / raw)
  To: dri-devel
  Cc: freedreno, linux-arm-msm, Rob Clark, Rob Clark, Sean Paul,
	David Airlie, Daniel Vetter, Sibi Sankar, Chandan Uddaraju,
	Jordan Crouse, Abhinav Kumar, linux-kernel

From: Rob Clark <robdclark@chromium.org>

If we are going to -EPROBE_DEFER due to panel/bridge not probed yet, we
want to do it before we start touching hardware.

Signed-off-by: Rob Clark <robdclark@chromium.org>
---
 drivers/gpu/drm/msm/dsi/dsi.h         |  2 +-
 drivers/gpu/drm/msm/dsi/dsi_host.c    | 30 +++++++++++++--------------
 drivers/gpu/drm/msm/dsi/dsi_manager.c |  9 +++-----
 3 files changed, 19 insertions(+), 22 deletions(-)

diff --git a/drivers/gpu/drm/msm/dsi/dsi.h b/drivers/gpu/drm/msm/dsi/dsi.h
index 53bb124e8259..e15e7534ccd9 100644
--- a/drivers/gpu/drm/msm/dsi/dsi.h
+++ b/drivers/gpu/drm/msm/dsi/dsi.h
@@ -171,7 +171,7 @@ int msm_dsi_host_set_display_mode(struct mipi_dsi_host *host,
 struct drm_panel *msm_dsi_host_get_panel(struct mipi_dsi_host *host);
 unsigned long msm_dsi_host_get_mode_flags(struct mipi_dsi_host *host);
 struct drm_bridge *msm_dsi_host_get_bridge(struct mipi_dsi_host *host);
-int msm_dsi_host_register(struct mipi_dsi_host *host, bool check_defer);
+int msm_dsi_host_register(struct mipi_dsi_host *host);
 void msm_dsi_host_unregister(struct mipi_dsi_host *host);
 int msm_dsi_host_set_src_pll(struct mipi_dsi_host *host,
 			struct msm_dsi_pll *src_pll);
diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
index 1ae2f5522979..8e5b0ba9431e 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_host.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
@@ -1824,6 +1824,20 @@ int msm_dsi_host_init(struct msm_dsi *msm_dsi)
 		goto fail;
 	}
 
+	/*
+	 * Make sure we have panel or bridge early, before we start
+	 * touching the hw.  If bootloader enabled the display, we
+	 * want to be sure to keep it running until the bridge/panel
+	 * is probed and we are all ready to go.  Otherwise we'll
+	 * kill the display and then -EPROBE_DEFER
+	 */
+	if (IS_ERR(of_drm_find_panel(msm_host->device_node)) &&
+			!of_drm_find_bridge(msm_host->device_node)) {
+		pr_err("%s: no panel or bridge yet\n", __func__);
+		return -EPROBE_DEFER;
+	}
+
+
 	msm_host->ctrl_base = msm_ioremap(pdev, "dsi_ctrl", "DSI CTRL");
 	if (IS_ERR(msm_host->ctrl_base)) {
 		pr_err("%s: unable to map Dsi ctrl base\n", __func__);
@@ -1941,7 +1955,7 @@ int msm_dsi_host_modeset_init(struct mipi_dsi_host *host,
 	return 0;
 }
 
-int msm_dsi_host_register(struct mipi_dsi_host *host, bool check_defer)
+int msm_dsi_host_register(struct mipi_dsi_host *host)
 {
 	struct msm_dsi_host *msm_host = to_msm_dsi_host(host);
 	int ret;
@@ -1955,20 +1969,6 @@ int msm_dsi_host_register(struct mipi_dsi_host *host, bool check_defer)
 			return ret;
 
 		msm_host->registered = true;
-
-		/* If the panel driver has not been probed after host register,
-		 * we should defer the host's probe.
-		 * It makes sure panel is connected when fbcon detects
-		 * connector status and gets the proper display mode to
-		 * create framebuffer.
-		 * Don't try to defer if there is nothing connected to the dsi
-		 * output
-		 */
-		if (check_defer && msm_host->device_node) {
-			if (IS_ERR(of_drm_find_panel(msm_host->device_node)))
-				if (!of_drm_find_bridge(msm_host->device_node))
-					return -EPROBE_DEFER;
-		}
 	}
 
 	return 0;
diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c
index ff39ce6150ad..cd3450dc3481 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_manager.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c
@@ -82,7 +82,7 @@ static int dsi_mgr_setup_components(int id)
 	int ret;
 
 	if (!IS_DUAL_DSI()) {
-		ret = msm_dsi_host_register(msm_dsi->host, true);
+		ret = msm_dsi_host_register(msm_dsi->host);
 		if (ret)
 			return ret;
 
@@ -101,14 +101,11 @@ static int dsi_mgr_setup_components(int id)
 		/* Register slave host first, so that slave DSI device
 		 * has a chance to probe, and do not block the master
 		 * DSI device's probe.
-		 * Also, do not check defer for the slave host,
-		 * because only master DSI device adds the panel to global
-		 * panel list. The panel's device is the master DSI device.
 		 */
-		ret = msm_dsi_host_register(slave_link_dsi->host, false);
+		ret = msm_dsi_host_register(slave_link_dsi->host);
 		if (ret)
 			return ret;
-		ret = msm_dsi_host_register(master_link_dsi->host, true);
+		ret = msm_dsi_host_register(master_link_dsi->host);
 		if (ret)
 			return ret;
 
-- 
2.20.1


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

* Re: [Freedreno] [PATCH 3/3] drm/msm/dsi: make sure we have panel or bridge earlier
  2019-06-30 13:14 ` [PATCH 3/3] drm/msm/dsi: make sure we have panel or bridge earlier Rob Clark
@ 2019-07-02 20:30   ` Jeffrey Hugo
  2019-07-02 21:29     ` Jeffrey Hugo
  2019-07-04  6:39   ` Andrzej Hajda
  1 sibling, 1 reply; 10+ messages in thread
From: Jeffrey Hugo @ 2019-07-02 20:30 UTC (permalink / raw)
  To: Rob Clark
  Cc: open list:DRM PANEL DRIVERS, Rob Clark, David Airlie, MSM,
	Jordan Crouse, Abhinav Kumar, lkml, Sean Paul, Sibi Sankar,
	Daniel Vetter, freedreno, Chandan Uddaraju

On Sun, Jun 30, 2019 at 7:16 AM Rob Clark <robdclark@gmail.com> wrote:
> --- a/drivers/gpu/drm/msm/dsi/dsi_host.c
> +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
> @@ -1824,6 +1824,20 @@ int msm_dsi_host_init(struct msm_dsi *msm_dsi)
>                 goto fail;
>         }
>
> +       /*
> +        * Make sure we have panel or bridge early, before we start
> +        * touching the hw.  If bootloader enabled the display, we
> +        * want to be sure to keep it running until the bridge/panel
> +        * is probed and we are all ready to go.  Otherwise we'll
> +        * kill the display and then -EPROBE_DEFER
> +        */
> +       if (IS_ERR(of_drm_find_panel(msm_host->device_node)) &&
> +                       !of_drm_find_bridge(msm_host->device_node)) {
> +               pr_err("%s: no panel or bridge yet\n", __func__);

pr_err() doesn't seem right for a probe defer condition.  pr_dbg?

> +               return -EPROBE_DEFER;
> +       }
> +
> +

Tested-by: Jeffrey Hugo <jeffrey.l.hugo@gmail.com>
Reviewed-by: Jeffrey Hugo <jeffrey.l.hugo@gmail.com>

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

* Re: [Freedreno] [PATCH 3/3] drm/msm/dsi: make sure we have panel or bridge earlier
  2019-07-02 20:30   ` [Freedreno] " Jeffrey Hugo
@ 2019-07-02 21:29     ` Jeffrey Hugo
  0 siblings, 0 replies; 10+ messages in thread
From: Jeffrey Hugo @ 2019-07-02 21:29 UTC (permalink / raw)
  To: Rob Clark
  Cc: open list:DRM PANEL DRIVERS, Rob Clark, David Airlie, MSM,
	Jordan Crouse, Abhinav Kumar, lkml, Sean Paul, Sibi Sankar,
	Daniel Vetter, freedreno, Chandan Uddaraju

On Tue, Jul 2, 2019 at 2:30 PM Jeffrey Hugo <jeffrey.l.hugo@gmail.com> wrote:
>
> On Sun, Jun 30, 2019 at 7:16 AM Rob Clark <robdclark@gmail.com> wrote:
> > --- a/drivers/gpu/drm/msm/dsi/dsi_host.c
> > +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
> > @@ -1824,6 +1824,20 @@ int msm_dsi_host_init(struct msm_dsi *msm_dsi)
> >                 goto fail;
> >         }
> >
> > +       /*
> > +        * Make sure we have panel or bridge early, before we start
> > +        * touching the hw.  If bootloader enabled the display, we
> > +        * want to be sure to keep it running until the bridge/panel
> > +        * is probed and we are all ready to go.  Otherwise we'll
> > +        * kill the display and then -EPROBE_DEFER
> > +        */
> > +       if (IS_ERR(of_drm_find_panel(msm_host->device_node)) &&
> > +                       !of_drm_find_bridge(msm_host->device_node)) {
> > +               pr_err("%s: no panel or bridge yet\n", __func__);
>
> pr_err() doesn't seem right for a probe defer condition.  pr_dbg?
>
> > +               return -EPROBE_DEFER;
> > +       }
> > +
> > +
>
> Tested-by: Jeffrey Hugo <jeffrey.l.hugo@gmail.com>
> Reviewed-by: Jeffrey Hugo <jeffrey.l.hugo@gmail.com>

Actually, I'm sorry, I'm now NACKing this.

Turns out this prevents the panel/bridge from ever probing if its a
child node of the dsi device, since mipi_dsi_host_register() is never
called.

This probably works for you on the c630 because the bridge hangs off
the i2c bus.

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

* Re: [PATCH 3/3] drm/msm/dsi: make sure we have panel or bridge earlier
  2019-06-30 13:14 ` [PATCH 3/3] drm/msm/dsi: make sure we have panel or bridge earlier Rob Clark
  2019-07-02 20:30   ` [Freedreno] " Jeffrey Hugo
@ 2019-07-04  6:39   ` Andrzej Hajda
  2019-07-04 14:00     ` Rob Clark
  1 sibling, 1 reply; 10+ messages in thread
From: Andrzej Hajda @ 2019-07-04  6:39 UTC (permalink / raw)
  To: Rob Clark, dri-devel
  Cc: Rob Clark, David Airlie, linux-arm-msm, Abhinav Kumar,
	linux-kernel, Sean Paul, Sibi Sankar, freedreno,
	Chandan Uddaraju

On 30.06.2019 15:14, Rob Clark wrote:
> From: Rob Clark <robdclark@chromium.org>
>
> If we are going to -EPROBE_DEFER due to panel/bridge not probed yet, we
> want to do it before we start touching hardware.


As the evidence shows, if the driver create bus (mipi-dsi), then it
should not defer probing due to lack of sink (panel/bridge), because the
sink will not appear without the bus.

Instead of defer probing you can defer component binding, or if you like
challenges you can implement dynamic sink binding :)


Regards

Andrzej




>
> Signed-off-by: Rob Clark <robdclark@chromium.org>
> ---
>  drivers/gpu/drm/msm/dsi/dsi.h         |  2 +-
>  drivers/gpu/drm/msm/dsi/dsi_host.c    | 30 +++++++++++++--------------
>  drivers/gpu/drm/msm/dsi/dsi_manager.c |  9 +++-----
>  3 files changed, 19 insertions(+), 22 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/dsi/dsi.h b/drivers/gpu/drm/msm/dsi/dsi.h
> index 53bb124e8259..e15e7534ccd9 100644
> --- a/drivers/gpu/drm/msm/dsi/dsi.h
> +++ b/drivers/gpu/drm/msm/dsi/dsi.h
> @@ -171,7 +171,7 @@ int msm_dsi_host_set_display_mode(struct mipi_dsi_host *host,
>  struct drm_panel *msm_dsi_host_get_panel(struct mipi_dsi_host *host);
>  unsigned long msm_dsi_host_get_mode_flags(struct mipi_dsi_host *host);
>  struct drm_bridge *msm_dsi_host_get_bridge(struct mipi_dsi_host *host);
> -int msm_dsi_host_register(struct mipi_dsi_host *host, bool check_defer);
> +int msm_dsi_host_register(struct mipi_dsi_host *host);
>  void msm_dsi_host_unregister(struct mipi_dsi_host *host);
>  int msm_dsi_host_set_src_pll(struct mipi_dsi_host *host,
>  			struct msm_dsi_pll *src_pll);
> diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
> index 1ae2f5522979..8e5b0ba9431e 100644
> --- a/drivers/gpu/drm/msm/dsi/dsi_host.c
> +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
> @@ -1824,6 +1824,20 @@ int msm_dsi_host_init(struct msm_dsi *msm_dsi)
>  		goto fail;
>  	}
>  
> +	/*
> +	 * Make sure we have panel or bridge early, before we start
> +	 * touching the hw.  If bootloader enabled the display, we
> +	 * want to be sure to keep it running until the bridge/panel
> +	 * is probed and we are all ready to go.  Otherwise we'll
> +	 * kill the display and then -EPROBE_DEFER
> +	 */
> +	if (IS_ERR(of_drm_find_panel(msm_host->device_node)) &&
> +			!of_drm_find_bridge(msm_host->device_node)) {
> +		pr_err("%s: no panel or bridge yet\n", __func__);
> +		return -EPROBE_DEFER;
> +	}
> +
> +
>  	msm_host->ctrl_base = msm_ioremap(pdev, "dsi_ctrl", "DSI CTRL");
>  	if (IS_ERR(msm_host->ctrl_base)) {
>  		pr_err("%s: unable to map Dsi ctrl base\n", __func__);
> @@ -1941,7 +1955,7 @@ int msm_dsi_host_modeset_init(struct mipi_dsi_host *host,
>  	return 0;
>  }
>  
> -int msm_dsi_host_register(struct mipi_dsi_host *host, bool check_defer)
> +int msm_dsi_host_register(struct mipi_dsi_host *host)
>  {
>  	struct msm_dsi_host *msm_host = to_msm_dsi_host(host);
>  	int ret;
> @@ -1955,20 +1969,6 @@ int msm_dsi_host_register(struct mipi_dsi_host *host, bool check_defer)
>  			return ret;
>  
>  		msm_host->registered = true;
> -
> -		/* If the panel driver has not been probed after host register,
> -		 * we should defer the host's probe.
> -		 * It makes sure panel is connected when fbcon detects
> -		 * connector status and gets the proper display mode to
> -		 * create framebuffer.
> -		 * Don't try to defer if there is nothing connected to the dsi
> -		 * output
> -		 */
> -		if (check_defer && msm_host->device_node) {
> -			if (IS_ERR(of_drm_find_panel(msm_host->device_node)))
> -				if (!of_drm_find_bridge(msm_host->device_node))
> -					return -EPROBE_DEFER;
> -		}
>  	}
>  
>  	return 0;
> diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c
> index ff39ce6150ad..cd3450dc3481 100644
> --- a/drivers/gpu/drm/msm/dsi/dsi_manager.c
> +++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c
> @@ -82,7 +82,7 @@ static int dsi_mgr_setup_components(int id)
>  	int ret;
>  
>  	if (!IS_DUAL_DSI()) {
> -		ret = msm_dsi_host_register(msm_dsi->host, true);
> +		ret = msm_dsi_host_register(msm_dsi->host);
>  		if (ret)
>  			return ret;
>  
> @@ -101,14 +101,11 @@ static int dsi_mgr_setup_components(int id)
>  		/* Register slave host first, so that slave DSI device
>  		 * has a chance to probe, and do not block the master
>  		 * DSI device's probe.
> -		 * Also, do not check defer for the slave host,
> -		 * because only master DSI device adds the panel to global
> -		 * panel list. The panel's device is the master DSI device.
>  		 */
> -		ret = msm_dsi_host_register(slave_link_dsi->host, false);
> +		ret = msm_dsi_host_register(slave_link_dsi->host);
>  		if (ret)
>  			return ret;
> -		ret = msm_dsi_host_register(master_link_dsi->host, true);
> +		ret = msm_dsi_host_register(master_link_dsi->host);
>  		if (ret)
>  			return ret;
>  



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

* Re: [PATCH 3/3] drm/msm/dsi: make sure we have panel or bridge earlier
  2019-07-04  6:39   ` Andrzej Hajda
@ 2019-07-04 14:00     ` Rob Clark
  0 siblings, 0 replies; 10+ messages in thread
From: Rob Clark @ 2019-07-04 14:00 UTC (permalink / raw)
  To: Andrzej Hajda
  Cc: dri-devel, Rob Clark, David Airlie, linux-arm-msm, Abhinav Kumar,
	Linux Kernel Mailing List, Sean Paul, Sibi Sankar, freedreno,
	Chandan Uddaraju

On Wed, Jul 3, 2019 at 11:39 PM Andrzej Hajda <a.hajda@samsung.com> wrote:
>
> On 30.06.2019 15:14, Rob Clark wrote:
> > From: Rob Clark <robdclark@chromium.org>
> >
> > If we are going to -EPROBE_DEFER due to panel/bridge not probed yet, we
> > want to do it before we start touching hardware.
>
>
> As the evidence shows, if the driver create bus (mipi-dsi), then it
> should not defer probing due to lack of sink (panel/bridge), because the
> sink will not appear without the bus.
>
> Instead of defer probing you can defer component binding, or if you like
> challenges you can implement dynamic sink binding :)
>

I have something working that doesn't require this patch.. although it
does require CCF to export a function to check if clks are enabled so
the driver can detect if the display is already enabled.  (Well, there
kind of is, __clk_is_enabled().. but currently in clk-provider.h)

So we can drop this patch.

BR,
-R

>
> Regards
>
> Andrzej
>
>
>
>
> >
> > Signed-off-by: Rob Clark <robdclark@chromium.org>
> > ---
> >  drivers/gpu/drm/msm/dsi/dsi.h         |  2 +-
> >  drivers/gpu/drm/msm/dsi/dsi_host.c    | 30 +++++++++++++--------------
> >  drivers/gpu/drm/msm/dsi/dsi_manager.c |  9 +++-----
> >  3 files changed, 19 insertions(+), 22 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/msm/dsi/dsi.h b/drivers/gpu/drm/msm/dsi/dsi.h
> > index 53bb124e8259..e15e7534ccd9 100644
> > --- a/drivers/gpu/drm/msm/dsi/dsi.h
> > +++ b/drivers/gpu/drm/msm/dsi/dsi.h
> > @@ -171,7 +171,7 @@ int msm_dsi_host_set_display_mode(struct mipi_dsi_host *host,
> >  struct drm_panel *msm_dsi_host_get_panel(struct mipi_dsi_host *host);
> >  unsigned long msm_dsi_host_get_mode_flags(struct mipi_dsi_host *host);
> >  struct drm_bridge *msm_dsi_host_get_bridge(struct mipi_dsi_host *host);
> > -int msm_dsi_host_register(struct mipi_dsi_host *host, bool check_defer);
> > +int msm_dsi_host_register(struct mipi_dsi_host *host);
> >  void msm_dsi_host_unregister(struct mipi_dsi_host *host);
> >  int msm_dsi_host_set_src_pll(struct mipi_dsi_host *host,
> >                       struct msm_dsi_pll *src_pll);
> > diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
> > index 1ae2f5522979..8e5b0ba9431e 100644
> > --- a/drivers/gpu/drm/msm/dsi/dsi_host.c
> > +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
> > @@ -1824,6 +1824,20 @@ int msm_dsi_host_init(struct msm_dsi *msm_dsi)
> >               goto fail;
> >       }
> >
> > +     /*
> > +      * Make sure we have panel or bridge early, before we start
> > +      * touching the hw.  If bootloader enabled the display, we
> > +      * want to be sure to keep it running until the bridge/panel
> > +      * is probed and we are all ready to go.  Otherwise we'll
> > +      * kill the display and then -EPROBE_DEFER
> > +      */
> > +     if (IS_ERR(of_drm_find_panel(msm_host->device_node)) &&
> > +                     !of_drm_find_bridge(msm_host->device_node)) {
> > +             pr_err("%s: no panel or bridge yet\n", __func__);
> > +             return -EPROBE_DEFER;
> > +     }
> > +
> > +
> >       msm_host->ctrl_base = msm_ioremap(pdev, "dsi_ctrl", "DSI CTRL");
> >       if (IS_ERR(msm_host->ctrl_base)) {
> >               pr_err("%s: unable to map Dsi ctrl base\n", __func__);
> > @@ -1941,7 +1955,7 @@ int msm_dsi_host_modeset_init(struct mipi_dsi_host *host,
> >       return 0;
> >  }
> >
> > -int msm_dsi_host_register(struct mipi_dsi_host *host, bool check_defer)
> > +int msm_dsi_host_register(struct mipi_dsi_host *host)
> >  {
> >       struct msm_dsi_host *msm_host = to_msm_dsi_host(host);
> >       int ret;
> > @@ -1955,20 +1969,6 @@ int msm_dsi_host_register(struct mipi_dsi_host *host, bool check_defer)
> >                       return ret;
> >
> >               msm_host->registered = true;
> > -
> > -             /* If the panel driver has not been probed after host register,
> > -              * we should defer the host's probe.
> > -              * It makes sure panel is connected when fbcon detects
> > -              * connector status and gets the proper display mode to
> > -              * create framebuffer.
> > -              * Don't try to defer if there is nothing connected to the dsi
> > -              * output
> > -              */
> > -             if (check_defer && msm_host->device_node) {
> > -                     if (IS_ERR(of_drm_find_panel(msm_host->device_node)))
> > -                             if (!of_drm_find_bridge(msm_host->device_node))
> > -                                     return -EPROBE_DEFER;
> > -             }
> >       }
> >
> >       return 0;
> > diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c
> > index ff39ce6150ad..cd3450dc3481 100644
> > --- a/drivers/gpu/drm/msm/dsi/dsi_manager.c
> > +++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c
> > @@ -82,7 +82,7 @@ static int dsi_mgr_setup_components(int id)
> >       int ret;
> >
> >       if (!IS_DUAL_DSI()) {
> > -             ret = msm_dsi_host_register(msm_dsi->host, true);
> > +             ret = msm_dsi_host_register(msm_dsi->host);
> >               if (ret)
> >                       return ret;
> >
> > @@ -101,14 +101,11 @@ static int dsi_mgr_setup_components(int id)
> >               /* Register slave host first, so that slave DSI device
> >                * has a chance to probe, and do not block the master
> >                * DSI device's probe.
> > -              * Also, do not check defer for the slave host,
> > -              * because only master DSI device adds the panel to global
> > -              * panel list. The panel's device is the master DSI device.
> >                */
> > -             ret = msm_dsi_host_register(slave_link_dsi->host, false);
> > +             ret = msm_dsi_host_register(slave_link_dsi->host);
> >               if (ret)
> >                       return ret;
> > -             ret = msm_dsi_host_register(master_link_dsi->host, true);
> > +             ret = msm_dsi_host_register(master_link_dsi->host);
> >               if (ret)
> >                       return ret;
> >
>
>

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

* Re: [PATCH 1/3] drm/msm: don't open-code governor name
  2019-06-30 13:14 ` [PATCH 1/3] drm/msm: don't open-code governor name Rob Clark
@ 2019-07-11 18:46   ` Jordan Crouse
  0 siblings, 0 replies; 10+ messages in thread
From: Jordan Crouse @ 2019-07-11 18:46 UTC (permalink / raw)
  To: Rob Clark
  Cc: dri-devel, Rob Clark, David Airlie, linux-arm-msm, linux-kernel,
	Sean Paul, freedreno

On Sun, Jun 30, 2019 at 06:14:41AM -0700, Rob Clark wrote:
> From: Rob Clark <robdclark@chromium.org>

Reviewed-by: Jordan Crouse <jcrouse@codeaurora.org>

> Signed-off-by: Rob Clark <robdclark@chromium.org>
> ---
>  drivers/gpu/drm/msm/msm_gpu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c
> index 0a4c77fb3d94..e323259a16d3 100644
> --- a/drivers/gpu/drm/msm/msm_gpu.c
> +++ b/drivers/gpu/drm/msm/msm_gpu.c
> @@ -106,7 +106,7 @@ static void msm_devfreq_init(struct msm_gpu *gpu)
>  	 */
>  
>  	gpu->devfreq.devfreq = devm_devfreq_add_device(&gpu->pdev->dev,
> -			&msm_devfreq_profile, "simple_ondemand", NULL);
> +			&msm_devfreq_profile, DEVFREQ_GOV_SIMPLE_ONDEMAND, NULL);
>  
>  	if (IS_ERR(gpu->devfreq.devfreq)) {
>  		DRM_DEV_ERROR(&gpu->pdev->dev, "Couldn't initialize GPU devfreq\n");
> -- 
> 2.20.1
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

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

* Re: [Freedreno] [PATCH 2/3] drm/msm/dpu: remove dpu_mdss:hwversion
  2019-06-30 13:14 ` [PATCH 2/3] drm/msm/dpu: remove dpu_mdss:hwversion Rob Clark
@ 2019-07-11 18:47   ` Jordan Crouse
  0 siblings, 0 replies; 10+ messages in thread
From: Jordan Crouse @ 2019-07-11 18:47 UTC (permalink / raw)
  To: Rob Clark
  Cc: dri-devel, Rob Clark, David Airlie, linux-arm-msm, Abhinav Kumar,
	Stephen Boyd, Jayant Shekhar, Sean Paul, Daniel Vetter,
	Jeykumar Sankaran, freedreno, linux-kernel

On Sun, Jun 30, 2019 at 06:14:42AM -0700, Rob Clark wrote:
> From: Rob Clark <robdclark@chromium.org>
> 
> Unused and the extra rpm get/put interferes with handover from
> bootloader (ie. happens before we have a chance to check if
> things are already enabled).

Yay for not turning on the hardware before we need to.

Reviewed-by: Jordan Crouse <jcrouse@codeaurora.org>

> Signed-off-by: Rob Clark <robdclark@chromium.org>
> ---
>  drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c
> index 986915bbbc02..e83dd4c6ec58 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c
> @@ -22,7 +22,6 @@ struct dpu_mdss {
>  	struct msm_mdss base;
>  	void __iomem *mmio;
>  	unsigned long mmio_len;
> -	u32 hwversion;
>  	struct dss_module_power mp;
>  	struct dpu_irq_controller irq_controller;
>  	struct icc_path *path[2];
> @@ -287,10 +286,6 @@ int dpu_mdss_init(struct drm_device *dev)
>  
>  	dpu_mdss_icc_request_bw(priv->mdss);
>  
> -	pm_runtime_get_sync(dev->dev);
> -	dpu_mdss->hwversion = readl_relaxed(dpu_mdss->mmio);
> -	pm_runtime_put_sync(dev->dev);
> -
>  	return ret;
>  
>  irq_error:
> -- 
> 2.20.1
> 
> _______________________________________________
> Freedreno mailing list
> Freedreno@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/freedreno

-- 
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

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

end of thread, other threads:[~2019-07-11 18:47 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-30 13:14 [PATCH 0/3] drm/msm: few small cleanups Rob Clark
2019-06-30 13:14 ` [PATCH 1/3] drm/msm: don't open-code governor name Rob Clark
2019-07-11 18:46   ` Jordan Crouse
2019-06-30 13:14 ` [PATCH 2/3] drm/msm/dpu: remove dpu_mdss:hwversion Rob Clark
2019-07-11 18:47   ` [Freedreno] " Jordan Crouse
2019-06-30 13:14 ` [PATCH 3/3] drm/msm/dsi: make sure we have panel or bridge earlier Rob Clark
2019-07-02 20:30   ` [Freedreno] " Jeffrey Hugo
2019-07-02 21:29     ` Jeffrey Hugo
2019-07-04  6:39   ` Andrzej Hajda
2019-07-04 14:00     ` Rob Clark

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).