Skip to content

Commit

Permalink
drm/omap: fix operation without fbdev
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tomi Valkeinen committed Mar 24, 2015
1 parent f7c5f5d commit c7c1aec
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions drivers/gpu/drm/omapdrm/omap_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,8 @@ static int dev_unload(struct drm_device *dev)

drm_kms_helper_poll_fini(dev);

omap_fbdev_free(dev);
if (priv->fbdev)
omap_fbdev_free(dev);

/* flush crtcs so the fbs get released */
for (i = 0; i < priv->num_crtcs; i++)
Expand Down Expand Up @@ -599,9 +600,11 @@ static void dev_lastclose(struct drm_device *dev)
}
}

ret = drm_fb_helper_restore_fbdev_mode_unlocked(priv->fbdev);
if (ret)
DBG("failed to restore crtc mode");
if (priv->fbdev) {
ret = drm_fb_helper_restore_fbdev_mode_unlocked(priv->fbdev);
if (ret)
DBG("failed to restore crtc mode");
}
}

static void dev_preclose(struct drm_device *dev, struct drm_file *file)
Expand Down

0 comments on commit c7c1aec

Please sign in to comment.