drm/nouveau/ttm: wait for bo fence to signal before unmapping vmas
authorBen Skeggs <bskeggs@redhat.com>
Mon, 12 Dec 2016 07:52:45 +0000 (17:52 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 Jan 2017 07:21:50 +0000 (08:21 +0100)
commit28d18643068671b6e63100d5d14acb22725fcbad
tree3003bd050f53cdbf979c3f71f23ae406d9d3cac6
parent82d9824d94467b20469dde7291c68012a36e80bf
drm/nouveau/ttm: wait for bo fence to signal before unmapping vmas

commit 10dcab3e7f477bffee88d518aad57d06777cfdf4 upstream.

TTM was changed a while back to allow for pipelining of buffer moves, and
part of this was the removal of waiting for a BO to idle before calling
move(), placing the responsibility on the driver to do this if required.

That's all well and good, except, we make use of move_notify() to handle
mapping/unmapping from the GPU VMM as move() isn't called on all paths.

This commit adds a wait before unmapping from a VMM in move_notify(), to
prevent GPU page faults where a buffer is still being accessed.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/nouveau/nouveau_bo.c