drm/ttm: add context to driver move callback as well
Instead of passing the parameters manually. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Chunming Zhou <david1.zhou@amd.com> Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de> Tested-by: Michel Dänzer <michel.daenzer@amd.com> Acked-by: Felix Kuehling <Felix.Kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:

committed by
Alex Deucher

parent
83876c1bed
commit
2823f4f019
@@ -393,17 +393,16 @@ out_cleanup:
|
||||
return r;
|
||||
}
|
||||
|
||||
static int radeon_bo_move(struct ttm_buffer_object *bo,
|
||||
bool evict, bool interruptible,
|
||||
bool no_wait_gpu,
|
||||
struct ttm_mem_reg *new_mem)
|
||||
static int radeon_bo_move(struct ttm_buffer_object *bo, bool evict,
|
||||
struct ttm_operation_ctx *ctx,
|
||||
struct ttm_mem_reg *new_mem)
|
||||
{
|
||||
struct radeon_device *rdev;
|
||||
struct radeon_bo *rbo;
|
||||
struct ttm_mem_reg *old_mem = &bo->mem;
|
||||
int r;
|
||||
|
||||
r = ttm_bo_wait(bo, interruptible, no_wait_gpu);
|
||||
r = ttm_bo_wait(bo, ctx->interruptible, ctx->no_wait_gpu);
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
@@ -433,19 +432,21 @@ static int radeon_bo_move(struct ttm_buffer_object *bo,
|
||||
|
||||
if (old_mem->mem_type == TTM_PL_VRAM &&
|
||||
new_mem->mem_type == TTM_PL_SYSTEM) {
|
||||
r = radeon_move_vram_ram(bo, evict, interruptible,
|
||||
no_wait_gpu, new_mem);
|
||||
r = radeon_move_vram_ram(bo, evict, ctx->interruptible,
|
||||
ctx->no_wait_gpu, new_mem);
|
||||
} else if (old_mem->mem_type == TTM_PL_SYSTEM &&
|
||||
new_mem->mem_type == TTM_PL_VRAM) {
|
||||
r = radeon_move_ram_vram(bo, evict, interruptible,
|
||||
no_wait_gpu, new_mem);
|
||||
r = radeon_move_ram_vram(bo, evict, ctx->interruptible,
|
||||
ctx->no_wait_gpu, new_mem);
|
||||
} else {
|
||||
r = radeon_move_blit(bo, evict, no_wait_gpu, new_mem, old_mem);
|
||||
r = radeon_move_blit(bo, evict, ctx->no_wait_gpu,
|
||||
new_mem, old_mem);
|
||||
}
|
||||
|
||||
if (r) {
|
||||
memcpy:
|
||||
r = ttm_bo_move_memcpy(bo, interruptible, no_wait_gpu, new_mem);
|
||||
r = ttm_bo_move_memcpy(bo, ctx->interruptible,
|
||||
ctx->no_wait_gpu, new_mem);
|
||||
if (r) {
|
||||
return r;
|
||||
}
|
||||
|
Reference in New Issue
Block a user