Exemple #1
0
void
drm_gem_object_handle_unreference_unlocked(struct drm_gem_object *obj)
{

	if (obj == NULL ||
	    atomic_load_acq_int(&obj->handle_count) == 0)
		return;

	if (atomic_fetchadd_int(&obj->handle_count, -1) == 1)
		drm_gem_object_handle_free(obj);
	drm_gem_object_unreference_unlocked(obj);
}
Exemple #2
0
static void
drm_gem_object_handle_unreference_unlocked(struct drm_gem_object *obj)
{
    struct drm_device *dev = obj->dev;
    bool final = false;

    if (WARN_ON(obj->handle_count == 0))
        return;

    /*
    * Must bump handle count first as this may be the last
    * ref, in which case the object would disappear before we
    * checked for a name
    */

    mutex_lock(&dev->object_name_lock);
    if (--obj->handle_count == 0) {
        drm_gem_object_handle_free(obj);
        drm_gem_object_exported_dma_buf_free(obj);
        final = true;