Skip to content

Commit

Permalink
drm/ttm: ensure ttm for new node is bound before calling move_notify()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ben Skeggs authored and Dave Airlie committed Aug 23, 2011
1 parent eac2095 commit 8d3bb23
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions drivers/gpu/drm/ttm/ttm_bo.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,10 +392,12 @@ static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo,
* Create and bind a ttm if required.
*/

if (!(new_man->flags & TTM_MEMTYPE_FLAG_FIXED) && (bo->ttm == NULL)) {
ret = ttm_bo_add_ttm(bo, false);
if (ret)
goto out_err;
if (!(new_man->flags & TTM_MEMTYPE_FLAG_FIXED)) {
if (bo->ttm == NULL) {
ret = ttm_bo_add_ttm(bo, false);
if (ret)
goto out_err;
}

ret = ttm_tt_set_placement_caching(bo->ttm, mem->placement);
if (ret)
Expand Down

0 comments on commit 8d3bb23

Please sign in to comment.