Commit bdbbf7d6 authored by Chris Wilson's avatar Chris Wilson Committed by Daniel Vetter

drm/i915: Clear execbuf's vma backpointer upon release

commit 2889caa9 ("drm/i915: Eliminate lots of iterations over the
execobjects array") jiggled around the error handling and replace a test
that we cleaned up properly after ourselves with an assertion. That
assertion failed because in the release function (moments after the
assertion) we were indeed forgetting to mark the vma as cleared. The
consequence was when testing an invalid relocation address, we would try
to release the vma twice (following the couple of attempts to verify the
address) and on the second release notice that the first release was
incomplete.

Testcase: igt/gem_reloc_overflow/invalid-address
Fixes: 2889caa9 ("drm/i915: Eliminate lots of iterations over the execobjects array")
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170622104722.2583-1-chris@chris-wilson.co.ukReviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
(cherry picked from commit 51d05e1b)
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent b88eb199
...@@ -878,6 +878,7 @@ static void eb_release_vmas(const struct i915_execbuffer *eb) ...@@ -878,6 +878,7 @@ static void eb_release_vmas(const struct i915_execbuffer *eb)
GEM_BUG_ON(vma->exec_entry != entry); GEM_BUG_ON(vma->exec_entry != entry);
vma->exec_entry = NULL; vma->exec_entry = NULL;
__exec_to_vma(entry) = 0;
if (entry->flags & __EXEC_OBJECT_HAS_PIN) if (entry->flags & __EXEC_OBJECT_HAS_PIN)
__eb_unreserve_vma(vma, entry); __eb_unreserve_vma(vma, entry);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment