All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: luben.tuikov@amd.com, dri-devel@lists.freedesktop.org,
	amd-gfx@lists.freedesktop.org
Cc: "Christian König" <christian.koenig@amd.com>
Subject: [PATCH 13/13] drm/scheduler: rename dependency callback into prepare_job
Date: Fri, 14 Oct 2022 10:46:41 +0200	[thread overview]
Message-ID: <20221014084641.128280-14-christian.koenig@amd.com> (raw)
In-Reply-To: <20221014084641.128280-1-christian.koenig@amd.com>

This now matches much better what this is doing.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_job.c  |  4 ++--
 drivers/gpu/drm/scheduler/sched_entity.c |  4 ++--
 include/drm/gpu_scheduler.h              | 13 ++++++-------
 3 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
index b8494c3b3b8a..1c4a13693653 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
@@ -237,7 +237,7 @@ int amdgpu_job_submit_direct(struct amdgpu_job *job, struct amdgpu_ring *ring,
 }
 
 static struct dma_fence *
-amdgpu_job_dependency(struct drm_sched_job *sched_job,
+amdgpu_job_prepare_job(struct drm_sched_job *sched_job,
 		      struct drm_sched_entity *s_entity)
 {
 	struct amdgpu_ring *ring = to_amdgpu_ring(s_entity->rq->sched);
@@ -326,7 +326,7 @@ void amdgpu_job_stop_all_jobs_on_sched(struct drm_gpu_scheduler *sched)
 }
 
 const struct drm_sched_backend_ops amdgpu_sched_ops = {
-	.dependency = amdgpu_job_dependency,
+	.prepare_job = amdgpu_job_prepare_job,
 	.run_job = amdgpu_job_run,
 	.timedout_job = amdgpu_job_timedout,
 	.free_job = amdgpu_job_free_cb
diff --git a/drivers/gpu/drm/scheduler/sched_entity.c b/drivers/gpu/drm/scheduler/sched_entity.c
index 54ac37cd5017..cf68cd1559ec 100644
--- a/drivers/gpu/drm/scheduler/sched_entity.c
+++ b/drivers/gpu/drm/scheduler/sched_entity.c
@@ -397,8 +397,8 @@ drm_sched_job_dependency(struct drm_sched_job *job,
 	if (!xa_empty(&job->dependencies))
 		return xa_erase(&job->dependencies, job->last_dependency++);
 
-	if (job->sched->ops->dependency)
-		return job->sched->ops->dependency(job, entity);
+	if (job->sched->ops->prepare_job)
+		return job->sched->ops->prepare_job(job, entity);
 
 	return NULL;
 }
diff --git a/include/drm/gpu_scheduler.h b/include/drm/gpu_scheduler.h
index b1698819ad38..163385e15597 100644
--- a/include/drm/gpu_scheduler.h
+++ b/include/drm/gpu_scheduler.h
@@ -306,7 +306,7 @@ struct drm_sched_job {
 	 */
 	union {
 		struct dma_fence_cb		finish_cb;
-		struct irq_work 		work;
+		struct irq_work			work;
 	};
 
 	uint64_t			id;
@@ -347,18 +347,17 @@ enum drm_gpu_sched_stat {
  */
 struct drm_sched_backend_ops {
 	/**
-	 * @dependency:
+	 * @prepare_job:
 	 *
 	 * Called when the scheduler is considering scheduling this job next, to
 	 * get another struct dma_fence for this job to block on.  Once it
 	 * returns NULL, run_job() may be called.
 	 *
-	 * If a driver exclusively uses drm_sched_job_add_dependency() and
-	 * drm_sched_job_add_implicit_dependencies() this can be ommitted and
-	 * left as NULL.
+	 * Can be NULL if no additional preparation to the dependencies are
+	 * necessary. Skipped when jobs are killed instead of run.
 	 */
-	struct dma_fence *(*dependency)(struct drm_sched_job *sched_job,
-					struct drm_sched_entity *s_entity);
+	struct dma_fence *(*prepare_job)(struct drm_sched_job *sched_job,
+					 struct drm_sched_entity *s_entity);
 
 	/**
          * @run_job: Called to execute the job once all of the dependencies
-- 
2.25.1


  parent reply	other threads:[~2022-10-14  8:48 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-14  8:46 Fixes for scheduler hang when killing a process Christian König
2022-10-14  8:46 ` [PATCH 01/13] drm/scheduler: fix fence ref counting Christian König
2022-10-25  3:23   ` Luna Nova
2022-10-25 11:35     ` Christian König
2022-10-14  8:46 ` [PATCH 02/13] drm/scheduler: add drm_sched_job_add_resv_dependencies Christian König
2022-10-14  8:46 ` [PATCH 03/13] drm/amdgpu: use drm_sched_job_add_resv_dependencies for moves Christian König
2022-10-14  8:46 ` [PATCH 04/13] drm/amdgpu: drop the fence argument from amdgpu_vmid_grab Christian König
2022-10-14  8:46 ` [PATCH 05/13] drm/amdgpu: drop amdgpu_sync " Christian König
2022-10-23  1:25   ` Luben Tuikov
2022-10-24 10:54     ` Christian König
2022-10-14  8:46 ` [PATCH 06/13] drm/amdgpu: cleanup scheduler job initialization Christian König
2022-10-23  1:50   ` Luben Tuikov
2022-10-14  8:46 ` [PATCH 07/13] drm/amdgpu: move explicit sync check into the CS Christian König
2022-10-14  8:46 ` [PATCH 08/13] drm/amdgpu: use scheduler depenencies for VM updates Christian König
2022-10-24  5:50   ` Luben Tuikov
2022-10-14  8:46 ` [PATCH 09/13] drm/amdgpu: use scheduler depenencies for UVD msgs Christian König
2022-10-24  5:53   ` Luben Tuikov
2022-10-14  8:46 ` [PATCH 10/13] drm/amdgpu: use scheduler depenencies for CS Christian König
2022-10-24  5:55   ` Luben Tuikov
2022-12-21 15:34   ` Mike Lothian
2022-12-21 15:47     ` Mike Lothian
2022-12-21 15:52     ` Luben Tuikov
2022-12-21 15:55       ` Mike Lothian
2022-10-14  8:46 ` [PATCH 11/13] drm/scheduler: remove drm_sched_dependency_optimized Christian König
2022-10-14  8:46 ` [PATCH 12/13] drm/scheduler: rework entity flush, kill and fini Christian König
2022-11-17  2:36   ` Dmitry Osipenko
2022-11-17  9:53     ` Christian König
2022-11-17 12:47       ` Dmitry Osipenko
2022-11-17 12:55         ` Christian König
2022-11-17 12:59           ` Dmitry Osipenko
2022-11-17 13:00             ` Dmitry Osipenko
2022-11-17 13:11               ` Christian König
2022-11-17 14:41                 ` Dmitry Osipenko
2022-11-17 15:09                   ` Christian König
2022-11-17 15:11                     ` Dmitry Osipenko
2022-12-28 16:27                       ` Rob Clark
2022-12-28 16:52                         ` Rob Clark
2023-01-01 18:29                           ` youling257
2023-01-02  9:24                             ` Dmitry Osipenko
2023-01-02 14:17                               ` youling 257
2023-01-02 14:17                                 ` youling 257
2023-01-02 15:08                                 ` Dmitry Osipenko
2023-01-02 15:08                                   ` Dmitry Osipenko
2022-12-26 16:01   ` [12/13] " Jonathan Marek
2022-10-14  8:46 ` Christian König [this message]
2022-10-23  1:35 ` Fixes for scheduler hang when killing a process Luben Tuikov
2022-10-24  7:00 ` Luben Tuikov
  -- strict thread matches above, loose matches on Subject: below --
2022-09-29 13:21 [PATCH 01/13] drm/scheduler: fix fence ref counting Christian König
2022-09-29 13:21 ` [PATCH 13/13] drm/scheduler: rename dependency callback into prepare_job Christian König

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221014084641.128280-14-christian.koenig@amd.com \
    --to=ckoenig.leichtzumerken@gmail.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=luben.tuikov@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.