drm/nouveau: slowpath for pushbuf ioctl
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 4 Nov 2019 17:38:00 +0000 (18:38 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 6 Nov 2019 10:23:27 +0000 (11:23 +0100)
commit03e0d26fcf791e48164ff7c280c71225c361a89e
tree48830c229cb2901bbdbcf3ad8bd44db0a777b478
parentb2a8116e25923643e9613ac5b65dd6e78dc5ee77
drm/nouveau: slowpath for pushbuf ioctl

We can't copy_*_user while holding reservations, that will (soon even
for nouveau) lead to deadlocks. And it breaks the cross-driver
contract around dma_resv.

Fix this by adding a slowpath for when we need relocations, and by
pushing the writeback of the new presumed offsets to the very end.

Aside from "it compiles" entirely untested unfortunately.

Cc: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: nouveau@lists.freedesktop.org
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Dave Airlie <airlied@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191104173801.2972-2-daniel.vetter@ffwll.ch
drivers/gpu/drm/nouveau/nouveau_gem.c