Skip to content

Commit

Permalink
drm/modes: drop __drm_framebuffer_unregister.
Browse files Browse the repository at this point in the history
Just use the generic function.

The main side effect of this is that the fb->base.id
is now protected by the idr mutex as well.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Dave Airlie committed Apr 22, 2016
1 parent f55f1f9 commit 19ab3f8
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions drivers/gpu/drm/drm_crtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,15 +389,6 @@ struct drm_mode_object *drm_mode_object_find(struct drm_device *dev,
}
EXPORT_SYMBOL(drm_mode_object_find);

/* dev->mode_config.fb_lock must be held! */
static void __drm_framebuffer_unregister(struct drm_device *dev,
struct drm_framebuffer *fb)
{
drm_mode_object_put(dev, &fb->base);

fb->base.id = 0;
}

static void drm_framebuffer_free(struct kref *kref)
{
struct drm_framebuffer *fb =
Expand All @@ -409,10 +400,7 @@ static void drm_framebuffer_free(struct kref *kref)
* removed at this point. Check for that.
*/
mutex_lock(&dev->mode_config.fb_lock);
if (fb->base.id) {
/* Mark fb as reaped and drop idr ref. */
__drm_framebuffer_unregister(dev, fb);
}
drm_mode_object_unregister(dev, &fb->base);
mutex_unlock(&dev->mode_config.fb_lock);

fb->funcs->destroy(fb);
Expand Down Expand Up @@ -549,7 +537,7 @@ void drm_framebuffer_unregister_private(struct drm_framebuffer *fb)

mutex_lock(&dev->mode_config.fb_lock);
/* Mark fb as reaped and drop idr ref. */
__drm_framebuffer_unregister(dev, fb);
drm_mode_object_unregister(dev, &fb->base);
mutex_unlock(&dev->mode_config.fb_lock);
}
EXPORT_SYMBOL(drm_framebuffer_unregister_private);
Expand Down

0 comments on commit 19ab3f8

Please sign in to comment.