Lines Matching refs:obj
478 drm_gem_object_reference(struct drm_gem_object *obj)
480 kref_get(&obj->refcount);
484 drm_gem_object_unreference(struct drm_gem_object *obj)
486 if (obj != NULL)
487 kref_put(&obj->refcount, drm_gem_object_free);
491 drm_gem_object_unreference_unlocked(struct drm_gem_object *obj)
493 if (obj != NULL) {
494 struct drm_device *dev = obj->dev;
496 kref_put(&obj->refcount, drm_gem_object_free);
502 drm_gem_object_handle_reference(struct drm_gem_object *obj)
504 drm_gem_object_reference(obj);
505 atomic_inc(&obj->handle_count);
509 drm_gem_object_handle_unreference(struct drm_gem_object *obj)
511 if (obj == NULL)
514 if (atomic_read(&obj->handle_count) == 0)
521 if (atomic_dec_and_test(&obj->handle_count))
522 drm_gem_object_handle_free(obj);
523 drm_gem_object_unreference(obj);
527 drm_gem_object_handle_unreference_unlocked(struct drm_gem_object *obj)
529 if (obj == NULL)
532 if (atomic_read(&obj->handle_count) == 0)
541 if (atomic_dec_and_test(&obj->handle_count))
542 drm_gem_object_handle_free(obj);
543 drm_gem_object_unreference_unlocked(obj);