@@ -383,12 +383,6 @@ struct drm_sched_job {
383
383
struct xarray dependencies ;
384
384
};
385
385
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
-
392
386
enum drm_gpu_sched_stat {
393
387
DRM_GPU_SCHED_STAT_NONE , /* Reserve 0 */
394
388
DRM_GPU_SCHED_STAT_NOMINAL ,
@@ -566,14 +560,36 @@ struct drm_sched_init_args {
566
560
struct device * dev ;
567
561
};
568
562
563
+ /* Scheduler operations */
564
+
569
565
int drm_sched_init (struct drm_gpu_scheduler * sched ,
570
566
const struct drm_sched_init_args * args );
571
567
572
568
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
+
573
588
int drm_sched_job_init (struct drm_sched_job * job ,
574
589
struct drm_sched_entity * entity ,
575
590
u32 credits , void * owner );
576
591
void drm_sched_job_arm (struct drm_sched_job * job );
592
+ void drm_sched_entity_push_job (struct drm_sched_job * sched_job );
577
593
int drm_sched_job_add_dependency (struct drm_sched_job * job ,
578
594
struct dma_fence * fence );
579
595
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,
588
604
bool write );
589
605
bool drm_sched_job_has_dependency (struct drm_sched_job * job ,
590
606
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 );
597
607
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 );
604
608
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 */
606
617
607
618
int drm_sched_entity_init (struct drm_sched_entity * entity ,
608
619
enum drm_sched_priority priority ,
@@ -612,16 +623,11 @@ int drm_sched_entity_init(struct drm_sched_entity *entity,
612
623
long drm_sched_entity_flush (struct drm_sched_entity * entity , long timeout );
613
624
void drm_sched_entity_fini (struct drm_sched_entity * entity );
614
625
void drm_sched_entity_destroy (struct drm_sched_entity * entity );
615
- void drm_sched_entity_push_job (struct drm_sched_job * sched_job );
616
626
void drm_sched_entity_set_priority (struct drm_sched_entity * entity ,
617
627
enum drm_sched_priority priority );
618
628
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 );
626
632
627
633
#endif
0 commit comments