From 5ee7b41a8b83e5d73d8b0725561ba43de5cb9443 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Christian=20K=C3=B6nig?= Date: Wed, 6 Apr 2016 11:12:02 +0200 Subject: [PATCH] drm/ttm: don't wait for BO on initial allocation MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit When we use an extern reservation object that otherwise waits for every fence registered with it. Reviewed-by: Sinclair Yeh Signed-off-by: Christian König Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher --- drivers/gpu/drm/ttm/ttm_bo.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 870a87a2224e..c1f22cb3ea43 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -998,13 +998,19 @@ static int ttm_bo_move_buffer(struct ttm_buffer_object *bo, lockdep_assert_held(&bo->resv->lock.base); /* - * FIXME: It's possible to pipeline buffer moves. - * Have the driver move function wait for idle when necessary, - * instead of doing it here. + * Don't wait for the BO on initial allocation. This is important when + * the BO has an imported reservation object. */ - ret = ttm_bo_wait(bo, false, interruptible, no_wait_gpu); - if (ret) - return ret; + if (bo->mem.mem_type != TTM_PL_SYSTEM || bo->ttm != NULL) { + /* + * FIXME: It's possible to pipeline buffer moves. + * Have the driver move function wait for idle when necessary, + * instead of doing it here. + */ + ret = ttm_bo_wait(bo, false, interruptible, no_wait_gpu); + if (ret) + return ret; + } mem.num_pages = bo->num_pages; mem.size = mem.num_pages << PAGE_SHIFT; mem.page_alignment = bo->mem.page_alignment; -- 2.39.5