drm: don't drop handle reference on unload
authorDave Airlie <airlied@redhat.com>
Thu, 7 Oct 2010 04:01:17 +0000 (14:01 +1000)
committerDave Airlie <airlied@redhat.com>
Thu, 7 Oct 2010 04:01:17 +0000 (14:01 +1000)
since the handle references are all tied to a file_priv, and when it disappears
all the handle refs go with it.

The fbcon ones we'd only notice on unload, but the nouveau notifier one
would would happen on reboot.

nouveau: Reported-by: Marc Dionne <marc.c.dionne@gmail.com>
nouveau: Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
i915 unload: Reported-by: Keith Packard <keithp@keithp.com>
Acked-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/i915/intel_fb.c
drivers/gpu/drm/nouveau/nouveau_fbcon.c
drivers/gpu/drm/nouveau/nouveau_notifier.c
drivers/gpu/drm/radeon/radeon_fb.c

index 56ad9df2ccb58925bdd74a2f3b64bac01360f562..b61966c126d3e3839d33be6c8df2c0170c5d1376 100644 (file)
@@ -238,8 +238,8 @@ int intel_fbdev_destroy(struct drm_device *dev,
 
        drm_framebuffer_cleanup(&ifb->base);
        if (ifb->obj) {
-               drm_gem_object_handle_unreference(ifb->obj);
                drm_gem_object_unreference(ifb->obj);
+               ifb->obj = NULL;
        }
 
        return 0;
index d2047713dc59318fe94aff82eccf98bd28dd6841..dbd30b2e43fd13b39aaa59eb0abc4fb0332bd1ee 100644 (file)
@@ -352,7 +352,6 @@ nouveau_fbcon_destroy(struct drm_device *dev, struct nouveau_fbdev *nfbdev)
 
        if (nouveau_fb->nvbo) {
                nouveau_bo_unmap(nouveau_fb->nvbo);
-               drm_gem_object_handle_unreference_unlocked(nouveau_fb->nvbo->gem);
                drm_gem_object_unreference_unlocked(nouveau_fb->nvbo->gem);
                nouveau_fb->nvbo = NULL;
        }
index 3c9964a8fbad00eb4a8371f94900432521f1367f..3ec181ff50cea7a45b22a28a6ed43857b2a841cb 100644 (file)
@@ -79,7 +79,6 @@ nouveau_notifier_takedown_channel(struct nouveau_channel *chan)
        mutex_lock(&dev->struct_mutex);
        nouveau_bo_unpin(chan->notifier_bo);
        mutex_unlock(&dev->struct_mutex);
-       drm_gem_object_handle_unreference_unlocked(chan->notifier_bo->gem);
        drm_gem_object_unreference_unlocked(chan->notifier_bo->gem);
        drm_mm_takedown(&chan->notifier_heap);
 }
index 9cdf6a35bc2c3f4efbd5daab2a9506078308aa31..40b0c087b5921384d46bf7f745cf93f2b391015b 100644 (file)
@@ -97,7 +97,6 @@ static void radeonfb_destroy_pinned_object(struct drm_gem_object *gobj)
                radeon_bo_unpin(rbo);
                radeon_bo_unreserve(rbo);
        }
-       drm_gem_object_handle_unreference(gobj);
        drm_gem_object_unreference_unlocked(gobj);
 }