All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/arm: hdlcd: Set the CRTC's port before binding the encoder.
@ 2017-06-06 15:16 ` Liviu Dudau
  0 siblings, 0 replies; 4+ messages in thread
From: Liviu Dudau @ 2017-06-06 15:16 UTC (permalink / raw)
  To: dri-devel; +Cc: linux-kernel, Brian Starkey

The component-based encoder(s) used by HDLCD expect the CRTC port
to be set before binding in order to find the right endpoint.
Without this patch, the TDA19988 encoder driver prints a warning
"Falling back to first CRTC".

Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
---
 drivers/gpu/drm/arm/hdlcd_drv.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c
index 345c8357b273..d3da87fbd85a 100644
--- a/drivers/gpu/drm/arm/hdlcd_drv.c
+++ b/drivers/gpu/drm/arm/hdlcd_drv.c
@@ -297,6 +297,9 @@ static int hdlcd_drm_bind(struct device *dev)
 	if (ret)
 		goto err_free;
 
+	/* Set the CRTC's port so that the encoder component can find it */
+	hdlcd->crtc.port = of_graph_get_port_by_id(dev->of_node, 0);
+
 	ret = component_bind_all(dev, drm);
 	if (ret) {
 		DRM_ERROR("Failed to bind all components\n");
@@ -340,11 +343,14 @@ static int hdlcd_drm_bind(struct device *dev)
 	}
 err_fbdev:
 	drm_kms_helper_poll_fini(drm);
+	drm_vblank_cleanup(drm);
 err_vblank:
 	pm_runtime_disable(drm->dev);
 err_pm_active:
 	component_unbind_all(dev, drm);
 err_unload:
+	of_node_put(hdlcd->crtc.port);
+	hdlcd->crtc.port = NULL;
 	drm_irq_uninstall(drm);
 	of_reserved_mem_device_release(drm->dev);
 err_free:
@@ -367,6 +373,9 @@ static void hdlcd_drm_unbind(struct device *dev)
 	}
 	drm_kms_helper_poll_fini(drm);
 	component_unbind_all(dev, drm);
+	of_node_put(hdlcd->crtc.port);
+	hdlcd->crtc.port = NULL;
+	drm_vblank_cleanup(drm);
 	pm_runtime_get_sync(drm->dev);
 	drm_irq_uninstall(drm);
 	pm_runtime_put_sync(drm->dev);
-- 
2.13.0

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

* [PATCH] drm/arm: hdlcd: Set the CRTC's port before binding the encoder.
@ 2017-06-06 15:16 ` Liviu Dudau
  0 siblings, 0 replies; 4+ messages in thread
From: Liviu Dudau @ 2017-06-06 15:16 UTC (permalink / raw)
  To: dri-devel; +Cc: linux-kernel

The component-based encoder(s) used by HDLCD expect the CRTC port
to be set before binding in order to find the right endpoint.
Without this patch, the TDA19988 encoder driver prints a warning
"Falling back to first CRTC".

Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
---
 drivers/gpu/drm/arm/hdlcd_drv.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c
index 345c8357b273..d3da87fbd85a 100644
--- a/drivers/gpu/drm/arm/hdlcd_drv.c
+++ b/drivers/gpu/drm/arm/hdlcd_drv.c
@@ -297,6 +297,9 @@ static int hdlcd_drm_bind(struct device *dev)
 	if (ret)
 		goto err_free;
 
+	/* Set the CRTC's port so that the encoder component can find it */
+	hdlcd->crtc.port = of_graph_get_port_by_id(dev->of_node, 0);
+
 	ret = component_bind_all(dev, drm);
 	if (ret) {
 		DRM_ERROR("Failed to bind all components\n");
@@ -340,11 +343,14 @@ static int hdlcd_drm_bind(struct device *dev)
 	}
 err_fbdev:
 	drm_kms_helper_poll_fini(drm);
+	drm_vblank_cleanup(drm);
 err_vblank:
 	pm_runtime_disable(drm->dev);
 err_pm_active:
 	component_unbind_all(dev, drm);
 err_unload:
+	of_node_put(hdlcd->crtc.port);
+	hdlcd->crtc.port = NULL;
 	drm_irq_uninstall(drm);
 	of_reserved_mem_device_release(drm->dev);
 err_free:
@@ -367,6 +373,9 @@ static void hdlcd_drm_unbind(struct device *dev)
 	}
 	drm_kms_helper_poll_fini(drm);
 	component_unbind_all(dev, drm);
+	of_node_put(hdlcd->crtc.port);
+	hdlcd->crtc.port = NULL;
+	drm_vblank_cleanup(drm);
 	pm_runtime_get_sync(drm->dev);
 	drm_irq_uninstall(drm);
 	pm_runtime_put_sync(drm->dev);
-- 
2.13.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/arm: hdlcd: Set the CRTC's port before binding the encoder.
  2017-06-06 15:16 ` Liviu Dudau
@ 2017-06-28  9:05   ` Daniel Vetter
  -1 siblings, 0 replies; 4+ messages in thread
From: Daniel Vetter @ 2017-06-28  9:05 UTC (permalink / raw)
  To: Liviu Dudau; +Cc: dri-devel, linux-kernel

