mirror of
https://github.com/torvalds/linux.git
synced 2026-05-23 22:52:19 +02:00
drm/amdgpu: move sched status check inside amdgpu_ttm_set_buffer_funcs_status
It avoids duplicated code and allows to output a warning. --- v4: move check inside the existing if (enable) test --- Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
e3dc797605
commit
79a0ff59a5
|
|
@ -3156,9 +3156,7 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)
|
|||
if (r)
|
||||
goto init_failed;
|
||||
|
||||
if (adev->mman.buffer_funcs_ring &&
|
||||
adev->mman.buffer_funcs_ring->sched.ready)
|
||||
amdgpu_ttm_set_buffer_funcs_status(adev, true);
|
||||
amdgpu_ttm_set_buffer_funcs_status(adev, true);
|
||||
|
||||
/* Don't init kfd if whole hive need to be reset during init */
|
||||
if (adev->init_lvl->level != AMDGPU_INIT_LEVEL_MINIMAL_XGMI) {
|
||||
|
|
@ -4047,8 +4045,7 @@ static int amdgpu_device_ip_resume(struct amdgpu_device *adev)
|
|||
|
||||
r = amdgpu_device_ip_resume_phase2(adev);
|
||||
|
||||
if (adev->mman.buffer_funcs_ring->sched.ready)
|
||||
amdgpu_ttm_set_buffer_funcs_status(adev, true);
|
||||
amdgpu_ttm_set_buffer_funcs_status(adev, true);
|
||||
|
||||
if (r)
|
||||
return r;
|
||||
|
|
@ -5195,8 +5192,7 @@ int amdgpu_device_suspend(struct drm_device *dev, bool notify_clients)
|
|||
return 0;
|
||||
|
||||
unwind_evict:
|
||||
if (adev->mman.buffer_funcs_ring->sched.ready)
|
||||
amdgpu_ttm_set_buffer_funcs_status(adev, true);
|
||||
amdgpu_ttm_set_buffer_funcs_status(adev, true);
|
||||
amdgpu_fence_driver_hw_init(adev);
|
||||
|
||||
unwind_userq:
|
||||
|
|
@ -5930,8 +5926,7 @@ int amdgpu_device_reinit_after_reset(struct amdgpu_reset_context *reset_context)
|
|||
if (r)
|
||||
goto out;
|
||||
|
||||
if (tmp_adev->mman.buffer_funcs_ring->sched.ready)
|
||||
amdgpu_ttm_set_buffer_funcs_status(tmp_adev, true);
|
||||
amdgpu_ttm_set_buffer_funcs_status(tmp_adev, true);
|
||||
|
||||
r = amdgpu_device_ip_resume_phase3(tmp_adev);
|
||||
if (r)
|
||||
|
|
|
|||
|
|
@ -2356,6 +2356,11 @@ void amdgpu_ttm_set_buffer_funcs_status(struct amdgpu_device *adev, bool enable)
|
|||
struct amdgpu_ring *ring;
|
||||
struct drm_gpu_scheduler *sched;
|
||||
|
||||
if (!adev->mman.buffer_funcs_ring || !adev->mman.buffer_funcs_ring->sched.ready) {
|
||||
dev_warn(adev->dev, "Not enabling DMA transfers for in kernel use");
|
||||
return;
|
||||
}
|
||||
|
||||
ring = adev->mman.buffer_funcs_ring;
|
||||
sched = &ring->sched;
|
||||
r = amdgpu_ttm_buffer_entity_init(&adev->mman.gtt_mgr,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user