mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-21 10:06:00 +07:00
drm/amdgpu: don't use ttm_bo_move_ttm in amdgpu_ttm_bind v2
Just allocate the GART space and fill it. This prevents forcing the BO to be idle. v2: don't unbind/bind at all, just fill the allocated GART space Signed-off-by: Christian König <christian.koenig@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
c5835bbb11
commit
40575732b6
@ -878,9 +878,11 @@ static int amdgpu_ttm_backend_bind(struct ttm_tt *ttm,
|
|||||||
int amdgpu_ttm_alloc_gart(struct ttm_buffer_object *bo)
|
int amdgpu_ttm_alloc_gart(struct ttm_buffer_object *bo)
|
||||||
{
|
{
|
||||||
struct amdgpu_device *adev = amdgpu_ttm_adev(bo->bdev);
|
struct amdgpu_device *adev = amdgpu_ttm_adev(bo->bdev);
|
||||||
|
struct amdgpu_ttm_tt *gtt = (void*)bo->ttm;
|
||||||
struct ttm_mem_reg tmp;
|
struct ttm_mem_reg tmp;
|
||||||
struct ttm_placement placement;
|
struct ttm_placement placement;
|
||||||
struct ttm_place placements;
|
struct ttm_place placements;
|
||||||
|
uint64_t flags;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
if (bo->mem.mem_type != TTM_PL_TT ||
|
if (bo->mem.mem_type != TTM_PL_TT ||
|
||||||
@ -902,14 +904,21 @@ int amdgpu_ttm_alloc_gart(struct ttm_buffer_object *bo)
|
|||||||
if (unlikely(r))
|
if (unlikely(r))
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
r = ttm_bo_move_ttm(bo, true, false, &tmp);
|
flags = amdgpu_ttm_tt_pte_flags(adev, bo->ttm, &tmp);
|
||||||
if (unlikely(r))
|
gtt->offset = (u64)tmp.start << PAGE_SHIFT;
|
||||||
|
r = amdgpu_gart_bind(adev, gtt->offset, bo->ttm->num_pages,
|
||||||
|
bo->ttm->pages, gtt->ttm.dma_address, flags);
|
||||||
|
if (unlikely(r)) {
|
||||||
ttm_bo_mem_put(bo, &tmp);
|
ttm_bo_mem_put(bo, &tmp);
|
||||||
else
|
return r;
|
||||||
bo->offset = (bo->mem.start << PAGE_SHIFT) +
|
}
|
||||||
bo->bdev->man[bo->mem.mem_type].gpu_offset;
|
|
||||||
|
|
||||||
return r;
|
ttm_bo_mem_put(bo, &bo->mem);
|
||||||
|
bo->mem = tmp;
|
||||||
|
bo->offset = (bo->mem.start << PAGE_SHIFT) +
|
||||||
|
bo->bdev->man[bo->mem.mem_type].gpu_offset;
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int amdgpu_ttm_recover_gart(struct ttm_buffer_object *tbo)
|
int amdgpu_ttm_recover_gart(struct ttm_buffer_object *tbo)
|
||||||
|
Loading…
Reference in New Issue
Block a user