On Tue, Jun 06, 2017 at 04:16:05PM +0100, Liviu Dudau wrote:
> The component-based encoder(s) used by HDLCD expect the CRTC port
> to be set before binding in order to find the right endpoint.
> Without this patch, the TDA19988 encoder driver prints a warning
> "Falling back to first CRTC".
> 
> Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
> ---
>  drivers/gpu/drm/arm/hdlcd_drv.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c
> index 345c8357b273..d3da87fbd85a 100644
> --- a/drivers/gpu/drm/arm/hdlcd_drv.c
> +++ b/drivers/gpu/drm/arm/hdlcd_drv.c
> @@ -297,6 +297,9 @@ static int hdlcd_drm_bind(struct device *dev)
>  	if (ret)
>  		goto err_free;
>  
> +	/* Set the CRTC's port so that the encoder component can find it */
> +	hdlcd->crtc.port = of_graph_get_port_by_id(dev->of_node, 0);
> +
>  	ret = component_bind_all(dev, drm);
>  	if (ret) {
>  		DRM_ERROR("Failed to bind all components\n");
> @@ -340,11 +343,14 @@ static int hdlcd_drm_bind(struct device *dev)
>  	}
>  err_fbdev:
>  	drm_kms_helper_poll_fini(drm);
> +	drm_vblank_cleanup(drm);

You're resurrecting dead code here. I'll do a fixup patch so I can finally
unload my drm_vblank_cleanup.
-Daniel

>  err_vblank:
>  	pm_runtime_disable(drm->dev);
>  err_pm_active:
>  	component_unbind_all(dev, drm);
>  err_unload:
> +	of_node_put(hdlcd->crtc.port);
> +	hdlcd->crtc.port = NULL;
>  	drm_irq_uninstall(drm);
>  	of_reserved_mem_device_release(drm->dev);
>  err_free:
> @@ -367,6 +373,9 @@ static void hdlcd_drm_unbind(struct device *dev)
>  	}
>  	drm_kms_helper_poll_fini(drm);
>  	component_unbind_all(dev, drm);
> +	of_node_put(hdlcd->crtc.port);
> +	hdlcd->crtc.port = NULL;
> +	drm_vblank_cleanup(drm);
>  	pm_runtime_get_sync(drm->dev);
>  	drm_irq_uninstall(drm);
>  	pm_runtime_put_sync(drm->dev);
> -- 
> 2.13.0
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

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

* Re: [PATCH] drm/arm: hdlcd: Set the CRTC's port before binding the encoder.
@ 2017-06-28  9:05   ` Daniel Vetter
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Vetter @ 2017-06-28  9:05 UTC (permalink / raw)
  To: Liviu Dudau; +Cc: linux-kernel, dri-devel

On Tue, Jun 06, 2017 at 04:16:05PM +0100, Liviu Dudau wrote:
> The component-based encoder(s) used by HDLCD expect the CRTC port
> to be set before binding in order to find the right endpoint.
> Without this patch, the TDA19988 encoder driver prints a warning
> "Falling back to first CRTC".
> 
> Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
> ---
>  drivers/gpu/drm/arm/hdlcd_drv.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c
> index 345c8357b273..d3da87fbd85a 100644
> --- a/drivers/gpu/drm/arm/hdlcd_drv.c
> +++ b/drivers/gpu/drm/arm/hdlcd_drv.c
> @@ -297,6 +297,9 @@ static int hdlcd_drm_bind(struct device *dev)
>  	if (ret)
>  		goto err_free;
>  
> +	/* Set the CRTC's port so that the encoder component can find it */
> +	hdlcd->crtc.port = of_graph_get_port_by_id(dev->of_node, 0);
> +
>  	ret = component_bind_all(dev, drm);
>  	if (ret) {
>  		DRM_ERROR("Failed to bind all components\n");
> @@ -340,11 +343,14 @@ static int hdlcd_drm_bind(struct device *dev)
>  	}
>  err_fbdev:
>  	drm_kms_helper_poll_fini(drm);
> +	drm_vblank_cleanup(drm);

You're resurrecting dead code here. I'll do a fixup patch so I can finally
unload my drm_vblank_cleanup.
-Daniel

>  err_vblank:
>  	pm_runtime_disable(drm->dev);
>  err_pm_active:
>  	component_unbind_all(dev, drm);
>  err_unload:
> +	of_node_put(hdlcd->crtc.port);
> +	hdlcd->crtc.port = NULL;
>  	drm_irq_uninstall(drm);
>  	of_reserved_mem_device_release(drm->dev);
>  err_free:
> @@ -367,6 +373,9 @@ static void hdlcd_drm_unbind(struct device *dev)
>  	}
>  	drm_kms_helper_poll_fini(drm);
>  	component_unbind_all(dev, drm);
> +	of_node_put(hdlcd->crtc.port);
> +	hdlcd->crtc.port = NULL;
> +	drm_vblank_cleanup(drm);
>  	pm_runtime_get_sync(drm->dev);
>  	drm_irq_uninstall(drm);
>  	pm_runtime_put_sync(drm->dev);
> -- 
> 2.13.0
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2017-06-28  9:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-06 15:16 [PATCH] drm/arm: hdlcd: Set the CRTC's port before binding the encoder Liviu Dudau
2017-06-06 15:16 ` Liviu Dudau
2017-06-28  9:05 ` Daniel Vetter
2017-06-28  9:05   ` Daniel Vetter

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.