diff mbox series

[v3,12/21] drm/bridge: parade-ps8622: make connector creation optional

Message ID 20200703192417.372164-13-sam@ravnborg.org (mailing list archive)
State New, archived
Headers show
Series drm/bridge: support chained bridges + panel updates | expand

Commit Message

Sam Ravnborg July 3, 2020, 7:24 p.m. UTC
Make the connector creation optional to enable usage of the
parade-ps8622 bridge with the DRM bridge connector helper.

This change moves drm_helper_hpd_irq_event() call in the attach
function up before the connector creation.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Andrzej Hajda <a.hajda@samsung.com>
Cc: Neil Armstrong <narmstrong@baylibre.com>
Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
Cc: Jonas Karlman <jonas@kwiboo.se>
Cc: Jernej Skrabec <jernej.skrabec@siol.net>
---
 drivers/gpu/drm/bridge/parade-ps8622.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Comments

Laurent Pinchart July 10, 2020, 10:31 p.m. UTC | #1
Hi Sam,

Thank you for the patch.

On Fri, Jul 03, 2020 at 09:24:08PM +0200, Sam Ravnborg wrote:
> Make the connector creation optional to enable usage of the
> parade-ps8622 bridge with the DRM bridge connector helper.
> 
> This change moves drm_helper_hpd_irq_event() call in the attach
> function up before the connector creation.

No it doesn't :-)

And I wonder why that call is actually needed.

> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> Cc: Andrzej Hajda <a.hajda@samsung.com>
> Cc: Neil Armstrong <narmstrong@baylibre.com>
> Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
> Cc: Jonas Karlman <jonas@kwiboo.se>
> Cc: Jernej Skrabec <jernej.skrabec@siol.net>
> ---
>  drivers/gpu/drm/bridge/parade-ps8622.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/bridge/parade-ps8622.c b/drivers/gpu/drm/bridge/parade-ps8622.c
> index 6ab6f60b9091..54aa5270d2c9 100644
> --- a/drivers/gpu/drm/bridge/parade-ps8622.c
> +++ b/drivers/gpu/drm/bridge/parade-ps8622.c
> @@ -459,10 +459,8 @@ static int ps8622_attach(struct drm_bridge *bridge,
>  	ret = drm_bridge_attach(ps8622->bridge.encoder, ps8622->panel_bridge,
>  				&ps8622->bridge, flags);
>  
> -	if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) {
> -		DRM_ERROR("Fix bridge driver to make connector optional!");
> -		return -EINVAL;
> -	}
> +	if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)
> +		return 0;
>  
>  	if (!bridge->encoder) {
>  		DRM_ERROR("Parent encoder object not found");
> @@ -482,7 +480,7 @@ static int ps8622_attach(struct drm_bridge *bridge,
>  	drm_connector_attach_encoder(&ps8622->connector,
>  							bridge->encoder);
>  
> -	drm_helper_hpd_irq_event(ps8622->connector.dev);
> +	drm_helper_hpd_irq_event(ps8622->bridge.dev);
>  
>  	return ret;
>  }
diff mbox series

Patch

diff --git a/drivers/gpu/drm/bridge/parade-ps8622.c b/drivers/gpu/drm/bridge/parade-ps8622.c
index 6ab6f60b9091..54aa5270d2c9 100644
--- a/drivers/gpu/drm/bridge/parade-ps8622.c
+++ b/drivers/gpu/drm/bridge/parade-ps8622.c
@@ -459,10 +459,8 @@  static int ps8622_attach(struct drm_bridge *bridge,
 	ret = drm_bridge_attach(ps8622->bridge.encoder, ps8622->panel_bridge,
 				&ps8622->bridge, flags);
 
-	if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) {
-		DRM_ERROR("Fix bridge driver to make connector optional!");
-		return -EINVAL;
-	}
+	if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)
+		return 0;
 
 	if (!bridge->encoder) {
 		DRM_ERROR("Parent encoder object not found");
@@ -482,7 +480,7 @@  static int ps8622_attach(struct drm_bridge *bridge,
 	drm_connector_attach_encoder(&ps8622->connector,
 							bridge->encoder);
 
-	drm_helper_hpd_irq_event(ps8622->connector.dev);
+	drm_helper_hpd_irq_event(ps8622->bridge.dev);
 
 	return ret;
 }