]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Revoke fenced GTT mmapings across GPU reset
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 4 Jan 2017 14:51:10 +0000 (14:51 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Wed, 4 Jan 2017 18:44:30 +0000 (18:44 +0000)
commit8997a1f35ed6228a4f3e5d3402c28d862bc6ba2f
tree83388fc33c306eb9655d2f5048d22f686b127724
parent112927b2255979be392e615f2f757eec65882e4a
drm/i915: Revoke fenced GTT mmapings across GPU reset

The fence registers are clobbered by a GPU reset. If there is concurrent
user access to a fenced region via a GTT mmaping, the access will not be
fenced during the reset (until we restore the fences afterwards). In order
to prevent invalid access during the reset, before we clobber the fences
first we must invalidate the GTT mmapings. Access to the mmap will then
be forced to fault in the page, and in handling the fault, i915_gem_fault()
will take the struct_mutex and wait upon the reset to complete.

v2: Fix up commentary.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99274
Testcase: igt/gem_mmap_gtt/hang
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: http://patchwork.freedesktop.org/patch/msgid/20170104145110.1486-1-chris@chris-wilson.co.uk
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/i915_gem_fence_reg.c