summaryrefslogtreecommitdiff
path: root/sys/dev/pci/drm
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/pci/drm')
-rw-r--r--sys/dev/pci/drm/i915/gem/i915_gem_mman.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/dev/pci/drm/i915/gem/i915_gem_mman.c b/sys/dev/pci/drm/i915/gem/i915_gem_mman.c
index e9d978d3e5e..14daad18e21 100644
--- a/sys/dev/pci/drm/i915/gem/i915_gem_mman.c
+++ b/sys/dev/pci/drm/i915/gem/i915_gem_mman.c
@@ -563,6 +563,9 @@ vm_fault_cpu(struct i915_mmap_offset *mmo, struct uvm_faultinfo *ufi,
return VM_PAGER_BAD;
}
+ if (i915_gem_object_lock_interruptible(obj, NULL))
+ return VM_PAGER_ERROR;
+
err = i915_gem_object_pin_pages(obj);
if (err)
goto out;
@@ -602,6 +605,7 @@ vm_fault_cpu(struct i915_mmap_offset *mmo, struct uvm_faultinfo *ufi,
i915_gem_object_unpin_pages(obj);
out:
+ i915_gem_object_unlock(obj);
uvmfault_unlockall(ufi, NULL, &obj->base.uobj);
return i915_error_to_vmf_fault(err);
}