]> git.baikalelectronics.ru Git - kernel.git/commit
drm/gem: handlecount isn't really a kref so don't make it one.
authorDave Airlie <airlied@redhat.com>
Mon, 27 Sep 2010 06:17:17 +0000 (16:17 +1000)
committerDave Airlie <airlied@redhat.com>
Thu, 30 Sep 2010 23:17:44 +0000 (09:17 +1000)
commitb3a49cc3f2e6c9ae35d6ccc0a86c96a3bc4a65ca
treef89a8a3069ebe9828b8a08c4b123f52625bf0bc7
parentdc6c7c64de8eb53ce38ff79ac16918ab96e68b5c
drm/gem: handlecount isn't really a kref so don't make it one.

There were lots of places being inconsistent since handle count
looked like a kref but it really wasn't.

Fix this my just making handle count an atomic on the object,
and have it increase the normal object kref.

Now i915/radeon/nouveau drivers can drop the normal reference on
userspace object creation, and have the handle hold it.

This patch fixes a memory leak or corruption on unload, because
the driver had no way of knowing if a handle had been actually
added for this object, and the fbcon object needed to know this
to clean itself up properly.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_gem.c
drivers/gpu/drm/drm_info.c
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/intel_fb.c
drivers/gpu/drm/nouveau/nouveau_fbcon.c
drivers/gpu/drm/nouveau/nouveau_gem.c
drivers/gpu/drm/nouveau/nouveau_notifier.c
drivers/gpu/drm/radeon/radeon_display.c
drivers/gpu/drm/radeon/radeon_fb.c
drivers/gpu/drm/radeon/radeon_gem.c
include/drm/drmP.h