From 9abd394a6cee133b5b56e27c05a66c95fee56852 Mon Sep 17 00:00:00 2001 From: jsg Date: Tue, 25 Jan 2022 21:31:26 +0000 Subject: [PATCH] reduce diff to linux shmem_create_from_object() includes linux 988d4ff6e3c2220d13d8dde22a98945b64fd7977 drm/i915: Fix ww locking in shmem_create_from_object --- sys/dev/pci/drm/i915/gt/shmem_utils.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/dev/pci/drm/i915/gt/shmem_utils.c b/sys/dev/pci/drm/i915/gt/shmem_utils.c index 1f95563fcc7..68e2f925a09 100644 --- a/sys/dev/pci/drm/i915/gt/shmem_utils.c +++ b/sys/dev/pci/drm/i915/gt/shmem_utils.c @@ -163,12 +163,13 @@ uao_create_from_object(struct drm_i915_gem_object *obj) struct uvm_object *uao; void *ptr; - if (obj->ops == &i915_gem_shmem_ops) { + if (i915_gem_object_is_shmem(obj)) { uao_reference(obj->base.uao); return obj->base.uao; } - ptr = i915_gem_object_pin_map(obj, I915_MAP_WB); + ptr = i915_gem_object_pin_map_unlocked(obj, i915_gem_object_is_lmem(obj) ? + I915_MAP_WC : I915_MAP_WB); if (IS_ERR(ptr)) return ERR_CAST(ptr); -- 2.20.1