drm/ttm: don't wait for BO on initial allocation
authorChristian König <christian.koenig@amd.com>
Wed, 6 Apr 2016 09:12:02 +0000 (11:12 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 5 May 2016 00:21:15 +0000 (20:21 -0400)
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>
drivers/gpu/drm/ttm/ttm_bo.c

index 870a87a2224e4b227367aa63532dc3741dddb13a..c1f22cb3ea43b461cb3978bb524315cc58d974eb 100644 (file)
@@ -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;