[Intel-gfx] [PATCH] drm: Disable all the possibles output/crtcs before entering KMS mode
yakui.zhao at intel.com
yakui.zhao at intel.com
Fri Dec 4 13:05:56 CET 2009
From: Zhao Yakui <yakui.zhao at intel.com>
Disable all the possible outputs/crtcs before entering KMS mode.
Signed-off-by: Zhao Yakui <yakui.zhao at intel.com>
---
drivers/gpu/drm/drm_crtc_helper.c | 32 ++++++++++++++++++++++++++++++++
include/drm/drm_crtc_helper.h | 2 ++
2 files changed, 34 insertions(+), 0 deletions(-)
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
--
1.5.4.5
More information about the Intel-gfx
mailing list