summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2016-04-06 11:12:02 +0200
committerAlex Deucher <alexander.deucher@amd.com>2016-05-04 20:21:15 -0400
commit5ee7b41a8b83e5d73d8b0725561ba43de5cb9443 (patch)
treebb9db3d9a36fe7987152ae2d82bc25ef780d7a88
parenteb4309690061abe21bb37b09692e57ca4fca0968 (diff)
downloadtalos-obmc-linux-5ee7b41a8b83e5d73d8b0725561ba43de5cb9443.tar.gz
talos-obmc-linux-5ee7b41a8b83e5d73d8b0725561ba43de5cb9443.zip
drm/ttm: don't wait for BO on initial allocation
When we use an extern reservation object that otherwise waits for every fence registered with it. Reviewed-by: Sinclair Yeh <syeh@vmware.com> Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/ttm/ttm_bo.c18
1 files 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;
OpenPOWER on IntegriCloud