Commit f2f12eb9 authored by Christian König's avatar Christian König
Browse files

drm/scheduler: provide scheduler score externally



Allow multiple schedulers to share the load balancing score.

This is useful when one engine has different hw rings.

Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-and-Tested-by: default avatarLeo Liu <leo.liu@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210204144405.2737-1-christian.koenig@amd.com
parent f4a84e16
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -487,7 +487,7 @@ int amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring,

		r = drm_sched_init(&ring->sched, &amdgpu_sched_ops,
				   num_hw_submission, amdgpu_job_hang_limit,
				   timeout, ring->name);
				   timeout, NULL, ring->name);
		if (r) {
			DRM_ERROR("Failed to create scheduler on ring %s.\n",
				  ring->name);
+1 −1
Original line number Diff line number Diff line
@@ -190,7 +190,7 @@ int etnaviv_sched_init(struct etnaviv_gpu *gpu)

	ret = drm_sched_init(&gpu->sched, &etnaviv_sched_ops,
			     etnaviv_hw_jobs_limit, etnaviv_job_hang_limit,
			     msecs_to_jiffies(500), dev_name(gpu->dev));
			     msecs_to_jiffies(500), NULL, dev_name(gpu->dev));
	if (ret)
		return ret;

+1 −1
Original line number Diff line number Diff line
@@ -509,7 +509,7 @@ int lima_sched_pipe_init(struct lima_sched_pipe *pipe, const char *name)

	return drm_sched_init(&pipe->base, &lima_sched_ops, 1,
			      lima_job_hang_limit, msecs_to_jiffies(timeout),
			      name);
			      NULL, name);
}

void lima_sched_pipe_fini(struct lima_sched_pipe *pipe)
+1 −1
Original line number Diff line number Diff line
@@ -627,7 +627,7 @@ int panfrost_job_init(struct panfrost_device *pfdev)
		ret = drm_sched_init(&js->queue[j].sched,
				     &panfrost_sched_ops,
				     1, 0, msecs_to_jiffies(JOB_TIMEOUT_MS),
				     "pan_js");
				     NULL, "pan_js");
		if (ret) {
			dev_err(pfdev->dev, "Failed to create scheduler: %d.", ret);
			goto err_sched;
+1 −1
Original line number Diff line number Diff line
@@ -489,7 +489,7 @@ void drm_sched_entity_push_job(struct drm_sched_job *sched_job,
	bool first;

	trace_drm_sched_job(sched_job, entity);
	atomic_inc(&entity->rq->sched->score);
	atomic_inc(entity->rq->sched->score);
	WRITE_ONCE(entity->last_user, current->group_leader);
	first = spsc_queue_push(&entity->job_queue, &sched_job->queue_node);

Loading