drm: fix hotplug oops

main
Dave Airlie 2008-06-04 15:17:13 +10:00
parent a8725d95bc
commit cf1964f971
1 changed files with 10 additions and 3 deletions

View File

@ -712,9 +712,11 @@ int drm_helper_hotplug_stage_two(struct drm_device *dev, struct drm_connector *c
return 0;
}
if (connector->encoder->crtc && connector->encoder->crtc->desired_mode) {
DRM_DEBUG("drm thinks that the connector already has a config\n");
has_config = 1;
if (connector->encoder) {
if (connector->encoder->crtc && connector->encoder->crtc->desired_mode) {
DRM_DEBUG("drm thinks that the connector already has a config\n");
has_config = 1;
}
}
drm_helper_probe_connector_modes(dev, 2048, 2048);
@ -722,6 +724,11 @@ int drm_helper_hotplug_stage_two(struct drm_device *dev, struct drm_connector *c
if (!has_config)
drm_pick_crtcs(dev);
if (!connector->encoder) {
DRM_DEBUG("could not find a desired mode or crtc for connector\n");
return 1;
}
if (!connector->encoder->crtc || !connector->encoder->crtc->desired_mode) {
DRM_DEBUG("could not find a desired mode or crtc for connector\n");
return 1;