drm/i915: Only unwind the local pgtable layer if empty
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 27 Feb 2017 12:26:52 +0000 (12:26 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Mon, 27 Feb 2017 13:09:19 +0000 (13:09 +0000)
commitbf75d59eff679d2e2b7af5c6958a088f8a458f7a
tree209ec2333db313a9b293dc5cfdc4f589a992f445
parent69060d96440b83da151989d83fd180eb05d84780
drm/i915: Only unwind the local pgtable layer if empty

Only if we allocated the layer and the lower level failed should we
remove this layer when unwinding. Otherwise we ignore the overlapping
entries by overwriting the old layer with scratch.

Fixes: c5d092a4293f ("drm/i915: Remove bitmap tracking for used-pml4")
Fixes: e2b763caa6eb ("drm/i915: Remove bitmap tracking for used-pdpes")
Reported-by: Matthew Auld <matthew.william.auld@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99947
Testcase: igt/drv_selftest/live_gtt
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Matthew Auld <matthew.william.auld@gmail.com>
Tested-by: Matthew Auld <matthew.auld@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170227122654.27651-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_gem_gtt.c