aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2014-09-25 15:24:26 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2015-03-24 07:50:54 -0400
commitc7c1aecd8e490c3818eaaea33e3c0d372931350a (patch)
tree12e2025df09c2e28fdef998ead56801543e5613f
parentf7c5f5d9e25dc524f1cdc6cf821400ac29dae486 (diff)
drm/omap: fix operation without fbdev
omapdrm should work fine even if fbdev is missing. The current driver crashes in that case, though, as it is missing checks for the fbdev. Add the checks so that we don't free fbdev or restore fbdev mode when there's no fbdev. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r--drivers/gpu/drm/omapdrm/omap_drv.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
index b71a443e671e..63c953971c11 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -530,7 +530,8 @@ static int dev_unload(struct drm_device *dev)
530 530
531 drm_kms_helper_poll_fini(dev); 531 drm_kms_helper_poll_fini(dev);
532 532
533 omap_fbdev_free(dev); 533 if (priv->fbdev)
534 omap_fbdev_free(dev);
534 535
535 /* flush crtcs so the fbs get released */ 536 /* flush crtcs so the fbs get released */
536 for (i = 0; i < priv->num_crtcs; i++) 537 for (i = 0; i < priv->num_crtcs; i++)
@@ -599,9 +600,11 @@ static void dev_lastclose(struct drm_device *dev)
599 } 600 }
600 } 601 }
601 602
602 ret = drm_fb_helper_restore_fbdev_mode_unlocked(priv->fbdev); 603 if (priv->fbdev) {
603 if (ret) 604 ret = drm_fb_helper_restore_fbdev_mode_unlocked(priv->fbdev);
604 DBG("failed to restore crtc mode"); 605 if (ret)
606 DBG("failed to restore crtc mode");
607 }
605} 608}
606 609
607static void dev_preclose(struct drm_device *dev, struct drm_file *file) 610static void dev_preclose(struct drm_device *dev, struct drm_file *file)