@@ -884,28 +884,16 @@ nouveau_bo_move_flipd(struct ttm_buffer_object *bo, bool evict,
struct ttm_operation_ctx *ctx,
struct ttm_resource *new_reg)
{
- struct ttm_place placement_memtype = {
- .fpfn = 0,
- .lpfn = 0,
- .mem_type = TTM_PL_TT,
- .flags = TTM_PL_MASK_CACHING
- };
- struct ttm_placement placement;
struct ttm_resource tmp_reg;
int ret;
- placement.num_placement = placement.num_busy_placement = 1;
- placement.placement = placement.busy_placement = &placement_memtype;
-
- tmp_reg = *new_reg;
- tmp_reg.mm_node = NULL;
- ret = ttm_bo_mem_space(bo, &placement, &tmp_reg, ctx);
+ ret = ttm_bo_create_tt_tmp(bo, ctx, new_reg, &tmp_reg);
if (ret)
return ret;
ret = ttm_tt_populate(bo->bdev, bo->ttm, ctx);
if (ret)
- goto out;
+ return ret;
ret = nouveau_ttm_tt_bind(bo->bdev, bo->ttm, &tmp_reg);
if (ret)
@@ -936,22 +924,10 @@ nouveau_bo_move_flips(struct ttm_buffer_object *bo, bool evict,
struct ttm_operation_ctx *ctx,
struct ttm_resource *new_reg)
{
- struct ttm_place placement_memtype = {
- .fpfn = 0,
- .lpfn = 0,
- .mem_type = TTM_PL_TT,
- .flags = TTM_PL_MASK_CACHING
- };
- struct ttm_placement placement;
struct ttm_resource tmp_reg;
int ret;
- placement.num_placement = placement.num_busy_placement = 1;
- placement.placement = placement.busy_placement = &placement_memtype;
-
- tmp_reg = *new_reg;
- tmp_reg.mm_node = NULL;
- ret = ttm_bo_mem_space(bo, &placement, &tmp_reg, ctx);
+ ret = ttm_bo_create_tt_tmp(bo, ctx, new_reg, &tmp_reg);
if (ret)
return ret;