drm/i915: Don't use BAR mappings for ring buffers with LLC
authorjsg <jsg@openbsd.org>
Mon, 27 Mar 2023 04:27:20 +0000 (04:27 +0000)
committerjsg <jsg@openbsd.org>
Mon, 27 Mar 2023 04:27:20 +0000 (04:27 +0000)
From John Harrison
be11d0d9c4eb7c2108ce9041b9e89c86856ca596 in linux-6.1.y/6.1.16
85636167e3206c3fbd52254fc432991cc4e90194 in mainline linux

sys/dev/pci/drm/i915/gt/intel_ring.c

index fb1d259..fb99143 100644 (file)
@@ -53,7 +53,7 @@ int intel_ring_pin(struct intel_ring *ring, struct i915_gem_ww_ctx *ww)
        if (unlikely(ret))
                goto err_unpin;
 
-       if (i915_vma_is_map_and_fenceable(vma)) {
+       if (i915_vma_is_map_and_fenceable(vma) && !HAS_LLC(vma->vm->i915)) {
                addr = (void __force *)i915_vma_pin_iomap(vma);
        } else {
                int type = i915_coherent_map_type(vma->vm->i915, vma->obj, false);
@@ -98,7 +98,7 @@ void intel_ring_unpin(struct intel_ring *ring)
                return;
 
        i915_vma_unset_ggtt_write(vma);
-       if (i915_vma_is_map_and_fenceable(vma))
+       if (i915_vma_is_map_and_fenceable(vma) && !HAS_LLC(vma->vm->i915))
                i915_vma_unpin_iomap(vma);
        else
                i915_gem_object_unpin_map(vma->obj);