Skip to contentSkip to conversation

drm: don't drop handle reference on unload

PATCH New Dave Airlie 1 participant 1 message Oct 7, 2010

Subsystems (5)
lore
Share & tools
lore

Dave Airlie

author maintainer
#0 lore raw

PATCH 1/1 drm: don't drop handle reference on unload

From: Dave Airlie <[email protected]>

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 <[email protected]>
nouveau: Tested-by: Marc Dionne <[email protected]> i915 unload: Reported-by: Keith Packard <[email protected]>

---
 drivers/gpu/drm/i915/intel_fb.c            |    2 +-
 drivers/gpu/drm/nouveau/nouveau_fbcon.c    |    1 -
 drivers/gpu/drm/nouveau/nouveau_notifier.c |    1 -
 drivers/gpu/drm/radeon/radeon_fb.c         |    1 -
 4 files changed, 1 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_fb.c +1 -1
index 56ad9df..b61966c 100644
@@ -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;
drivers/gpu/drm/nouveau/nouveau_fbcon.c +0 -1
index d204771..dbd30b2 100644
@@ -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;
 	}
drivers/gpu/drm/nouveau/nouveau_notifier.c +0 -1
index 3c9964a..3ec181f 100644
@@ -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);
 }
drivers/gpu/drm/radeon/radeon_fb.c +0 -1
index 9cdf6a3..40b0c08 100644
@@ -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);
 }
 
Signature · 1 line
1.7.1