]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Handle pagefaults in execbuffer user relocations
authorChris Wilson <chris@chris-wilson.co.uk>
Sun, 21 Nov 2010 22:07:12 +0000 (22:07 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Tue, 23 Nov 2010 20:11:43 +0000 (20:11 +0000)
commit35d73208f454a7fcd09e24fe33ed6fc2b9a1dccf
treefa83645166876c378d911a8db8e6433e89a52179
parentb3277b530b81e75581d4bb32216e37b70301cdac
drm/i915: Handle pagefaults in execbuffer user relocations

Currently if we hit a pagefault when applying a user relocation for the
execbuffer, we bail and return EFAULT to the application. Instead, we
need to unwind, drop the dev->struct_mutex, copy all the relocation
entries to a vmalloc array (to avoid any potential circular deadlocks
when resolving the pagefault), retake the mutex and then apply the
relocations.  Afterwards, we need to again drop the lock and copy the
vmalloc array back to userspace.

v2: Incorporate feedback from Daniel Vetter.

Reported-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_gem.c