File tree Expand file tree Collapse file tree 4 files changed +7
-7
lines changed Expand file tree Collapse file tree 4 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -313,7 +313,7 @@ execlist_run_job(struct drm_sched_job *drm_job)
313
313
q -> ring_ops -> emit_job (job );
314
314
xe_execlist_make_active (exl );
315
315
316
- return dma_fence_get ( job -> fence ) ;
316
+ return job -> fence ;
317
317
}
318
318
319
319
static void execlist_job_free (struct drm_sched_job * drm_job )
Original file line number Diff line number Diff line change @@ -790,6 +790,7 @@ guc_exec_queue_run_job(struct drm_sched_job *drm_job)
790
790
struct xe_exec_queue * q = job -> q ;
791
791
struct xe_guc * guc = exec_queue_to_guc (q );
792
792
struct xe_device * xe = guc_to_xe (guc );
793
+ struct dma_fence * fence = NULL ;
793
794
bool lr = xe_exec_queue_is_lr (q );
794
795
795
796
xe_assert (xe , !(exec_queue_destroyed (q ) || exec_queue_pending_disable (q )) ||
@@ -807,12 +808,12 @@ guc_exec_queue_run_job(struct drm_sched_job *drm_job)
807
808
808
809
if (lr ) {
809
810
xe_sched_job_set_error (job , - EOPNOTSUPP );
810
- return NULL ;
811
- } else if (test_and_set_bit (JOB_FLAG_SUBMIT , & job -> fence -> flags )) {
812
- return job -> fence ;
811
+ dma_fence_put (job -> fence ); /* Drop ref from xe_sched_job_arm */
813
812
} else {
814
- return dma_fence_get ( job -> fence ) ;
813
+ fence = job -> fence ;
815
814
}
815
+
816
+ return fence ;
816
817
}
817
818
818
819
static void guc_exec_queue_free_job (struct drm_sched_job * drm_job )
Original file line number Diff line number Diff line change @@ -280,7 +280,7 @@ void xe_sched_job_arm(struct xe_sched_job *job)
280
280
fence = & chain -> base ;
281
281
}
282
282
283
- job -> fence = fence ;
283
+ job -> fence = dma_fence_get ( fence ); /* Pairs with put in scheduler */
284
284
drm_sched_job_arm (& job -> drm );
285
285
}
286
286
Original file line number Diff line number Diff line change @@ -40,7 +40,6 @@ struct xe_sched_job {
40
40
* @fence: dma fence to indicate completion. 1 way relationship - job
41
41
* can safely reference fence, fence cannot safely reference job.
42
42
*/
43
- #define JOB_FLAG_SUBMIT DMA_FENCE_FLAG_USER_BITS
44
43
struct dma_fence * fence ;
45
44
/** @user_fence: write back value when BB is complete */
46
45
struct {
You can’t perform that action at this time.
0 commit comments