aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2015-06-11 03:06:08 -0400
committerJani Nikula <jani.nikula@intel.com>2015-06-15 02:49:59 -0400
commit016a65a39170c3cdca09a6ac343ff4f124668b45 (patch)
tree4ba5ea405ce1aad779cf3b872f42577ec65bacfd /drivers/gpu
parent0f57d86787d8b1076ea8f9cbdddda2a46d534a27 (diff)
drm/i915: Always reset vma->ggtt_view.pages cache on unbinding
With the introduction of multiple views of an obj in the same vm, each vma was taught to cache its copy of the pages (so that different views could have different page arrangements). However, this missed decoupling those vma->ggtt_view.pages when the vma released its reference on the obj->pages. As we don't always free the vma, this leads to a possible scenario (e.g. execbuffer interrupted by the shrinker) where the vma points to a stale obj->pages, and explodes. Fixes regression from commit fe14d5f4e5468c5b80a24f1a64abcbe116143670 Author: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Date: Wed Dec 10 17:27:58 2014 +0000 drm/i915: Infrastructure for supporting different GGTT views per object Tvrtko says, if someone else will be confused how this can happen, key is the reservation execbuffer path. That puts the VMA on the exec_list which prevents i915_vma_unbind and i915_gem_vma_destroy from fully destroying the VMA. So the VMA is left existing as an empty object in the list - unbound and disassociated with the backing store. Kind of a cached memory object. And then re-using it needs to clear the cached pages pointer which is fixed above. Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1227892 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Michel Thierry <michel.thierry@intel.com> Cc: stable@vger.kernel.org Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> [Jani: Added Tvrtko's explanation to commit message.] Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 851b585987f9..c3806c66650a 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3000,8 +3000,8 @@ int i915_vma_unbind(struct i915_vma *vma)
3000 } else if (vma->ggtt_view.pages) { 3000 } else if (vma->ggtt_view.pages) {
3001 sg_free_table(vma->ggtt_view.pages); 3001 sg_free_table(vma->ggtt_view.pages);
3002 kfree(vma->ggtt_view.pages); 3002 kfree(vma->ggtt_view.pages);
3003 vma->ggtt_view.pages = NULL;
3004 } 3003 }
3004 vma->ggtt_view.pages = NULL;
3005 } 3005 }
3006 3006
3007 drm_mm_remove_node(&vma->node); 3007 drm_mm_remove_node(&vma->node);