Skip to contentSkip to conversation

drm/sched: Delete unused update_job_credits

PATCH Applied Tvrtko Ursulin 2 participants 2 messages Jan 10, 2025 – Jan 13, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/sched: Delete unused update_job_credits

No driver is using the update_job_credits() schduler vfunc so lets remove it.

---
 drivers/gpu/drm/scheduler/sched_main.c | 13 -------------
 include/drm/gpu_scheduler.h            | 13 -------------
 2 files changed, 26 deletions(-)
drivers/gpu/drm/scheduler/sched_main.c +0 -13
index 57da84908752..81d69c2ff6ab 100644
@@ -64,12 +64,6 @@
  * credit limit, the job won't be executed. Instead, the scheduler will wait
  * until the credit count has decreased enough to not overflow its credit limit.
  * This implies waiting for previously executed jobs.
- *
- * Optionally, drivers may register a callback (update_job_credits) provided by
- * struct drm_sched_backend_ops to update the job's credits dynamically. The
- * scheduler executes this callback every time the scheduler considers a job for
- * execution and subsequently checks whether the job fits the scheduler's credit
- * limit.
  */
 
 #include <linux/wait.h>
@@ -133,13 +127,6 @@ static bool drm_sched_can_queue(struct drm_gpu_scheduler *sched,
 	if (!s_job)
 		return false;
 
-	if (sched->ops->update_job_credits) {
-		s_job->credits = sched->ops->update_job_credits(s_job);
-
-		drm_WARN(sched, !s_job->credits,
-			 "Jobs with zero credits bypass job-flow control.\n");
-	}
-
 	/* If a job exceeds the credit limit, truncate it to the credit limit
 	 * itself to guarantee forward progress.
 	 */
include/drm/gpu_scheduler.h +0 -13
index 95e17504e46a..e2e6af8849c6 100644
@@ -476,19 +476,6 @@ struct drm_sched_backend_ops {
          * and it's time to clean it up.
 	 */
 	void (*free_job)(struct drm_sched_job *sched_job);
-
-	/**
-	 * @update_job_credits: Called when the scheduler is considering this
-	 * job for execution.
-	 *
-	 * This callback returns the number of credits the job would take if
-	 * pushed to the hardware. Drivers may use this to dynamically update
-	 * the job's credit count. For instance, deduct the number of credits
-	 * for already signalled native fences.
-	 *
-	 * This callback is optional.
-	 */
-	u32 (*update_job_credits)(struct drm_sched_job *sched_job);
 };
 
 /**
Signature · 1 line
2.47.1
#1 lore raw
Quoted 11 lines · Tvrtko Ursulin

No driver is using the update_job_credits() schduler vfunc so lets remove it.

Applied to drm-misc-next

Thank you Tvrtko

P.

Quoted 76 lines

---
 drivers/gpu/drm/scheduler/sched_main.c | 13 ------------- include/drm/gpu_scheduler.h            | 13 -------------

 2 files changed, 26 deletions(-)
drivers/gpu/drm/scheduler/sched_main.c +0 -0
index 57da84908752..81d69c2ff6ab 100644
@@ -64,12 +64,6 @@
   * credit limit, the job won't be executed. Instead, the scheduler

will wait
  * until the credit count has decreased enough to not overflow its credit limit.
  * This implies waiting for previously executed jobs.
- *
- * Optionally, drivers may register a callback (update_job_credits) provided by
- * struct drm_sched_backend_ops to update the job's credits dynamically. The
- * scheduler executes this callback every time the scheduler considers a job for
- * execution and subsequently checks whether the job fits the scheduler's credit
- * limit.
  */

 #include <linux/wait.h>

drivers/gpu/drm/scheduler/sched_main.c +0 -0
@@ -133,13 +127,6 @@ static bool drm_sched_can_queue(struct
 drm_gpu_scheduler *sched,
  	if (!s_job)
  		return false;

drivers/gpu/drm/scheduler/sched_main.c +0 -2
-	if (sched->ops->update_job_credits) {
-		s_job->credits = sched->ops-
Quoted 1 line

update_job_credits(s_job);

drivers/gpu/drm/scheduler/sched_main.c +0 -3
-
-		drm_WARN(sched, !s_job->credits,
-			 "Jobs with zero credits bypass job-flow

control.\n");

drivers/gpu/drm/scheduler/sched_main.c +0 -2
-	}
-

  /* If a job exceeds the credit limit, truncate it to the credit limit
  * itself to guarantee forward progress.
  */

include/drm/gpu_scheduler.h +0 -3
index 95e17504e46a..e2e6af8849c6 100644
@@ -476,19 +476,6 @@ struct drm_sched_backend_ops {
           * and it's time to clean it up.
  	 */
  	void (*free_job)(struct drm_sched_job *sched_job);
-
-	/**
-	 * @update_job_credits: Called when the scheduler is

considering this

include/drm/gpu_scheduler.h +0 -3
-	 * job for execution.
-	 *
-	 * This callback returns the number of credits the job would

take if

include/drm/gpu_scheduler.h +0 -1
-	 * pushed to the hardware. Drivers may use this to

dynamically update

include/drm/gpu_scheduler.h +0 -1
-	 * the job's credit count. For instance, deduct the number

of credits

include/drm/gpu_scheduler.h +0 -5
-	 * for already signalled native fences.
-	 *
-	 * This callback is optional.
-	 */
-	u32 (*update_job_credits)(struct drm_sched_job *sched_job);

 };

 /**