add recovery entity to gart. Change-Id: Ieb400c8a731ef25619ea3c0b5198a6e7ce56580e Signed-off-by: Chunming Zhou <David1.Zhou at amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 3 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index daf07ff..419a33b 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h @@ -646,6 +646,7 @@ struct amdgpu_gart { #endif bool ready; const struct amdgpu_gart_funcs *gart_funcs; + struct amd_sched_entity recover_entity; }; int amdgpu_gart_table_ram_alloc(struct amdgpu_device *adev); @@ -656,6 +657,8 @@ int amdgpu_gart_table_vram_pin(struct amdgpu_device *adev); void amdgpu_gart_table_vram_unpin(struct amdgpu_device *adev); int amdgpu_gart_init(struct amdgpu_device *adev); void amdgpu_gart_fini(struct amdgpu_device *adev); +int amdgpu_gart_late_init(struct amdgpu_device *adev); +void amdgpu_gart_late_fini(struct amdgpu_device *adev); void amdgpu_gart_unbind(struct amdgpu_device *adev, unsigned offset, int pages); int amdgpu_gart_bind(struct amdgpu_device *adev, unsigned offset, diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c index 921bce2..c1f226b 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c @@ -363,3 +363,21 @@ void amdgpu_gart_fini(struct amdgpu_device *adev) #endif amdgpu_dummy_page_fini(adev); } + +int amdgpu_gart_late_init(struct amdgpu_device *adev) +{ + struct amd_sched_rq *rq; + struct amdgpu_ring *ring = adev->mman.buffer_funcs_ring; + + rq = &ring->sched.sched_rq[AMD_SCHED_PRIORITY_RECOVER]; + return amd_sched_entity_init(&ring->sched, &adev->gart.recover_entity, + rq, amdgpu_sched_jobs); + +} + +void amdgpu_gart_late_fini(struct amdgpu_device *adev) +{ + struct amdgpu_ring *ring = adev->mman.buffer_funcs_ring; + + amd_sched_entity_fini(&ring->sched, &adev->gart.recover_entity); +} -- 1.9.1