aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_crtc_helper.c
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
commitada47b5fe13d89735805b566185f4885f5a3f750 (patch)
tree644b88f8a71896307d71438e9b3af49126ffb22b /drivers/gpu/drm/drm_crtc_helper.c
parent43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff)
parent3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff)
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/gpu/drm/drm_crtc_helper.c')
-rw-r--r--drivers/gpu/drm/drm_crtc_helper.c41
1 files changed, 32 insertions, 9 deletions
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
index bbfd110a7168..51103aa469f8 100644
--- a/drivers/gpu/drm/drm_crtc_helper.c
+++ b/drivers/gpu/drm/drm_crtc_helper.c
@@ -104,12 +104,13 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
104 if (connector->status == connector_status_disconnected) { 104 if (connector->status == connector_status_disconnected) {
105 DRM_DEBUG_KMS("%s is disconnected\n", 105 DRM_DEBUG_KMS("%s is disconnected\n",
106 drm_get_connector_name(connector)); 106 drm_get_connector_name(connector));
107 drm_mode_connector_update_edid_property(connector, NULL);
107 goto prune; 108 goto prune;
108 } 109 }
109 110
110 count = (*connector_funcs->get_modes)(connector); 111 count = (*connector_funcs->get_modes)(connector);
111 if (!count) { 112 if (!count) {
112 count = drm_add_modes_noedid(connector, 800, 600); 113 count = drm_add_modes_noedid(connector, 1024, 768);
113 if (!count) 114 if (!count)
114 return 0; 115 return 0;
115 } 116 }
@@ -216,7 +217,7 @@ bool drm_helper_crtc_in_use(struct drm_crtc *crtc)
216EXPORT_SYMBOL(drm_helper_crtc_in_use); 217EXPORT_SYMBOL(drm_helper_crtc_in_use);
217 218
218/** 219/**
219 * drm_disable_unused_functions - disable unused objects 220 * drm_helper_disable_unused_functions - disable unused objects
220 * @dev: DRM device 221 * @dev: DRM device
221 * 222 *
222 * LOCKING: 223 * LOCKING:
@@ -702,7 +703,7 @@ bool drm_crtc_helper_set_mode(struct drm_crtc *crtc,
702 if (encoder->crtc != crtc) 703 if (encoder->crtc != crtc)
703 continue; 704 continue;
704 705
705 DRM_INFO("%s: set mode %s %x\n", drm_get_encoder_name(encoder), 706 DRM_DEBUG("%s: set mode %s %x\n", drm_get_encoder_name(encoder),
706 mode->name, mode->base.id); 707 mode->name, mode->base.id);
707 encoder_funcs = encoder->helper_private; 708 encoder_funcs = encoder->helper_private;
708 encoder_funcs->mode_set(encoder, mode, adjusted_mode); 709 encoder_funcs->mode_set(encoder, mode, adjusted_mode);
@@ -836,11 +837,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
836 mode_changed = true; 837 mode_changed = true;
837 } else if (set->fb == NULL) { 838 } else if (set->fb == NULL) {
838 mode_changed = true; 839 mode_changed = true;
839 } else if ((set->fb->bits_per_pixel != 840 } else
840 set->crtc->fb->bits_per_pixel) ||
841 set->fb->depth != set->crtc->fb->depth)
842 fb_changed = true;
843 else
844 fb_changed = true; 841 fb_changed = true;
845 } 842 }
846 843
@@ -1020,6 +1017,9 @@ bool drm_helper_initial_config(struct drm_device *dev)
1020{ 1017{
1021 int count = 0; 1018 int count = 0;
1022 1019
1020 /* disable all the possible outputs/crtcs before entering KMS mode */
1021 drm_helper_disable_unused_functions(dev);
1022
1023 drm_fb_helper_parse_command_line(dev); 1023 drm_fb_helper_parse_command_line(dev);
1024 1024
1025 count = drm_helper_probe_connector_modes(dev, 1025 count = drm_helper_probe_connector_modes(dev,
@@ -1029,7 +1029,8 @@ bool drm_helper_initial_config(struct drm_device *dev)
1029 /* 1029 /*
1030 * we shouldn't end up with no modes here. 1030 * we shouldn't end up with no modes here.
1031 */ 1031 */
1032 WARN(!count, "No connectors reported connected with modes\n"); 1032 if (count == 0)
1033 printk(KERN_INFO "No connectors reported connected with modes\n");
1033 1034
1034 drm_setup_crtcs(dev); 1035 drm_setup_crtcs(dev);
1035 1036
@@ -1159,6 +1160,9 @@ EXPORT_SYMBOL(drm_helper_mode_fill_fb_struct);
1159int drm_helper_resume_force_mode(struct drm_device *dev) 1160int drm_helper_resume_force_mode(struct drm_device *dev)
1160{ 1161{
1161 struct drm_crtc *crtc; 1162 struct drm_crtc *crtc;
1163 struct drm_encoder *encoder;
1164 struct drm_encoder_helper_funcs *encoder_funcs;
1165 struct drm_crtc_helper_funcs *crtc_funcs;
1162 int ret; 1166 int ret;
1163 1167
1164 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { 1168 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
@@ -1171,6 +1175,25 @@ int drm_helper_resume_force_mode(struct drm_device *dev)
1171 1175
1172 if (ret == false) 1176 if (ret == false)
1173 DRM_ERROR("failed to set mode on crtc %p\n", crtc); 1177 DRM_ERROR("failed to set mode on crtc %p\n", crtc);
1178
1179 /* Turn off outputs that were already powered off */
1180 if (drm_helper_choose_crtc_dpms(crtc)) {
1181 list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
1182
1183 if(encoder->crtc != crtc)
1184 continue;
1185
1186 encoder_funcs = encoder->helper_private;
1187 if (encoder_funcs->dpms)
1188 (*encoder_funcs->dpms) (encoder,
1189 drm_helper_choose_encoder_dpms(encoder));
1190
1191 crtc_funcs = crtc->helper_private;
1192 if (crtc_funcs->dpms)
1193 (*crtc_funcs->dpms) (crtc,
1194 drm_helper_choose_crtc_dpms(crtc));
1195 }
1196 }
1174 } 1197 }
1175 /* disable the unused connectors while restoring the modesetting */ 1198 /* disable the unused connectors while restoring the modesetting */
1176 drm_helper_disable_unused_functions(dev); 1199 drm_helper_disable_unused_functions(dev);