@@ -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
@@ -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