s2e/source/s2e-linux-kernel/decree-cgc-cfe/drivers/gpu/drm/radeon/radeon_gem.c
/*
 * Call from drm_gem_handle_create which appear in both new and open ioctl
 * case.
 */
Call from drm_gem_handle_create which appear in both new and open ioctl
case.
Call from drm_gem_handle_create which appear in both new and open ioctl case .
int radeon_gem_object_open(struct drm_gem_object *obj, struct drm_file *file_priv)
{
	struct radeon_bo *rbo = gem_to_radeon_bo(obj);
	struct radeon_device *rdev = rbo->rdev;
	struct radeon_fpriv *fpriv = file_priv->driver_priv;
	struct radeon_vm *vm = &fpriv->vm;
	struct radeon_bo_va *bo_va;
	int r;
	if (rdev->family < CHIP_CAYMAN) {
		return 0;
	}
	r = radeon_bo_reserve(rbo, false);
	if (r) {
		return r;
	}
	bo_va = radeon_vm_bo_find(vm, rbo);
	if (!bo_va) {
		bo_va = radeon_vm_bo_add(rdev, vm, rbo);
	} else {
		++bo_va->ref_count;
	}
	radeon_bo_unreserve(rbo);
	return 0;
}
int radeon_gem_object_open ( struct drm_gem_object * obj , struct drm_file * file_priv ) { struct radeon_bo * rbo = gem_to_radeon_bo ( obj ) ; struct radeon_device * rdev = rbo -> rdev ; struct radeon_fpriv * fpriv = file_priv -> driver_priv ; struct radeon_vm * vm = & fpriv -> vm ; struct radeon_bo_va * bo_va ; int r ; if ( rdev -> family < CHIP_CAYMAN ) { return 0 ; } r = radeon_bo_reserve ( rbo , false ) ; if ( r ) { return r ; } bo_va = radeon_vm_bo_find ( vm , rbo ) ; if ( ! bo_va ) { bo_va = radeon_vm_bo_add ( rdev , vm , rbo ) ; } else { ++ bo_va -> ref_count ; } radeon_bo_unreserve ( rbo ) ; return 0 ; }
Call from drm_gem_handle_create which appear in both new and open ioctl
 case.
Call from drm_gem_handle_create which appear in both new and open ioctl case .