diff options
| author | Ben Skeggs <bskeggs@redhat.com> | 2011-08-21 23:15:05 -0400 |
|---|---|---|
| committer | Dave Airlie <airlied@redhat.com> | 2011-08-23 04:38:30 -0400 |
| commit | 8d3bb23609d4ae22803a15d232289fc09a7b61c4 (patch) | |
| tree | f48c0874a1e5c25f39c140af99a3ba722142db98 | |
| parent | eac2095398668f989a3dd8d00be1b87850d78c01 (diff) | |
drm/ttm: ensure ttm for new node is bound before calling move_notify()
This was true for new TTM_PL_SYSTEM and new TTM_PL_TT cases, but wasn't
the case on TTM_PL_SYSTEM<->TTM_PL_TT moves, which causes trouble on some
paths as nouveau's move_notify() hook requires that the dma addresses be
valid at this point.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
| -rw-r--r-- | drivers/gpu/drm/ttm/ttm_bo.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 384116afe5b7..a4d38d85909a 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c | |||
| @@ -392,10 +392,12 @@ static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo, | |||
| 392 | * Create and bind a ttm if required. | 392 | * Create and bind a ttm if required. |
| 393 | */ | 393 | */ |
| 394 | 394 | ||
| 395 | if (!(new_man->flags & TTM_MEMTYPE_FLAG_FIXED) && (bo->ttm == NULL)) { | 395 | if (!(new_man->flags & TTM_MEMTYPE_FLAG_FIXED)) { |
| 396 | ret = ttm_bo_add_ttm(bo, false); | 396 | if (bo->ttm == NULL) { |
| 397 | if (ret) | 397 | ret = ttm_bo_add_ttm(bo, false); |
| 398 | goto out_err; | 398 | if (ret) |
| 399 | goto out_err; | ||
| 400 | } | ||
| 399 | 401 | ||
| 400 | ret = ttm_tt_set_placement_caching(bo->ttm, mem->placement); | 402 | ret = ttm_tt_set_placement_caching(bo->ttm, mem->placement); |
| 401 | if (ret) | 403 | if (ret) |
