Lines Matching full:backup
42 struct vmw_buffer_object *backup = res->backup; in vmw_resource_mob_attach() local
43 struct rb_node **new = &backup->res_tree.rb_node, *parent = NULL; in vmw_resource_mob_attach()
45 dma_resv_assert_held(res->backup->base.base.resv); in vmw_resource_mob_attach()
59 rb_insert_color(&res->mob_node, &backup->res_tree); in vmw_resource_mob_attach()
61 vmw_bo_prio_add(backup, res->used_prio); in vmw_resource_mob_attach()
70 struct vmw_buffer_object *backup = res->backup; in vmw_resource_mob_detach() local
72 dma_resv_assert_held(backup->base.base.resv); in vmw_resource_mob_detach()
74 rb_erase(&res->mob_node, &backup->res_tree); in vmw_resource_mob_detach()
76 vmw_bo_prio_del(backup, res->used_prio); in vmw_resource_mob_detach()
123 if (res->backup) { in vmw_resource_release()
124 struct ttm_buffer_object *bo = &res->backup->base; in vmw_resource_release()
141 vmw_bo_dirty_release(res->backup); in vmw_resource_release()
143 vmw_bo_unreference(&res->backup); in vmw_resource_release()
226 res->backup = NULL; in vmw_resource_init()
348 * vmw_resource_buf_alloc - Allocate a backup buffer for a resource.
350 * @res: The resource for which to allocate a backup buffer.
358 struct vmw_buffer_object *backup; in vmw_resource_buf_alloc() local
361 if (likely(res->backup)) { in vmw_resource_buf_alloc()
362 BUG_ON(res->backup->base.base.size < size); in vmw_resource_buf_alloc()
369 &vmw_bo_bo_free, &backup); in vmw_resource_buf_alloc()
373 res->backup = backup; in vmw_resource_buf_alloc()
385 * containing backup data if a bind operation is needed.
416 * Handle the case where the backup mob is marked coherent but in vmw_resource_do_validate()
421 if (res->backup->dirty && !res->dirty) { in vmw_resource_do_validate()
425 } else if (!res->backup->dirty && res->dirty) { in vmw_resource_do_validate()
441 vmw_bo_dirty_unmap(res->backup, start, end); in vmw_resource_do_validate()
463 * @switch_backup: Backup buffer has been switched.
464 * @new_backup: Pointer to new backup buffer if command submission
466 * @new_backup_offset: New backup offset if @switch_backup is true.
483 if (switch_backup && new_backup != res->backup) { in vmw_resource_unreserve()
484 if (res->backup) { in vmw_resource_unreserve()
487 vmw_bo_dirty_release(res->backup); in vmw_resource_unreserve()
488 vmw_bo_unreference(&res->backup); in vmw_resource_unreserve()
492 res->backup = vmw_bo_reference(new_backup); in vmw_resource_unreserve()
502 res->backup = NULL; in vmw_resource_unreserve()
505 vmw_bo_dirty_release(res->backup); in vmw_resource_unreserve()
524 * vmw_resource_check_buffer - Check whether a backup buffer is needed
529 * @res: The resource for which to allocate a backup buffer.
533 * reserved and validated backup buffer.
546 if (unlikely(res->backup == NULL)) { in vmw_resource_check_buffer()
553 ttm_bo_get(&res->backup->base); in vmw_resource_check_buffer()
554 val_buf->bo = &res->backup->base; in vmw_resource_check_buffer()
565 ret = ttm_bo_validate(&res->backup->base, in vmw_resource_check_buffer()
580 vmw_bo_unreference(&res->backup); in vmw_resource_check_buffer()
591 * a backup buffer is present for guest-backed resources. However,
605 if (res->func->needs_backup && res->backup == NULL && in vmw_resource_reserve()
609 DRM_ERROR("Failed to allocate a backup buffer " in vmw_resource_reserve()
621 * backup buffer
624 * @val_buf: Backup buffer information.
644 * to a backup buffer.
689 * On successful return, any backup DMA buffer pointed to by @res->backup will
712 if (res->backup) in vmw_resource_validate()
713 val_buf.bo = &res->backup->base; in vmw_resource_validate()
735 /* Trylock backup buffers with a NULL ticket. */ in vmw_resource_validate()
753 else if (!res->func->needs_backup && res->backup) { in vmw_resource_validate()
755 vmw_bo_unreference(&res->backup); in vmw_resource_validate()
770 * Evicts the Guest Backed hardware resource if the backup
774 * both require the backup buffer to be reserved.
893 * vmw_resource_needs_backup - Return whether a resource needs a backup buffer.
932 /* Wait lock backup buffers with a ticket. */ in vmw_resource_evict_type()
997 if (res->backup) { in vmw_resource_pin()
998 vbo = res->backup; in vmw_resource_pin()
1052 if (--res->pin_count == 0 && res->backup) { in vmw_resource_unpin()
1053 struct vmw_buffer_object *vbo = res->backup; in vmw_resource_unpin()