[PATCH 1/1] one mmap offset allow per object per file
Tvrtko Ursulin
tvrtko.ursulin at linux.intel.com
Fri Jan 6 13:05:20 UTC 2023
From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
---
drivers/gpu/drm/i915/gem/i915_gem_mman.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
index 4f69bff63068..be6be6424806 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
@@ -696,8 +696,12 @@ mmap_offset_attach(struct drm_i915_gem_object *obj,
mmo = insert_mmo(obj, mmo);
GEM_BUG_ON(lookup_mmo(obj, mmap_type) != mmo);
out:
- if (file)
- drm_vma_node_allow(&mmo->vma_node, file);
+ if (file) {
+ spin_lock(&obj->mmo.lock);
+ if (!drm_vma_node_is_allowed(&mmo->vma_node, file))
+ drm_vma_node_allow(&mmo->vma_node, file);
+ spin_unlock(&obj->mmo.lock);
+ }
return mmo;
err:
--
2.34.1
More information about the Intel-gfx-trybot
mailing list