From patchwork Sat Oct 27 13:52:04 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 1655871 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id A3C1EDFAC4 for ; Sat, 27 Oct 2012 15:09:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 791909F007 for ; Sat, 27 Oct 2012 08:09:31 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ee0-f49.google.com (mail-ee0-f49.google.com [74.125.83.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 4FF909ED55 for ; Sat, 27 Oct 2012 08:00:28 -0700 (PDT) Received: by mail-ee0-f49.google.com with SMTP id c1so1507907eek.36 for ; Sat, 27 Oct 2012 08:00:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:x-mailer; bh=d/8W/naX3LhxuzSdxBMndIHry1K8zNzzzcrg23OoTtA=; b=SKDpiPW7GeD3Uw3I/h2YAauIM7hBHgtJe/6Ux0ruY/xbL9TOwsyddxxB/IX47zJI7C Pzq8kg512f6R5bq3qR5Uv6vW4vynAFRfHY+BIJM06w1CffRiQEjDEcpR0vXdfFg/FS31 /tgbTP9vSmHGsvPBEIEpwDyYtScW6Rs/sKcpg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=d/8W/naX3LhxuzSdxBMndIHry1K8zNzzzcrg23OoTtA=; b=Gpjawk0SNU+XG8uucRxmyulm3wpzEFbQK291+E3MHb/Rq/+MSK71g2gsqjByTbHIlY LpxAmrtmTIeAlOX6oKX6vsh0TNfRdBlMsAf4kMWYTFCLFlRmi5m3Q4aKgzYCiQODMDqr QzUazByjvXUiHd81gBKlbGXj2lKqYsXnc93KbRFZ5jTz0IQi6cJrBrp0Ds44gT21HHse aMrXGnPMA+p1boWQSKDSO6yOQYWbgk+E8awDh9DNj3Q/kfdBUQM79bSXBRcq2J7uVJdt zHhfSelgzKrq7mpS0Q0YB1HD23KtQ8riJ09TihA13b8oVnHNpT90cKDDvqlcjDFw3FuA f7ow== Received: by 10.14.203.3 with SMTP id e3mr29800500eeo.35.1351350027382; Sat, 27 Oct 2012 08:00:27 -0700 (PDT) Received: from wespe.ffwll.local (178-83-130-250.dynamic.hispeed.ch. [178.83.130.250]) by mx.google.com with ESMTPS id z43sm9773248een.16.2012.10.27.08.00.26 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 27 Oct 2012 08:00:26 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH 1/2] drm: add helper to sort panels to the head of the connector list Date: Sat, 27 Oct 2012 15:52:04 +0200 Message-Id: <1351345925-17510-1-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.7.11.7 X-Gm-Message-State: ALoCoQk9BMlW4v/v0pIJFPdutEaZgnAe6YClH6xC6gLqEOpXXBpIRLW6S09b/j1QTwPM43Sd8aOq Cc: Daniel Vetter , Intel Graphics Development X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Userspace seems to like this, see commit cb0953d734348e8862d6d7edc666cfb3bf6d8fae Author: Adam Jackson 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 Signed-off-by: Eric Anholt Sorting the connector list after the fact is much easier than trying to be clever with the init sequence. Signed-off-by: Daniel Vetter Reviewed-by: Adam Jackson --- 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 #include +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);