summaryrefslogtreecommitdiff
path: root/sys/dev/pci/drm
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2022-01-25 21:19:22 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2022-01-25 21:19:22 +0000
commit0ba628a074ff07708f1d99bcd43b5f2d4b45fbe9 (patch)
tree73da11f80914d6ecf8bd1a4a918935229cf0e3a8 /sys/dev/pci/drm
parentb1bac822f82ed4b767cc82258df157af17d956ba (diff)
reduce diff to linux vm_fault_cpu()
adds change made in linux 9fa1f4785f2a54286ccb8a850cda5661f0a3aaf9 drm/i915: Add object locking to vm_fault_cpu
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);
}