aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorMonk Liu <Monk.Liu@amd.com>2017-10-17 01:40:54 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-12-04 16:33:08 -0500
commit95aa9b1d9738faa80c66df41d59358d5ff4c288a (patch)
tree645d3243c941228cf093ea9c0c784e42c5b8c2e5 /drivers/gpu
parent2f9d4084cac96a0281522b548ca0526c1e241b75 (diff)
drm/amdgpu:add hang_limit for sched(v2)
since gpu_scheduler source domain cannot access amdgpu variable so need create the hang_limit membewr for sched, and it can refer it for the upcoming GPU RESET patches v2: make hang_limit a parameter of sched_init() Signed-off-by: Monk Liu <Monk.Liu@amd.com> Reviewed-by: Chunming Zhou <David1.Zhou@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c2
-rw-r--r--drivers/gpu/drm/amd/scheduler/gpu_scheduler.c6
-rw-r--r--drivers/gpu/drm/amd/scheduler/gpu_scheduler.h3
3 files changed, 8 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
index 219c15f79a5d..72e8eacc2c03 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
@@ -446,7 +446,7 @@ int amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring,
446 timeout = MAX_SCHEDULE_TIMEOUT; 446 timeout = MAX_SCHEDULE_TIMEOUT;
447 } 447 }
448 r = amd_sched_init(&ring->sched, &amdgpu_sched_ops, 448 r = amd_sched_init(&ring->sched, &amdgpu_sched_ops,
449 num_hw_submission, 449 num_hw_submission, amdgpu_job_hang_limit,
450 timeout, ring->name); 450 timeout, ring->name);
451 if (r) { 451 if (r) {
452 DRM_ERROR("Failed to create scheduler on ring %s.\n", 452 DRM_ERROR("Failed to create scheduler on ring %s.\n",
diff --git a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
index 9061c88e3e0c..5a1ece2774b5 100644
--- a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
+++ b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
@@ -676,13 +676,17 @@ static int amd_sched_main(void *param)
676*/ 676*/
677int amd_sched_init(struct amd_gpu_scheduler *sched, 677int amd_sched_init(struct amd_gpu_scheduler *sched,
678 const struct amd_sched_backend_ops *ops, 678 const struct amd_sched_backend_ops *ops,
679 unsigned hw_submission, long timeout, const char *name) 679 unsigned hw_submission,
680 unsigned hang_limit,
681 long timeout,
682 const char *name)
680{ 683{
681 int i; 684 int i;
682 sched->ops = ops; 685 sched->ops = ops;
683 sched->hw_submission_limit = hw_submission; 686 sched->hw_submission_limit = hw_submission;
684 sched->name = name; 687 sched->name = name;
685 sched->timeout = timeout; 688 sched->timeout = timeout;
689 sched->hang_limit = hang_limit;
686 for (i = AMD_SCHED_PRIORITY_MIN; i < AMD_SCHED_PRIORITY_MAX; i++) 690 for (i = AMD_SCHED_PRIORITY_MIN; i < AMD_SCHED_PRIORITY_MAX; i++)
687 amd_sched_rq_init(&sched->sched_rq[i]); 691 amd_sched_rq_init(&sched->sched_rq[i]);
688 692
diff --git a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h
index 3f75b45ed958..3ea75a2f35d4 100644
--- a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h
+++ b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h
@@ -144,11 +144,12 @@ struct amd_gpu_scheduler {
144 struct task_struct *thread; 144 struct task_struct *thread;
145 struct list_head ring_mirror_list; 145 struct list_head ring_mirror_list;
146 spinlock_t job_list_lock; 146 spinlock_t job_list_lock;
147 int hang_limit;
147}; 148};
148 149
149int amd_sched_init(struct amd_gpu_scheduler *sched, 150int amd_sched_init(struct amd_gpu_scheduler *sched,
150 const struct amd_sched_backend_ops *ops, 151 const struct amd_sched_backend_ops *ops,
151 uint32_t hw_submission, long timeout, const char *name); 152 uint32_t hw_submission, unsigned hang_limit, long timeout, const char *name);
152void amd_sched_fini(struct amd_gpu_scheduler *sched); 153void amd_sched_fini(struct amd_gpu_scheduler *sched);
153 154
154int amd_sched_entity_init(struct amd_gpu_scheduler *sched, 155int amd_sched_entity_init(struct amd_gpu_scheduler *sched,