drm/vmwgfx: Use bo_driver::move_notify to unbind GMRs.

This was previously done explicitly for overlay- and fb buffers.
Now it's done for any buffer leaving the SYSTEM memory region.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
Thomas Hellstrom 2010-01-13 22:28:39 +01:00 committed by Dave Airlie
parent 7704befbd5
commit effe1105be
5 changed files with 22 additions and 29 deletions

View file

@ -172,6 +172,13 @@ static int vmw_verify_access(struct ttm_buffer_object *bo, struct file *filp)
return 0;
}
static void vmw_move_notify(struct ttm_buffer_object *bo,
struct ttm_mem_reg *new_mem)
{
if (new_mem->mem_type != TTM_PL_SYSTEM)
vmw_dmabuf_gmr_unbind(bo);
}
/**
* FIXME: We're using the old vmware polling method to sync.
* Do this with fences instead.
@ -225,5 +232,6 @@ struct ttm_bo_driver vmw_bo_driver = {
.sync_obj_wait = vmw_sync_obj_wait,
.sync_obj_flush = vmw_sync_obj_flush,
.sync_obj_unref = vmw_sync_obj_unref,
.sync_obj_ref = vmw_sync_obj_ref
.sync_obj_ref = vmw_sync_obj_ref,
.move_notify = vmw_move_notify
};