fix unbalanced lock and make sure mode list has modes so lvds code doesn't crash
parent
981f8156de
commit
a5cf4cc369
|
@ -37,6 +37,7 @@ struct drm_framebuffer *drm_framebuffer_create(drm_device_t *dev)
|
||||||
spin_lock(&dev->mode_config.config_lock);
|
spin_lock(&dev->mode_config.config_lock);
|
||||||
/* Limit to single framebuffer for now */
|
/* Limit to single framebuffer for now */
|
||||||
if (dev->mode_config.num_fb > 1) {
|
if (dev->mode_config.num_fb > 1) {
|
||||||
|
spin_unlock(&dev->mode_config.config_lock);
|
||||||
DRM_ERROR("Attempt to add multiple framebuffers failed\n");
|
DRM_ERROR("Attempt to add multiple framebuffers failed\n");
|
||||||
return NULL;
|
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) {
|
list_for_each_entry(output, &dev->mode_config.output_list, head) {
|
||||||
struct drm_display_mode *des_mode;
|
struct drm_display_mode *des_mode;
|
||||||
|
|
||||||
|
if (list_empty(&output->modes))
|
||||||
|
continue;
|
||||||
|
|
||||||
/* Get the first preferred moded */
|
/* Get the first preferred moded */
|
||||||
list_for_each_entry(des_mode, &output->modes, head) {
|
list_for_each_entry(des_mode, &output->modes, head) {
|
||||||
if (des_mode->flags & DRM_MODE_TYPE_PREFERRED)
|
if (des_mode->flags & DRM_MODE_TYPE_PREFERRED)
|
||||||
|
|
Loading…
Reference in New Issue