From 1333f723fb6f1356a54135586f1ede44dcaa9652 Mon Sep 17 00:00:00 2001 From: Jammy Zhou Date: Thu, 30 Jul 2015 16:36:58 +0800 Subject: drm/amdgpu: add amdgpu.sched_jobs option This option can be used to specify the max job number in the job queue, and it is 16 by default. Signed-off-by: Jammy Zhou Reviewed-by: Chunming Zhou --- drivers/gpu/drm/amd/scheduler/gpu_scheduler.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'drivers/gpu/drm/amd/scheduler/gpu_scheduler.c') diff --git a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c index 5799474808e9..87993e06ba37 100644 --- a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c +++ b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c @@ -173,6 +173,7 @@ exit: * @parent The parent entity of this amd_context_entity * @rq The run queue this entity belongs * @context_id The context id for this entity + * @jobs The max number of jobs in the job queue * * return 0 if succeed. negative error code on failure */ @@ -180,7 +181,8 @@ int amd_context_entity_init(struct amd_gpu_scheduler *sched, struct amd_context_entity *entity, struct amd_sched_entity *parent, struct amd_run_queue *rq, - uint32_t context_id) + uint32_t context_id, + uint32_t jobs) { uint64_t seq_ring = 0; @@ -196,7 +198,7 @@ int amd_context_entity_init(struct amd_gpu_scheduler *sched, init_waitqueue_head(&entity->wait_queue); init_waitqueue_head(&entity->wait_emit); if(kfifo_alloc(&entity->job_queue, - AMD_MAX_JOB_ENTRY_PER_CONTEXT * sizeof(void *), + jobs * sizeof(void *), GFP_KERNEL)) return -EINVAL; -- cgit v1.2.3