drm/radeon: Fall back to evicting BOs with memcpy if necessary.
Otherwise if there's no GTT space we would fail the eviction, leading to cascaded failure. Signed-off-by: Michel Dänzer <daenzer@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
committed by
Dave Airlie
parent
e46074effd
commit
1ab2e10599
@@ -355,23 +355,26 @@ static int radeon_bo_move(struct ttm_buffer_object *bo,
|
|||||||
if (!rdev->cp.ready) {
|
if (!rdev->cp.ready) {
|
||||||
/* use memcpy */
|
/* use memcpy */
|
||||||
DRM_ERROR("CP is not ready use memcpy.\n");
|
DRM_ERROR("CP is not ready use memcpy.\n");
|
||||||
return ttm_bo_move_memcpy(bo, evict, no_wait, new_mem);
|
goto memcpy;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (old_mem->mem_type == TTM_PL_VRAM &&
|
if (old_mem->mem_type == TTM_PL_VRAM &&
|
||||||
new_mem->mem_type == TTM_PL_SYSTEM) {
|
new_mem->mem_type == TTM_PL_SYSTEM) {
|
||||||
return radeon_move_vram_ram(bo, evict, interruptible,
|
r = radeon_move_vram_ram(bo, evict, interruptible,
|
||||||
no_wait, new_mem);
|
no_wait, new_mem);
|
||||||
} else if (old_mem->mem_type == TTM_PL_SYSTEM &&
|
} else if (old_mem->mem_type == TTM_PL_SYSTEM &&
|
||||||
new_mem->mem_type == TTM_PL_VRAM) {
|
new_mem->mem_type == TTM_PL_VRAM) {
|
||||||
return radeon_move_ram_vram(bo, evict, interruptible,
|
r = radeon_move_ram_vram(bo, evict, interruptible,
|
||||||
no_wait, new_mem);
|
no_wait, new_mem);
|
||||||
} else {
|
} else {
|
||||||
r = radeon_move_blit(bo, evict, no_wait, new_mem, old_mem);
|
r = radeon_move_blit(bo, evict, no_wait, new_mem, old_mem);
|
||||||
if (unlikely(r)) {
|
|
||||||
return r;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (r) {
|
||||||
|
memcpy:
|
||||||
|
r = ttm_bo_move_memcpy(bo, evict, no_wait, new_mem);
|
||||||
}
|
}
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user