summaryrefslogtreecommitdiff
path: root/libre/linux-libre/0007-drm-i915-gem-Try-to-flush-pending-unbind-events.patch
diff options
context:
space:
mode:
authorDavid P <megver83@parabola.nu>2020-03-24 12:17:15 -0400
committerDavid P <megver83@parabola.nu>2020-03-24 12:17:15 -0400
commit5560856fa9dfaa0432e1b6a0166dd7584413b4b8 (patch)
treea1c0c0d19521586f4b6e79324675c45ca5aa10b8 /libre/linux-libre/0007-drm-i915-gem-Try-to-flush-pending-unbind-events.patch
parent21a4aa6a2397bcefa38c44cfaba2dfba37730ce0 (diff)
downloadabslibre-5560856fa9dfaa0432e1b6a0166dd7584413b4b8.tar.gz
abslibre-5560856fa9dfaa0432e1b6a0166dd7584413b4b8.tar.bz2
abslibre-5560856fa9dfaa0432e1b6a0166dd7584413b4b8.zip
updpkg: libre/linux-libre 5.5.11-1
Signed-off-by: David P <megver83@parabola.nu>
Diffstat (limited to 'libre/linux-libre/0007-drm-i915-gem-Try-to-flush-pending-unbind-events.patch')
-rw-r--r--libre/linux-libre/0007-drm-i915-gem-Try-to-flush-pending-unbind-events.patch64
1 files changed, 64 insertions, 0 deletions
diff --git a/libre/linux-libre/0007-drm-i915-gem-Try-to-flush-pending-unbind-events.patch b/libre/linux-libre/0007-drm-i915-gem-Try-to-flush-pending-unbind-events.patch
new file mode 100644
index 000000000..49df07f9e
--- /dev/null
+++ b/libre/linux-libre/0007-drm-i915-gem-Try-to-flush-pending-unbind-events.patch
@@ -0,0 +1,64 @@
+From 846865567a7570b072f881618335035aef030098 Mon Sep 17 00:00:00 2001
+From: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Wed, 4 Dec 2019 12:35:56 +0000
+Subject: [PATCH 07/11] drm/i915/gem: Try to flush pending unbind events
+
+If we cannot handle a vma within the unbind loop, try to flush the
+pending events (i915_vma_parked, i915_vm_release) and try again. This
+avoids a round trip to userspace that is not guaranteed to make forward
+progress, as the events we wait upon require being idle.
+
+References: cb6c3d45f948 ("drm/i915/gem: Avoid parking the vma as we unbind")
+Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+Cc: Matthew Auld <matthew.auld@intel.com>
+Reviewed-by: Matthew Auld <matthew.auld@intel.com>
+Link: https://patchwork.freedesktop.org/patch/msgid/20191204123556.3740002-1-chris@chris-wilson.co.uk
+---
+ drivers/gpu/drm/i915/i915_gem.c | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
+index 739543812422..85b12228c2cf 100644
+--- a/drivers/gpu/drm/i915/i915_gem.c
++++ b/drivers/gpu/drm/i915/i915_gem.c
+@@ -123,7 +123,7 @@ int i915_gem_object_unbind(struct drm_i915_gem_object *obj,
+ LIST_HEAD(still_in_list);
+ intel_wakeref_t wakeref;
+ struct i915_vma *vma;
+- int ret = 0;
++ int ret;
+
+ if (!atomic_read(&obj->bind_count))
+ return 0;
+@@ -136,6 +136,8 @@ int i915_gem_object_unbind(struct drm_i915_gem_object *obj,
+ */
+ wakeref = intel_runtime_pm_get(rpm);
+
++try_again:
++ ret = 0;
+ spin_lock(&obj->vma.lock);
+ while (!ret && (vma = list_first_entry_or_null(&obj->vma.list,
+ struct i915_vma,
+@@ -153,6 +155,7 @@ int i915_gem_object_unbind(struct drm_i915_gem_object *obj,
+ } else {
+ if (i915_vma_is_closed(vma)) {
+ spin_unlock(&obj->vma.lock);
++ i915_vma_parked(vm->gt);
+ goto err_vm;
+ }
+ }
+@@ -174,6 +177,11 @@ int i915_gem_object_unbind(struct drm_i915_gem_object *obj,
+ list_splice(&still_in_list, &obj->vma.list);
+ spin_unlock(&obj->vma.lock);
+
++ if (ret == -EAGAIN && flags & I915_GEM_OBJECT_UNBIND_ACTIVE) {
++ rcu_barrier(); /* flush the i915_vm_release() */
++ goto try_again;
++ }
++
+ intel_runtime_pm_put(rpm, wakeref);
+
+ return ret;
+--
+2.25.2
+