Skip to contentSkip to conversation

drm: simple_kms_helper: make connector optional at init time

PATCH In review Andrea Merello 2 participants 2 messages Aug 23, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 drm: simple_kms_helper: make connector optional at init time

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.

Cc David Airlie <[email protected]>
Cc Noralf Trønnes <[email protected]>
Cc Daniel Vetter <[email protected]>
drivers/gpu/drm/drm_simple_kms_helper.c +2 -2
index 0a02efe..3a48c7c 100644
@@ -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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#1 lore raw
Quoted 20 lines · 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.

Cc David Airlie <[email protected]>
Cc Noralf Trønnes <[email protected]>
Cc Daniel Vetter <[email protected]>
drivers/gpu/drm/drm_simple_kms_helper.c +0 -0
index 0a02efe..3a48c7c 100644

drivers/gpu/drm/drm_simple_kms_helper.c static const struct drm_plane_funcs drm_simple_kms_plane_funcs = { · line 145

Quoted 8 lines
drivers/gpu/drm/drm_simple_kms_helper.c +1 -1
@@ -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

Quoted 11 lines
drivers/gpu/drm/drm_simple_kms_helper.c +1 -2
@@ -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

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel