Skip to content

Commit 27d4815

Browse files
Tvrtko UrsulinPhilipp Stanner
authored andcommitted
drm/sched: Group exported prototypes by object type
Do a bit of house keeping in gpu_scheduler.h by grouping the API by type of object it operates on. Signed-off-by: Tvrtko Ursulin <[email protected]> Cc: Christian König <[email protected]> Cc: Danilo Krummrich <[email protected]> Cc: Matthew Brost <[email protected]> Cc: Philipp Stanner <[email protected]> Signed-off-by: Philipp Stanner <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 71a18f7 commit 27d4815

File tree

1 file changed

+33
-27
lines changed

1 file changed

+33
-27
lines changed

include/drm/gpu_scheduler.h

Lines changed: 33 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -383,12 +383,6 @@ struct drm_sched_job {
383383
struct xarray dependencies;
384384
};
385385

386-
static inline bool drm_sched_invalidate_job(struct drm_sched_job *s_job,
387-
int threshold)
388-
{
389-
return s_job && atomic_inc_return(&s_job->karma) > threshold;
390-
}
391-
392386
enum drm_gpu_sched_stat {
393387
DRM_GPU_SCHED_STAT_NONE, /* Reserve 0 */
394388
DRM_GPU_SCHED_STAT_NOMINAL,
@@ -566,14 +560,36 @@ struct drm_sched_init_args {
566560
struct device *dev;
567561
};
568562

563+
/* Scheduler operations */
564+
569565
int drm_sched_init(struct drm_gpu_scheduler *sched,
570566
const struct drm_sched_init_args *args);
571567

572568
void drm_sched_fini(struct drm_gpu_scheduler *sched);
569+
570+
unsigned long drm_sched_suspend_timeout(struct drm_gpu_scheduler *sched);
571+
void drm_sched_resume_timeout(struct drm_gpu_scheduler *sched,
572+
unsigned long remaining);
573+
void drm_sched_tdr_queue_imm(struct drm_gpu_scheduler *sched);
574+
bool drm_sched_wqueue_ready(struct drm_gpu_scheduler *sched);
575+
void drm_sched_wqueue_stop(struct drm_gpu_scheduler *sched);
576+
void drm_sched_wqueue_start(struct drm_gpu_scheduler *sched);
577+
void drm_sched_stop(struct drm_gpu_scheduler *sched, struct drm_sched_job *bad);
578+
void drm_sched_start(struct drm_gpu_scheduler *sched, int errno);
579+
void drm_sched_resubmit_jobs(struct drm_gpu_scheduler *sched);
580+
void drm_sched_fault(struct drm_gpu_scheduler *sched);
581+
582+
struct drm_gpu_scheduler *
583+
drm_sched_pick_best(struct drm_gpu_scheduler **sched_list,
584+
unsigned int num_sched_list);
585+
586+
/* Jobs */
587+
573588
int drm_sched_job_init(struct drm_sched_job *job,
574589
struct drm_sched_entity *entity,
575590
u32 credits, void *owner);
576591
void drm_sched_job_arm(struct drm_sched_job *job);
592+
void drm_sched_entity_push_job(struct drm_sched_job *sched_job);
577593
int drm_sched_job_add_dependency(struct drm_sched_job *job,
578594
struct dma_fence *fence);
579595
int drm_sched_job_add_syncobj_dependency(struct drm_sched_job *job,
@@ -588,21 +604,16 @@ int drm_sched_job_add_implicit_dependencies(struct drm_sched_job *job,
588604
bool write);
589605
bool drm_sched_job_has_dependency(struct drm_sched_job *job,
590606
struct dma_fence *fence);
591-
592-
void drm_sched_entity_modify_sched(struct drm_sched_entity *entity,
593-
struct drm_gpu_scheduler **sched_list,
594-
unsigned int num_sched_list);
595-
596-
void drm_sched_tdr_queue_imm(struct drm_gpu_scheduler *sched);
597607
void drm_sched_job_cleanup(struct drm_sched_job *job);
598-
bool drm_sched_wqueue_ready(struct drm_gpu_scheduler *sched);
599-
void drm_sched_wqueue_stop(struct drm_gpu_scheduler *sched);
600-
void drm_sched_wqueue_start(struct drm_gpu_scheduler *sched);
601-
void drm_sched_stop(struct drm_gpu_scheduler *sched, struct drm_sched_job *bad);
602-
void drm_sched_start(struct drm_gpu_scheduler *sched, int errno);
603-
void drm_sched_resubmit_jobs(struct drm_gpu_scheduler *sched);
604608
void drm_sched_increase_karma(struct drm_sched_job *bad);
605-
void drm_sched_fault(struct drm_gpu_scheduler *sched);
609+
610+
static inline bool drm_sched_invalidate_job(struct drm_sched_job *s_job,
611+
int threshold)
612+
{
613+
return s_job && atomic_inc_return(&s_job->karma) > threshold;
614+
}
615+
616+
/* Entities */
606617

607618
int drm_sched_entity_init(struct drm_sched_entity *entity,
608619
enum drm_sched_priority priority,
@@ -612,16 +623,11 @@ int drm_sched_entity_init(struct drm_sched_entity *entity,
612623
long drm_sched_entity_flush(struct drm_sched_entity *entity, long timeout);
613624
void drm_sched_entity_fini(struct drm_sched_entity *entity);
614625
void drm_sched_entity_destroy(struct drm_sched_entity *entity);
615-
void drm_sched_entity_push_job(struct drm_sched_job *sched_job);
616626
void drm_sched_entity_set_priority(struct drm_sched_entity *entity,
617627
enum drm_sched_priority priority);
618628
int drm_sched_entity_error(struct drm_sched_entity *entity);
619-
620-
unsigned long drm_sched_suspend_timeout(struct drm_gpu_scheduler *sched);
621-
void drm_sched_resume_timeout(struct drm_gpu_scheduler *sched,
622-
unsigned long remaining);
623-
struct drm_gpu_scheduler *
624-
drm_sched_pick_best(struct drm_gpu_scheduler **sched_list,
625-
unsigned int num_sched_list);
629+
void drm_sched_entity_modify_sched(struct drm_sched_entity *entity,
630+
struct drm_gpu_scheduler **sched_list,
631+
unsigned int num_sched_list);
626632

627633
#endif

0 commit comments

Comments
 (0)