Skip to content

Commit

Permalink
drm: Releasing FBs before releasing GEM objects during drm_release
Browse files Browse the repository at this point in the history
During DRM release, all the FBs and gem objects are released. If
a gem object is being used as a FB and set to a crtc, it must not
be freed before releasing the framebuffer first.

If FBs are released first, the crtc using the FB is disabled first
so now the GEM object can be freed safely. The CRTC will be enabled
again when the driver restores fbdev mode.

Signed-off-by: Prathyush K <prathyush.k@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Prathyush authored and Dave Airlie committed Apr 19, 2012
1 parent 5799d9e commit 4e47e02
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/gpu/drm/drm_fops.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,12 +507,12 @@ int drm_release(struct inode *inode, struct file *filp)

drm_events_release(file_priv);

if (dev->driver->driver_features & DRIVER_GEM)
drm_gem_release(dev, file_priv);

if (dev->driver->driver_features & DRIVER_MODESET)
drm_fb_release(file_priv);

if (dev->driver->driver_features & DRIVER_GEM)
drm_gem_release(dev, file_priv);

mutex_lock(&dev->ctxlist_mutex);
if (!list_empty(&dev->ctxlist)) {
struct drm_ctx_list *pos, *n;
Expand Down

0 comments on commit 4e47e02

Please sign in to comment.