diff options
author | David P <megver83@parabola.nu> | 2020-03-30 18:23:49 -0400 |
---|---|---|
committer | David P <megver83@parabola.nu> | 2020-03-30 18:23:49 -0400 |
commit | 72c9ab660ff2d9068ffb126e3ee45aba10877507 (patch) | |
tree | 17bc24fe8efd8b02be9f30acd94c604e964eb1cd /kernels/linux-libre-xtreme/0006-drm-i915-gem-Avoid-parking-the-vma-as-we-unbind.patch | |
parent | f9ec026b6d59348459a8e57046587d5a4ae7e4a1 (diff) | |
download | abslibre-72c9ab660ff2d9068ffb126e3ee45aba10877507.tar.gz abslibre-72c9ab660ff2d9068ffb126e3ee45aba10877507.tar.bz2 abslibre-72c9ab660ff2d9068ffb126e3ee45aba10877507.zip |
updpkg: kernels/linux-libre-xtreme 5.5.13-1
Signed-off-by: David P <megver83@parabola.nu>
Diffstat (limited to 'kernels/linux-libre-xtreme/0006-drm-i915-gem-Avoid-parking-the-vma-as-we-unbind.patch')
-rw-r--r-- | kernels/linux-libre-xtreme/0006-drm-i915-gem-Avoid-parking-the-vma-as-we-unbind.patch | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/kernels/linux-libre-xtreme/0006-drm-i915-gem-Avoid-parking-the-vma-as-we-unbind.patch b/kernels/linux-libre-xtreme/0006-drm-i915-gem-Avoid-parking-the-vma-as-we-unbind.patch new file mode 100644 index 000000000..0ff019a0f --- /dev/null +++ b/kernels/linux-libre-xtreme/0006-drm-i915-gem-Avoid-parking-the-vma-as-we-unbind.patch @@ -0,0 +1,63 @@ +From 6d55f899daa078d167aa497b71c9e7fd5f3d57fb Mon Sep 17 00:00:00 2001 +From: Chris Wilson <chris@chris-wilson.co.uk> +Date: Tue, 3 Dec 2019 15:50:32 +0000 +Subject: [PATCH 06/11] drm/i915/gem: Avoid parking the vma as we unbind + +In order to avoid keeping a reference on the i915_vma (which is long +overdue!) we have to coordinate all the possible lifetimes and only use +the vma while we know it is alive. In this episode, we are reminded that +while idle, the closed vma are destroyed. So if the GT idles while we are +working with the vma, the vma itself becomes invalid. + +First class i915_vma here we come, but in the meantime keep piling on +the straw. + +Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> +Reviewed-by: Matthew Auld <matthew.auld@intel.com> +Link: https://patchwork.freedesktop.org/patch/msgid/20191203155032.3137263-1-chris@chris-wilson.co.uk +--- + drivers/gpu/drm/i915/i915_gem.c | 17 ++++++++++++++++- + 1 file changed, 16 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c +index ed2436db5dd2..739543812422 100644 +--- a/drivers/gpu/drm/i915/i915_gem.c ++++ b/drivers/gpu/drm/i915/i915_gem.c +@@ -141,18 +141,33 @@ int i915_gem_object_unbind(struct drm_i915_gem_object *obj, + struct i915_vma, + obj_link))) { + struct i915_address_space *vm = vma->vm; ++ bool awake = false; + +- ret = -EBUSY; ++ ret = -EAGAIN; + if (!i915_vm_tryopen(vm)) + break; + ++ /* Prevent vma being freed by i915_vma_parked as we unbind */ ++ if (intel_gt_pm_get_if_awake(vm->gt)) { ++ awake = true; ++ } else { ++ if (i915_vma_is_closed(vma)) { ++ spin_unlock(&obj->vma.lock); ++ goto err_vm; ++ } ++ } ++ + list_move_tail(&vma->obj_link, &still_in_list); + spin_unlock(&obj->vma.lock); + ++ ret = -EBUSY; + if (flags & I915_GEM_OBJECT_UNBIND_ACTIVE || + !i915_vma_is_active(vma)) + ret = i915_vma_unbind(vma); + ++ if (awake) ++ intel_gt_pm_put(vm->gt); ++err_vm: + i915_vm_close(vm); + spin_lock(&obj->vma.lock); + } +-- +2.26.0 + |