@@ -527,19 +527,31 @@ submit_notify(struct i915_sw_fence *fence, enum i915_sw_fence_notify state)
527
527
return NOTIFY_DONE ;
528
528
}
529
529
530
+ static void irq_semaphore_cb (struct irq_work * wrk )
531
+ {
532
+ struct i915_request * rq =
533
+ container_of (wrk , typeof (* rq ), semaphore_work );
534
+
535
+ i915_schedule_bump_priority (rq , I915_PRIORITY_NOSEMAPHORE );
536
+ i915_request_put (rq );
537
+ }
538
+
530
539
static int __i915_sw_fence_call
531
540
semaphore_notify (struct i915_sw_fence * fence , enum i915_sw_fence_notify state )
532
541
{
533
- struct i915_request * request =
534
- container_of (fence , typeof (* request ), semaphore );
542
+ struct i915_request * rq = container_of (fence , typeof (* rq ), semaphore );
535
543
536
544
switch (state ) {
537
545
case FENCE_COMPLETE :
538
- i915_schedule_bump_priority (request , I915_PRIORITY_NOSEMAPHORE );
546
+ if (!(READ_ONCE (rq -> sched .attr .priority ) & I915_PRIORITY_NOSEMAPHORE )) {
547
+ i915_request_get (rq );
548
+ init_irq_work (& rq -> semaphore_work , irq_semaphore_cb );
549
+ irq_work_queue (& rq -> semaphore_work );
550
+ }
539
551
break ;
540
552
541
553
case FENCE_FREE :
542
- i915_request_put (request );
554
+ i915_request_put (rq );
543
555
break ;
544
556
}
545
557
@@ -1318,9 +1330,9 @@ void __i915_request_queue(struct i915_request *rq,
1318
1330
* decide whether to preempt the entire chain so that it is ready to
1319
1331
* run at the earliest possible convenience.
1320
1332
*/
1321
- i915_sw_fence_commit (& rq -> semaphore );
1322
1333
if (attr && rq -> engine -> schedule )
1323
1334
rq -> engine -> schedule (rq , attr );
1335
+ i915_sw_fence_commit (& rq -> semaphore );
1324
1336
i915_sw_fence_commit (& rq -> submit );
1325
1337
}
1326
1338
0 commit comments