dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm: simple_kms_helper: make connector optional at init time
@ 2016-08-23 14:05 Andrea Merello
  2016-08-23 15:18 ` Daniel Vetter
  0 siblings, 1 reply; 2+ messages in thread
From: Andrea Merello @ 2016-08-23 14:05 UTC (permalink / raw)
  To: dri-devel; +Cc: Andrea Merello

drm_simple_display_pipe_init() pretendes to attach a connector
to the display pipe.

In case a drm bridge has to be used, then it's the bridge that
takes care of connectors.

This patch makes the connector parameter optional for
drm_simple_display_pipe_init(), so that a drm bridge could
handle connector by itslef later.

Signed-off-by: Andrea Merello <andrea.merello@gmail.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Noralf Trønnes <noralf@tronnes.org>
Cc: Daniel Vetter <daniel@ffwll.ch>

diff --git a/drivers/gpu/drm/drm_simple_kms_helper.c b/drivers/gpu/drm/drm_simple_kms_helper.c
index 0a02efe..3a48c7c 100644
--- a/drivers/gpu/drm/drm_simple_kms_helper.c
+++ b/drivers/gpu/drm/drm_simple_kms_helper.c
@@ -139,7 +139,7 @@ static const struct drm_plane_funcs drm_simple_kms_plane_funcs = {
  * @funcs: callbacks for the display pipe (optional)
  * @formats: array of supported formats (%DRM_FORMAT_*)
  * @format_count: number of elements in @formats
- * @connector: connector to attach and register
+ * @connector: connector to attach and register (optional)
  *
  * Sets up a display pipeline which consist of a really simple
  * plane-crtc-encoder pipe coupled with the provided connector.
@@ -181,7 +181,7 @@ int drm_simple_display_pipe_init(struct drm_device *dev,
 	encoder->possible_crtcs = 1 << drm_crtc_index(crtc);
 	ret = drm_encoder_init(dev, encoder, &drm_simple_kms_encoder_funcs,
 			       DRM_MODE_ENCODER_NONE, NULL);
-	if (ret)
+	if (ret || !connector)
 		return ret;

 	return drm_mode_connector_attach_encoder(connector, encoder);
--
2.7.4
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH 1/2] drm: simple_kms_helper: make connector optional at init time
  2016-08-23 14:05 [PATCH 1/2] drm: simple_kms_helper: make connector optional at init time Andrea Merello
@ 2016-08-23 15:18 ` Daniel Vetter
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Vetter @ 2016-08-23 15:18 UTC (permalink / raw)
  To: Andrea Merello; +Cc: dri-devel

On Tue, Aug 23, 2016 at 04:05:57PM +0200, Andrea Merello wrote:
> drm_simple_display_pipe_init() pretendes to attach a connector
> to the display pipe.
> 
> In case a drm bridge has to be used, then it's the bridge that
> takes care of connectors.
> 
> This patch makes the connector parameter optional for
> drm_simple_display_pipe_init(), so that a drm bridge could
> handle connector by itslef later.
> 
> Signed-off-by: Andrea Merello <andrea.merello@gmail.com>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Noralf Trønnes <noralf@tronnes.org>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> 
> diff --git a/drivers/gpu/drm/drm_simple_kms_helper.c b/drivers/gpu/drm/drm_simple_kms_helper.c
> index 0a02efe..3a48c7c 100644
> --- a/drivers/gpu/drm/drm_simple_kms_helper.c
> +++ b/drivers/gpu/drm/drm_simple_kms_helper.c
> @@ -139,7 +139,7 @@ static const struct drm_plane_funcs drm_simple_kms_plane_funcs = {
>   * @funcs: callbacks for the display pipe (optional)
>   * @formats: array of supported formats (%DRM_FORMAT_*)
>   * @format_count: number of elements in @formats
> - * @connector: connector to attach and register
> + * @connector: connector to attach and register (optional)
>   *
>   * Sets up a display pipeline which consist of a really simple
>   * plane-crtc-encoder pipe coupled with the provided connector.

I think a few more words when a NULL @connector here would be great,
essentially what you've written already in the changelog. Plus then in
patch 2 add a cross-link here to the new function your adding - that
happens automatically if you append ().

btw pls also check the generated output using

$ make DOCBOOKS="" htmldocs

to make sure the links are all pretty.
-Daniel

> @@ -181,7 +181,7 @@ int drm_simple_display_pipe_init(struct drm_device *dev,
>  	encoder->possible_crtcs = 1 << drm_crtc_index(crtc);
>  	ret = drm_encoder_init(dev, encoder, &drm_simple_kms_encoder_funcs,
>  			       DRM_MODE_ENCODER_NONE, NULL);
> -	if (ret)
> +	if (ret || !connector)
>  		return ret;
> 
>  	return drm_mode_connector_attach_encoder(connector, encoder);
> --
> 2.7.4

-- 
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] 2+ messages in thread

end of thread, other threads:[~2016-08-23 15:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-23 14:05 [PATCH 1/2] drm: simple_kms_helper: make connector optional at init time Andrea Merello
2016-08-23 15:18 ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox