aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaarten Lankhorst <m.b.lankhorst@gmail.com>2012-11-28 06:25:44 -0500
committerDave Airlie <airlied@redhat.com>2012-12-10 05:21:30 -0500
commit97a875cbdf89a4638eea57c2b456c7cc4e3e8b21 (patch)
tree286ff23a3f8e389ec4fa1a6f3b58cbee4fc8e9fe
parente7ab20197be3ee5fd75441e1cff0c7cdfea5bf1a (diff)
drm/ttm: remove no_wait_reserve, v3
All items on the lru list are always reservable, so this is a stupid thing to keep. Not only that, it is used in a way which would guarantee deadlocks if it were ever to be set to block on reserve. This is a lot of churn, but mostly because of the removal of the argument which can be nested arbitrarily deeply in many places. No change of code in this patch except removal of the no_wait_reserve argument, the previous patch removed the use of no_wait_reserve. v2: - Warn if -EBUSY is returned on reservation, all objects on the list should be reservable. Adjusted patch slightly due to conflicts. v3: - Focus on no_wait_reserve removal only. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--drivers/gpu/drm/ast/ast_ttm.c10
-rw-r--r--drivers/gpu/drm/cirrus/cirrus_ttm.c10
-rw-r--r--drivers/gpu/drm/mgag200/mgag200_ttm.c10
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_bo.c55
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_bo.h2
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_gem.c2
-rw-r--r--drivers/gpu/drm/radeon/radeon_object.c8
-rw-r--r--drivers/gpu/drm/radeon/radeon_ttm.c31
-rw-r--r--drivers/gpu/drm/ttm/ttm_bo.c46
-rw-r--r--drivers/gpu/drm/ttm/ttm_bo_util.c6
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_dmabuf.c13
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c4
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_resource.c2
-rw-r--r--include/drm/ttm/ttm_bo_api.h3
-rw-r--r--include/drm/ttm/ttm_bo_driver.h19
15 files changed, 107 insertions, 114 deletions
diff --git a/drivers/gpu/drm/ast/ast_ttm.c b/drivers/gpu/drm/ast/ast_ttm.c
index 0a54f65a8ebb..3602731a6112 100644
--- a/drivers/gpu/drm/ast/ast_ttm.c
+++ b/drivers/gpu/drm/ast/ast_ttm.c
@@ -186,11 +186,11 @@ static void ast_ttm_io_mem_free(struct ttm_bo_device *bdev, struct ttm_mem_reg *
186 186
187static int ast_bo_move(struct ttm_buffer_object *bo, 187static int ast_bo_move(struct ttm_buffer_object *bo,
188 bool evict, bool interruptible, 188 bool evict, bool interruptible,
189 bool no_wait_reserve, bool no_wait_gpu, 189 bool no_wait_gpu,
190 struct ttm_mem_reg *new_mem) 190 struct ttm_mem_reg *new_mem)
191{ 191{
192 int r; 192 int r;
193 r = ttm_bo_move_memcpy(bo, evict, no_wait_reserve, no_wait_gpu, new_mem); 193 r = ttm_bo_move_memcpy(bo, evict, no_wait_gpu, new_mem);
194 return r; 194 return r;
195} 195}
196 196
@@ -383,7 +383,7 @@ int ast_bo_pin(struct ast_bo *bo, u32 pl_flag, u64 *gpu_addr)
383 ast_ttm_placement(bo, pl_flag); 383 ast_ttm_placement(bo, pl_flag);
384 for (i = 0; i < bo->placement.num_placement; i++) 384 for (i = 0; i < bo->placement.num_placement; i++)
385 bo->placements[i] |= TTM_PL_FLAG_NO_EVICT; 385 bo->placements[i] |= TTM_PL_FLAG_NO_EVICT;
386 ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false, false); 386 ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false);
387 if (ret) 387 if (ret)
388 return ret; 388 return ret;
389 389
@@ -406,7 +406,7 @@ int ast_bo_unpin(struct ast_bo *bo)
406 406
407 for (i = 0; i < bo->placement.num_placement ; i++) 407 for (i = 0; i < bo->placement.num_placement ; i++)
408 bo->placements[i] &= ~TTM_PL_FLAG_NO_EVICT; 408 bo->placements[i] &= ~TTM_PL_FLAG_NO_EVICT;
409 ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false, false); 409 ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false);
410 if (ret) 410 if (ret)
411 return ret; 411 return ret;
412 412
@@ -431,7 +431,7 @@ int ast_bo_push_sysram(struct ast_bo *bo)
431 for (i = 0; i < bo->placement.num_placement ; i++) 431 for (i = 0; i < bo->placement.num_placement ; i++)
432 bo->placements[i] |= TTM_PL_FLAG_NO_EVICT; 432 bo->placements[i] |= TTM_PL_FLAG_NO_EVICT;
433 433
434 ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false, false); 434 ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false);
435 if (ret) { 435 if (ret) {
436 DRM_ERROR("pushing to VRAM failed\n"); 436 DRM_ERROR("pushing to VRAM failed\n");
437 return ret; 437 return ret;
diff --git a/drivers/gpu/drm/cirrus/cirrus_ttm.c b/drivers/gpu/drm/cirrus/cirrus_ttm.c
index 90d770143cc2..1413a26e4905 100644
--- a/drivers/gpu/drm/cirrus/cirrus_ttm.c
+++ b/drivers/gpu/drm/cirrus/cirrus_ttm.c
@@ -186,11 +186,11 @@ static void cirrus_ttm_io_mem_free(struct ttm_bo_device *bdev, struct ttm_mem_re
186 186
187static int cirrus_bo_move(struct ttm_buffer_object *bo, 187static int cirrus_bo_move(struct ttm_buffer_object *bo,
188 bool evict, bool interruptible, 188 bool evict, bool interruptible,
189 bool no_wait_reserve, bool no_wait_gpu, 189 bool no_wait_gpu,
190 struct ttm_mem_reg *new_mem) 190 struct ttm_mem_reg *new_mem)
191{ 191{
192 int r; 192 int r;
193 r = ttm_bo_move_memcpy(bo, evict, no_wait_reserve, no_wait_gpu, new_mem); 193 r = ttm_bo_move_memcpy(bo, evict, no_wait_gpu, new_mem);
194 return r; 194 return r;
195} 195}
196 196
@@ -388,7 +388,7 @@ int cirrus_bo_pin(struct cirrus_bo *bo, u32 pl_flag, u64 *gpu_addr)
388 cirrus_ttm_placement(bo, pl_flag); 388 cirrus_ttm_placement(bo, pl_flag);
389 for (i = 0; i < bo->placement.num_placement; i++) 389 for (i = 0; i < bo->placement.num_placement; i++)
390 bo->placements[i] |= TTM_PL_FLAG_NO_EVICT; 390 bo->placements[i] |= TTM_PL_FLAG_NO_EVICT;
391 ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false, false); 391 ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false);
392 if (ret) 392 if (ret)
393 return ret; 393 return ret;
394 394
@@ -411,7 +411,7 @@ int cirrus_bo_unpin(struct cirrus_bo *bo)
411 411
412 for (i = 0; i < bo->placement.num_placement ; i++) 412 for (i = 0; i < bo->placement.num_placement ; i++)
413 bo->placements[i] &= ~TTM_PL_FLAG_NO_EVICT; 413 bo->placements[i] &= ~TTM_PL_FLAG_NO_EVICT;
414 ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false, false); 414 ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false);
415 if (ret) 415 if (ret)
416 return ret; 416 return ret;
417 417
@@ -436,7 +436,7 @@ int cirrus_bo_push_sysram(struct cirrus_bo *bo)
436 for (i = 0; i < bo->placement.num_placement ; i++) 436 for (i = 0; i < bo->placement.num_placement ; i++)
437 bo->placements[i] |= TTM_PL_FLAG_NO_EVICT; 437 bo->placements[i] |= TTM_PL_FLAG_NO_EVICT;
438 438
439 ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false, false); 439 ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false);
440 if (ret) { 440 if (ret) {
441 DRM_ERROR("pushing to VRAM failed\n"); 441 DRM_ERROR("pushing to VRAM failed\n");
442 return ret; 442 return ret;
diff --git a/drivers/gpu/drm/mgag200/mgag200_ttm.c b/drivers/gpu/drm/mgag200/mgag200_ttm.c
index 49d60a620122..8fc9d9201945 100644
--- a/drivers/gpu/drm/mgag200/mgag200_ttm.c
+++ b/drivers/gpu/drm/mgag200/mgag200_ttm.c
@@ -186,11 +186,11 @@ static void mgag200_ttm_io_mem_free(struct ttm_bo_device *bdev, struct ttm_mem_r
186 186
187static int mgag200_bo_move(struct ttm_buffer_object *bo, 187static int mgag200_bo_move(struct ttm_buffer_object *bo,
188 bool evict, bool interruptible, 188 bool evict, bool interruptible,
189 bool no_wait_reserve, bool no_wait_gpu, 189 bool no_wait_gpu,
190 struct ttm_mem_reg *new_mem) 190 struct ttm_mem_reg *new_mem)
191{ 191{
192 int r; 192 int r;
193 r = ttm_bo_move_memcpy(bo, evict, no_wait_reserve, no_wait_gpu, new_mem); 193 r = ttm_bo_move_memcpy(bo, evict, no_wait_gpu, new_mem);
194 return r; 194 return r;
195} 195}
196 196
@@ -382,7 +382,7 @@ int mgag200_bo_pin(struct mgag200_bo *bo, u32 pl_flag, u64 *gpu_addr)
382 mgag200_ttm_placement(bo, pl_flag); 382 mgag200_ttm_placement(bo, pl_flag);
383 for (i = 0; i < bo->placement.num_placement; i++) 383 for (i = 0; i < bo->placement.num_placement; i++)
384 bo->placements[i] |= TTM_PL_FLAG_NO_EVICT; 384 bo->placements[i] |= TTM_PL_FLAG_NO_EVICT;
385 ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false, false); 385 ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false);
386 if (ret) 386 if (ret)
387 return ret; 387 return ret;
388 388
@@ -405,7 +405,7 @@ int mgag200_bo_unpin(struct mgag200_bo *bo)
405 405
406 for (i = 0; i < bo->placement.num_placement ; i++) 406 for (i = 0; i < bo->placement.num_placement ; i++)
407 bo->placements[i] &= ~TTM_PL_FLAG_NO_EVICT; 407 bo->placements[i] &= ~TTM_PL_FLAG_NO_EVICT;
408 ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false, false); 408 ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false);
409 if (ret) 409 if (ret)
410 return ret; 410 return ret;
411 411
@@ -430,7 +430,7 @@ int mgag200_bo_push_sysram(struct mgag200_bo *bo)
430 for (i = 0; i < bo->placement.num_placement ; i++) 430 for (i = 0; i < bo->placement.num_placement ; i++)
431 bo->placements[i] |= TTM_PL_FLAG_NO_EVICT; 431 bo->placements[i] |= TTM_PL_FLAG_NO_EVICT;
432 432
433 ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false, false); 433 ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false);
434 if (ret) { 434 if (ret) {
435 DRM_ERROR("pushing to VRAM failed\n"); 435 DRM_ERROR("pushing to VRAM failed\n");
436