dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] drm: add helper to sort panels to the head of the connector list
@ 2012-10-27 13:52 Daniel Vetter
  2012-10-27 13:52 ` [PATCH 2/2] drm/i915: move panel connectors to the front Daniel Vetter
                   ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: Daniel Vetter @ 2012-10-27 13:52 UTC (permalink / raw)
  To: DRI Development; +Cc: Daniel Vetter, Intel Graphics Development

Userspace seems to like this, see

commit cb0953d734348e8862d6d7edc666cfb3bf6d8fae
Author: Adam Jackson <ajax@redhat.com>
Date:   Fri Jul 16 14:46:29 2010 -0400

    drm/i915: Initialize LVDS and eDP outputs before anything else

    This makes them sort to the front in X, which makes them likely to be
    the primary outputs if you haven't specified a preference in your DE,
    which is likely to be what you want.

    Signed-off-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Eric Anholt <eric@anholt.net>

Sorting the connector list after the fact is much easier than trying
to be clever with the init sequence.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/drm_crtc_helper.c | 18 ++++++++++++++++++
 include/drm/drm_crtc_helper.h     |  2 ++
 2 files changed, 20 insertions(+)

diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
index 1227adf..7105168 100644
--- a/drivers/gpu/drm/drm_crtc_helper.c
+++ b/drivers/gpu/drm/drm_crtc_helper.c
@@ -39,6 +39,24 @@
 #include <drm/drm_fb_helper.h>
 #include <drm/drm_edid.h>
 
+void drm_helper_move_panel_connectors_to_head(struct drm_device *dev)
+{
+	struct drm_connector *connector, *tmp;
+	struct list_head panel_list;
+
+	INIT_LIST_HEAD(&panel_list);
+
+	list_for_each_entry_safe(connector, tmp,
+				 &dev->mode_config.connector_list, head) {
+		if (connector->connector_type == DRM_MODE_CONNECTOR_LVDS ||
+		    connector->connector_type == DRM_MODE_CONNECTOR_eDP)
+			list_move_tail(&connector->head, &panel_list);
+	}
+
+	list_splice(&panel_list, &dev->mode_config.connector_list);
+}
+EXPORT_SYMBOL(drm_helper_move_panel_connectors_to_head);
+
 static bool drm_kms_helper_poll = true;
 module_param_named(poll, drm_kms_helper_poll, bool, 0600);
 
diff --git a/include/drm/drm_crtc_helper.h b/include/drm/drm_crtc_helper.h
index e01cc80..defee28 100644
--- a/include/drm/drm_crtc_helper.h
+++ b/include/drm/drm_crtc_helper.h
@@ -137,6 +137,8 @@ extern bool drm_helper_encoder_in_use(struct drm_encoder *encoder);
 
 extern void drm_helper_connector_dpms(struct drm_connector *connector, int mode);
 
+extern void drm_helper_move_panel_connectors_to_head(struct drm_device *);
+
 extern int drm_helper_mode_fill_fb_struct(struct drm_framebuffer *fb,
 					  struct drm_mode_fb_cmd2 *mode_cmd);
 
-- 
1.7.11.7

^ permalink raw reply related	[flat|nested] 20+ messages in thread
* [PATCH 1/4] drm/doc: Helpers are not a Midlayer!
@ 2012-11-01 13:45 Daniel Vetter
  2012-11-01 13:45 ` [PATCH 3/4] drm/doc: integrate fb helper reference into docs Daniel Vetter
  0 siblings, 1 reply; 20+ messages in thread
From: Daniel Vetter @ 2012-11-01 13:45 UTC (permalink / raw)
  To: Dave Airlie; +Cc: Daniel Vetter, DRI Development

I'm devoting all my wrath to that fight, so don't misname it ;-)

v2: Make it clear that this section talks about kms helpers.

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 Documentation/DocBook/drm.tmpl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/DocBook/drm.tmpl b/Documentation/DocBook/drm.tmpl
index b030052..270bc12 100644
--- a/Documentation/DocBook/drm.tmpl
+++ b/Documentation/DocBook/drm.tmpl
@@ -1621,10 +1621,10 @@ void intel_crt_init(struct drm_device *dev)
     </sect2>
   </sect1>
 
-  <!-- Internals: mid-layer helper functions -->
+  <!-- Internals: kms helper functions -->
 
   <sect1>
-    <title>Mid-layer Helper Functions</title>
+    <title>Mode Setting Helper Functions</title>
     <para>
       The CRTC, encoder and connector functions provided by the drivers
       implement the DRM API. They're called by the DRM core and ioctl handlers
-- 
1.7.11.7

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

end of thread, other threads:[~2012-11-28 10:31 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-27 13:52 [PATCH 1/2] drm: add helper to sort panels to the head of the connector list Daniel Vetter
2012-10-27 13:52 ` [PATCH 2/2] drm/i915: move panel connectors to the front Daniel Vetter
2012-10-28  9:07   ` [Intel-gfx] " Chris Wilson
2012-10-31 20:05   ` Adam Jackson
2012-11-01 21:16     ` Daniel Vetter
2012-10-30 10:11 ` [PATCH 1/2] drm: add helper to sort panels to the head of the connector list Laurent Pinchart
2012-10-31  9:11   ` [PATCH 1/4] drm/doc: Helpers are not a Midlayer! Daniel Vetter
2012-10-31  9:11     ` [PATCH 2/4] drm/doc: integrate crtc helper api into docbook Daniel Vetter
2012-11-01 11:44       ` Laurent Pinchart
2012-10-31  9:11     ` [PATCH 3/4] drm/doc: integrate fb helper reference into docs Daniel Vetter
2012-11-01 11:52       ` Laurent Pinchart
2012-10-31  9:11     ` [PATCH 4/4] drm/doc: add new dp helpers into drm DocBook Daniel Vetter
2012-11-01 12:02       ` Laurent Pinchart
2012-10-31 10:01     ` [PATCH 1/3] drm/doc: integrate crtc helper api into docbook Daniel Vetter
2012-10-31 10:01       ` [PATCH 2/3] drm/doc: integrate fb helper reference into docs Daniel Vetter
2012-10-31 10:01       ` [PATCH 3/3] drm/doc: add new dp helpers into drm DocBook Daniel Vetter
2012-11-01 11:25     ` [PATCH 1/4] drm/doc: Helpers are not a Midlayer! Laurent Pinchart
2012-10-31 19:59 ` [PATCH 1/2] drm: add helper to sort panels to the head of the connector list Adam Jackson
2012-11-01 13:45 [PATCH 1/4] drm/doc: Helpers are not a Midlayer! Daniel Vetter
2012-11-01 13:45 ` [PATCH 3/4] drm/doc: integrate fb helper reference into docs Daniel Vetter
2012-11-28 10:31   ` Dave Airlie

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).