[Intel-gfx] [PATCH] drm/i915: Unreference object, not handle

Jonas Bonn jonas at southpole.se
Wed May 27 19:37:01 CEST 2009


On Wed, 2009-05-27 at 17:58 +0100, Owain Ainsworth wrote:
> >  	ret = drm_gem_handle_create(file_priv, obj, &handle);
> >  	mutex_lock(&dev->struct_mutex);
> > -	drm_gem_object_handle_unreference(obj);
> > +	drm_gem_object_unreference(obj);
> >  	mutex_unlock(&dev->struct_mutex);
> 
> 
> I've had something like this in my bsd tree for a while. I'm not sure if
> the problem is that krefs default to one reference already though
> (making a handle dereference mostly correct).
> 

As I understand it, drm_gem_object_alloc() returns a referenced object.
drm_get_handle_create() also references the object, so the local
reference is no longer needed.

BUT, the handle is what we are returning from this function, so we
really don't want to dereference it... we just want to drop the local
reference on the object.

/Jonas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20090527/785cdf3c/attachment.sig>


More information about the Intel-gfx mailing list