Commit 2040ec97 authored by Dave Airlie's avatar Dave Airlie
Browse files

drm/ttm: split populate out from binding.



Drivers have to call populate themselves now before binding.

Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200915024007.67163-5-airlied@gmail.com
parent 395a73f8
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -547,8 +547,12 @@ static int amdgpu_move_vram_ram(struct ttm_buffer_object *bo, bool evict,
		goto out_cleanup;
	}

	r = ttm_tt_populate(bo->bdev, bo->ttm, ctx);
	if (unlikely(r))
		goto out_cleanup;

	/* Bind the memory to the GTT space */
	r = ttm_tt_bind(bo->bdev, bo->ttm, &tmp_mem, ctx);
	r = ttm_tt_bind(bo->bdev, bo->ttm, &tmp_mem);
	if (unlikely(r)) {
		goto out_cleanup;
	}
+5 −1
Original line number Diff line number Diff line
@@ -920,7 +920,11 @@ nouveau_bo_move_flipd(struct ttm_buffer_object *bo, bool evict, bool intr,
	if (ret)
		return ret;

	ret = ttm_tt_bind(bo->bdev, bo->ttm, &tmp_reg, &ctx);
	ret = ttm_tt_populate(bo->bdev, bo->ttm, &ctx);
	if (ret)
		goto out;

	ret = ttm_tt_bind(bo->bdev, bo->ttm, &tmp_reg);
	if (ret)
		goto out;

+6 −1
Original line number Diff line number Diff line
@@ -233,7 +233,12 @@ static int radeon_move_vram_ram(struct ttm_buffer_object *bo,
		goto out_cleanup;
	}

	r = ttm_tt_bind(bo->bdev, bo->ttm, &tmp_mem, &ctx);
	r = ttm_tt_populate(bo->bdev, bo->ttm, &ctx);
	if (unlikely(r)) {
		goto out_cleanup;
	}

	r = ttm_tt_bind(bo->bdev, bo->ttm, &tmp_mem);
	if (unlikely(r)) {
		goto out_cleanup;
	}
+5 −1
Original line number Diff line number Diff line
@@ -260,7 +260,11 @@ static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo,
			goto out_err;

		if (mem->mem_type != TTM_PL_SYSTEM) {
			ret = ttm_tt_bind(bdev, bo->ttm, mem, ctx);
			ret = ttm_tt_populate(bdev, bo->ttm, ctx);
			if (ret)
				goto out_err;

			ret = ttm_tt_bind(bdev, bo->ttm, mem);
			if (ret)
				goto out_err;
		}
+6 −1
Original line number Diff line number Diff line
@@ -77,7 +77,12 @@ int ttm_bo_move_ttm(struct ttm_buffer_object *bo,
		return ret;

	if (new_mem->mem_type != TTM_PL_SYSTEM) {
		ret = ttm_tt_bind(bo->bdev, ttm, new_mem, ctx);

		ret = ttm_tt_populate(bo->bdev, ttm, ctx);
		if (unlikely(ret != 0))
			return ret;

		ret = ttm_tt_bind(bo->bdev, ttm, new_mem);
		if (unlikely(ret != 0))
			return ret;
	}
Loading