fix unbalanced lock and make sure mode list has modes so lvds code doesn't crash

main
Dave Airlie 2007-04-12 11:28:55 +10:00
parent 981f8156de
commit a5cf4cc369
1 changed files with 4 additions and 0 deletions

View File

@ -37,6 +37,7 @@ struct drm_framebuffer *drm_framebuffer_create(drm_device_t *dev)
spin_lock(&dev->mode_config.config_lock);
/* Limit to single framebuffer for now */
if (dev->mode_config.num_fb > 1) {
spin_unlock(&dev->mode_config.config_lock);
DRM_ERROR("Attempt to add multiple framebuffers failed\n");
return NULL;
}
@ -542,6 +543,9 @@ bool drm_initial_config(drm_device_t *dev, struct drm_framebuffer *fb,
list_for_each_entry(output, &dev->mode_config.output_list, head) {
struct drm_display_mode *des_mode;
if (list_empty(&output->modes))
continue;
/* Get the first preferred moded */
list_for_each_entry(des_mode, &output->modes, head) {
if (des_mode->flags & DRM_MODE_TYPE_PREFERRED)