@@ -374,11 +374,11 @@ static int lima_gem_lock_bos(struct lima_bo **bos, u32 nr_bos,
374374 return ret ;
375375}
376376
377- static int lima_gem_sync_bo (struct lima_sched_task * task , u64 context ,
378- struct lima_bo * bo , bool write )
377+ static int lima_gem_sync_bo (struct lima_sched_task * task , struct lima_bo * bo , bool write )
379378{
380379 int i , err ;
381380 struct dma_fence * f ;
381+ u64 context = task -> base .s_fence -> finished .context ;
382382
383383 if (write ) {
384384 struct reservation_object_list * fobj =
@@ -413,9 +413,9 @@ static int lima_gem_sync_bo(struct lima_sched_task *task, u64 context,
413413 return 0 ;
414414}
415415
416- int lima_gem_submit (struct drm_file * file , struct lima_sched_pipe * pipe ,
417- struct drm_lima_gem_submit_bo * bos , u32 nr_bos ,
418- void * frame , u32 * fence )
416+ int lima_gem_submit (struct drm_file * file , int pipe ,
417+ struct drm_lima_gem_submit_bo * bos ,
418+ u32 nr_bos , void * frame , u32 * fence )
419419{
420420 struct lima_bo * * lbos ;
421421 int i , err = 0 ;
@@ -442,32 +442,28 @@ int lima_gem_submit(struct drm_file *file, struct lima_sched_pipe *pipe,
442442 if (err )
443443 goto out0 ;
444444
445- task = lima_sched_task_create (priv -> vm , frame );
445+ task = lima_sched_task_create (priv -> context + pipe , priv -> vm , frame );
446446 if (IS_ERR (task )) {
447447 err = PTR_ERR (task );
448448 goto out1 ;
449449 }
450450
451451 for (i = 0 ; i < nr_bos ; i ++ ) {
452- err = lima_gem_sync_bo (task , pipe -> fence_context , lbos [i ],
453- bos [i ].flags & LIMA_SUBMIT_BO_WRITE );
452+ err = lima_gem_sync_bo (task , lbos [i ], bos [i ].flags & LIMA_SUBMIT_BO_WRITE );
454453 if (err )
455454 goto out2 ;
456455 }
457456
458- err = lima_sched_task_queue (pipe , task );
459- if (err )
460- goto out2 ;
461-
462457 for (i = 0 ; i < nr_bos ; i ++ ) {
463458 if (bos [i ].flags & LIMA_SUBMIT_BO_WRITE )
464- reservation_object_add_excl_fence (lbos [i ]-> resv , task -> fence );
459+ reservation_object_add_excl_fence (
460+ lbos [i ]-> resv , & task -> base .s_fence -> finished );
465461 else
466- reservation_object_add_shared_fence (lbos [i ]-> resv , task -> fence );
462+ reservation_object_add_shared_fence (
463+ lbos [i ]-> resv , & task -> base .s_fence -> finished );
467464 }
468- dma_fence_put (task -> fence );
469465
470- * fence = task -> fence -> seqno ;
466+ * fence = lima_sched_context_queue_task ( priv -> context + pipe , task ) ;
471467
472468out2 :
473469 if (err )
0 commit comments