aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/ttm
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2016-06-15 07:44:02 -0400
committerAlex Deucher <alexander.deucher@amd.com>2016-07-07 14:54:40 -0400
commitf849c6d6527a4108b1d7813e1a0eac9f1568cc4b (patch)
tree0d3e39ee3533d68a0de4e6567bf8481d6327d9ad /drivers/gpu/drm/ttm
parent5bc730677b1698c479f0134926b90789759b17ee (diff)
drm/ttm: simplify ttm_bo_wait
As far as I can see no need for a custom implementation any more. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/ttm')
-rw-r--r--drivers/gpu/drm/ttm/ttm_bo.c37
1 files changed, 4 insertions, 33 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index caa657d31ce3..28cd5352f8d0 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -1546,46 +1546,17 @@ EXPORT_SYMBOL(ttm_bo_unmap_virtual);
1546int ttm_bo_wait(struct ttm_buffer_object *bo, 1546int ttm_bo_wait(struct ttm_buffer_object *bo,
1547 bool interruptible, bool no_wait) 1547 bool interruptible, bool no_wait)
1548{ 1548{
1549 struct reservation_object_list *fobj; 1549 long timeout = no_wait ? 0 : 15 * HZ;
1550 struct reservation_object *resv;
1551 struct fence *excl;
1552 long timeout = 15 * HZ;
1553 int i;
1554
1555 resv = bo->resv;
1556 fobj = reservation_object_get_list(resv);
1557 excl = reservation_object_get_excl(resv);
1558 if (excl) {
1559 if (!fence_is_signaled(excl)) {
1560 if (no_wait)
1561 return -EBUSY;
1562
1563 timeout = fence_wait_timeout(excl,
1564 interruptible, timeout);
1565 }
1566 }
1567
1568 for (i = 0; fobj && timeout > 0 && i < fobj->shared_count; ++i) {
1569 struct fence *fence;
1570 fence = rcu_dereference_protected(fobj->shared[i],
1571 reservation_object_held(resv));
1572
1573 if (!fence_is_signaled(fence)) {
1574 if (no_wait)
1575 return -EBUSY;
1576
1577 timeout = fence_wait_timeout(fence,
1578 interruptible, timeout);
1579 }
1580 }
1581 1550
1551 timeout = reservation_object_wait_timeout_rcu(bo->resv, true,
1552 interruptible, timeout);
1582 if (timeout < 0) 1553 if (timeout < 0)
1583 return timeout; 1554 return timeout;
1584 1555
1585 if (timeout == 0) 1556 if (timeout == 0)
1586 return -EBUSY; 1557 return -EBUSY;
1587 1558
1588 reservation_object_add_excl_fence(resv, NULL); 1559 reservation_object_add_excl_fence(bo->resv, NULL);
1589 return 0; 1560 return 0;
1590} 1561}
1591EXPORT_SYMBOL(ttm_bo_wait); 1562EXPORT_SYMBOL(ttm_bo_wait);