42
42
#define DEFAULT_POLL_PERIOD_NS (NSEC_PER_SEC / DEFAULT_POLL_FREQUENCY_HZ)
43
43
#define XE_OA_UNIT_INVALID U32_MAX
44
44
45
+ enum xe_oa_submit_deps {
46
+ XE_OA_SUBMIT_NO_DEPS ,
47
+ XE_OA_SUBMIT_ADD_DEPS ,
48
+ };
49
+
45
50
struct xe_oa_reg {
46
51
struct xe_reg addr ;
47
52
u32 value ;
@@ -575,7 +580,8 @@ static __poll_t xe_oa_poll(struct file *file, poll_table *wait)
575
580
return ret ;
576
581
}
577
582
578
- static struct dma_fence * xe_oa_submit_bb (struct xe_oa_stream * stream , struct xe_bb * bb )
583
+ static struct dma_fence * xe_oa_submit_bb (struct xe_oa_stream * stream , enum xe_oa_submit_deps deps ,
584
+ struct xe_bb * bb )
579
585
{
580
586
struct xe_sched_job * job ;
581
587
struct dma_fence * fence ;
@@ -588,11 +594,22 @@ static struct dma_fence *xe_oa_submit_bb(struct xe_oa_stream *stream, struct xe_
588
594
goto exit ;
589
595
}
590
596
597
+ if (deps == XE_OA_SUBMIT_ADD_DEPS ) {
598
+ for (int i = 0 ; i < stream -> num_syncs && !err ; i ++ )
599
+ err = xe_sync_entry_add_deps (& stream -> syncs [i ], job );
600
+ if (err ) {
601
+ drm_dbg (& stream -> oa -> xe -> drm , "xe_sync_entry_add_deps err %d\n" , err );
602
+ goto err_put_job ;
603
+ }
604
+ }
605
+
591
606
xe_sched_job_arm (job );
592
607
fence = dma_fence_get (& job -> drm .s_fence -> finished );
593
608
xe_sched_job_push (job );
594
609
595
610
return fence ;
611
+ err_put_job :
612
+ xe_sched_job_put (job );
596
613
exit :
597
614
return ERR_PTR (err );
598
615
}
@@ -670,7 +687,7 @@ static int xe_oa_modify_ctx_image(struct xe_oa_stream *stream, struct xe_lrc *lr
670
687
671
688
xe_oa_store_flex (stream , lrc , bb , flex , count );
672
689
673
- fence = xe_oa_submit_bb (stream , bb );
690
+ fence = xe_oa_submit_bb (stream , XE_OA_SUBMIT_NO_DEPS , bb );
674
691
if (IS_ERR (fence )) {
675
692
err = PTR_ERR (fence );
676
693
goto free_bb ;
@@ -699,7 +716,7 @@ static int xe_oa_load_with_lri(struct xe_oa_stream *stream, struct xe_oa_reg *re
699
716
700
717
write_cs_mi_lri (bb , reg_lri , 1 );
701
718
702
- fence = xe_oa_submit_bb (stream , bb );
719
+ fence = xe_oa_submit_bb (stream , XE_OA_SUBMIT_NO_DEPS , bb );
703
720
if (IS_ERR (fence )) {
704
721
err = PTR_ERR (fence );
705
722
goto free_bb ;
@@ -949,7 +966,7 @@ static int xe_oa_emit_oa_config(struct xe_oa_stream *stream, struct xe_oa_config
949
966
goto exit ;
950
967
}
951
968
952
- fence = xe_oa_submit_bb (stream , oa_bo -> bb );
969
+ fence = xe_oa_submit_bb (stream , XE_OA_SUBMIT_ADD_DEPS , oa_bo -> bb );
953
970
if (IS_ERR (fence )) {
954
971
err = PTR_ERR (fence );
955
972
goto exit ;
0 commit comments