spin_unlock(&chunk->lock);
}
+static void nouveau_dmem_fence_done(struct nouveau_fence **fence)
+{
+ if (fence) {
+ nouveau_fence_wait(*fence, true, false);
+ nouveau_fence_unref(fence);
+ } else {
+ /*
+ * FIXME wait for channel to be IDLE before calling finalizing
+ * the hmem object.
+ */
+ }
+}
+
static void
nouveau_dmem_fault_alloc_and_copy(struct vm_area_struct *vma,
const unsigned long *src_pfns,
{
struct nouveau_drm *drm = fault->drm;
- if (fault->fence) {
- nouveau_fence_wait(fault->fence, true, false);
- nouveau_fence_unref(&fault->fence);
- } else {
- /*
- * FIXME wait for channel to be IDLE before calling finalizing
- * the hmem object below (nouveau_migrate_hmem_fini()).
- */
- }
+ nouveau_dmem_fence_done(&fault->fence);
while (fault->npages--) {
dma_unmap_page(drm->dev->dev, fault->dma[fault->npages],
{
struct nouveau_drm *drm = migrate->drm;
- if (migrate->fence) {
- nouveau_fence_wait(migrate->fence, true, false);
- nouveau_fence_unref(&migrate->fence);
- } else {
- /*
- * FIXME wait for channel to be IDLE before finalizing
- * the hmem object below (nouveau_migrate_hmem_fini()) ?
- */
- }
+ nouveau_dmem_fence_done(&migrate->fence);
while (migrate->dma_nr--) {
dma_unmap_page(drm->dev->dev, migrate->dma[migrate->dma_nr],