From patchwork Fri Dec 4 12:05:56 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhao, Yakui" X-Patchwork-Id: 64842 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nB4C7kYc023827 for ; Fri, 4 Dec 2009 12:07:46 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8E8B99E8A5; Fri, 4 Dec 2009 04:07:45 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id 636E39E87A for ; Fri, 4 Dec 2009 04:07:43 -0800 (PST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 04 Dec 2009 04:06:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.47,340,1257148800"; d="scan'208";a="575638554" Received: from yakui_zhao.sh.intel.com (HELO localhost.localdomain) ([10.239.13.200]) by orsmga001.jf.intel.com with ESMTP; 04 Dec 2009 04:07:28 -0800 From: yakui.zhao@intel.com To: airlied@redhat.com Date: Fri, 4 Dec 2009 20:05:56 +0800 Message-Id: <1259928356-1405-1-git-send-email-yakui.zhao@intel.com> X-Mailer: git-send-email 1.5.4.5 Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.sourceforge.net Subject: [Intel-gfx] [PATCH] drm: Disable all the possibles output/crtcs before entering KMS mode X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.9 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index 3963b3c..b49028f 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c @@ -1020,6 +1020,9 @@ bool drm_helper_initial_config(struct drm_device *dev) { int count = 0; + /* Disable all the possible outputs/crtc before entering KMS mode */ + drm_helper_disable_connector_crtc(dev); + drm_fb_helper_parse_command_line(dev); count = drm_helper_probe_connector_modes(dev, @@ -1067,6 +1070,35 @@ static int drm_helper_choose_crtc_dpms(struct drm_crtc *crtc) } /** + * drm_helper_disable_connector_crtc + * @dev: drm_device + * + * Disable all the possible outputs & Crtcs + */ +void drm_helper_disable_connector_crtc(struct drm_device *dev) +{ + struct drm_encoder *encoder; + struct drm_crtc *crtc; + + list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { + struct drm_encoder_helper_funcs *encoder_funcs = + encoder->helper_private; + if (encoder_funcs && encoder_funcs->dpms) + (*encoder_funcs->dpms)(encoder, DRM_MODE_DPMS_OFF); + } + + list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { + struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private; + if (crtc_funcs && crtc_funcs->dpms) + (*crtc_funcs->dpms)(crtc, DRM_MODE_DPMS_OFF); + } + + return; +} + +EXPORT_SYMBOL(drm_helper_disable_connector_crtc); + +/** * drm_helper_connector_dpms * @connector affected connector * @mode DPMS mode diff --git a/include/drm/drm_crtc_helper.h b/include/drm/drm_crtc_helper.h index b29e201..007bbba 100644 --- a/include/drm/drm_crtc_helper.h +++ b/include/drm/drm_crtc_helper.h @@ -131,4 +131,6 @@ static inline int drm_connector_helper_add(struct drm_connector *connector, } extern int drm_helper_resume_force_mode(struct drm_device *dev); +/* disable all the possible outputs & crtcs for one drm_device */ +extern void drm_helper_disable_connector_crtc(struct drm_device *dev); #endif