summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2016-04-15 15:10:34 +1000
committerDave Airlie <airlied@redhat.com>2016-04-22 10:28:06 +1000
commit19ab3f8bb4edbc576d4a2cc94a80d0e28296b649 (patch)
tree0625ca4ba4c7f60ec5e8879153ce09865751e1a4
parentf55f1f91f567ac32cbf04fbdd455fc54661504fb (diff)
downloadlinux-stable-19ab3f8bb4edbc576d4a2cc94a80d0e28296b649.tar.gz
linux-stable-19ab3f8bb4edbc576d4a2cc94a80d0e28296b649.tar.bz2
linux-stable-19ab3f8bb4edbc576d4a2cc94a80d0e28296b649.zip
drm/modes: drop __drm_framebuffer_unregister.
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>
-rw-r--r--drivers/gpu/drm/drm_crtc.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 339d6ca21f57..4499b12b1870 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -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 =
@@ -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);
@@ -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);