linux/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
/**
 * vmw_kms_helper_buffer_prepare - Reserve and validate a buffer object before
 * command submission.
 *
 * @dev_priv. Pointer to a device private structure.
 * @buf: The buffer object
 * @interruptible: Whether to perform waits as interruptible.
 * @validate_as_mob: Whether the buffer should be validated as a MOB. If false,
 * The buffer will be validated as a GMR. Already pinned buffers will not be
 * validated.
 *
 * Returns 0 on success, negative error code on failure, -ERESTARTSYS if
 * interrupted by a signal.
 */
Reserve and validate a buffer object before
command submission.



Returns 0 on success, negative error code on failure, -ERESTARTSYS if
interrupted by a signal.
Reserve and validate a buffer object before command submission . Returns 0 on success negative error code on failure - ERESTARTSYS if interrupted by a signal .
int vmw_kms_helper_buffer_prepare(struct vmw_private *dev_priv,
				  struct vmw_buffer_object *buf,
				  bool interruptible,
				  bool validate_as_mob,
				  bool for_cpu_blit)
{
	struct ttm_operation_ctx ctx = {
		.interruptible = interruptible,
		.no_wait_gpu = false};
	struct ttm_buffer_object *bo = &buf->base;
	int ret;
	ttm_bo_reserve(bo, false, false, NULL);
	if (for_cpu_blit)
		ret = ttm_bo_validate(bo, &vmw_nonfixed_placement, &ctx);
	else
		ret = vmw_validate_single_buffer(dev_priv, bo, interruptible,
						 validate_as_mob);
	if (ret)
		ttm_bo_unreserve(bo);
	return ret;
}
int vmw_kms_helper_buffer_prepare ( struct vmw_private * dev_priv , struct vmw_buffer_object * buf , bool interruptible , bool validate_as_mob , bool for_cpu_blit ) { struct ttm_operation_ctx ctx = { . interruptible = interruptible , . no_wait_gpu = false } ; struct ttm_buffer_object * bo = & buf -> base ; int ret ; ttm_bo_reserve ( bo , false , false , NULL ) ; if ( for_cpu_blit ) ret = ttm_bo_validate ( bo , & vmw_nonfixed_placement , & ctx ) ; else ret = vmw_validate_single_buffer ( dev_priv , bo , interruptible , validate_as_mob ) ; if ( ret ) ttm_bo_unreserve ( bo ) ; return ret ; }
vmw_kms_helper_buffer_prepare - Reserve and validate a buffer object before
 command submission.
vmw_kms_helper_buffer_prepare - Reserve and validate a buffer object before command submission .