File tree Expand file tree Collapse file tree 1 file changed +11
-42
lines changed Expand file tree Collapse file tree 1 file changed +11
-42
lines changed Original file line number Diff line number Diff line change @@ -572,56 +572,25 @@ int i915_sw_fence_await_reservation(struct i915_sw_fence *fence,
572
572
unsigned long timeout ,
573
573
gfp_t gfp )
574
574
{
575
- struct dma_fence * excl ;
575
+ struct dma_resv_iter cursor ;
576
+ struct dma_fence * f ;
576
577
int ret = 0 , pending ;
577
578
578
579
debug_fence_assert (fence );
579
580
might_sleep_if (gfpflags_allow_blocking (gfp ));
580
581
581
- if (write ) {
582
- struct dma_fence * * shared ;
583
- unsigned int count , i ;
584
-
585
- ret = dma_resv_get_fences (resv , & excl , & count , & shared );
586
- if (ret )
587
- return ret ;
588
-
589
- for (i = 0 ; i < count ; i ++ ) {
590
- if (shared [i ]-> ops == exclude )
591
- continue ;
592
-
593
- pending = i915_sw_fence_await_dma_fence (fence ,
594
- shared [i ],
595
- timeout ,
596
- gfp );
597
- if (pending < 0 ) {
598
- ret = pending ;
599
- break ;
600
- }
601
-
602
- ret |= pending ;
603
- }
604
-
605
- for (i = 0 ; i < count ; i ++ )
606
- dma_fence_put (shared [i ]);
607
- kfree (shared );
608
- } else {
609
- excl = dma_resv_get_excl_unlocked (resv );
610
- }
611
-
612
- if (ret >= 0 && excl && excl -> ops != exclude ) {
613
- pending = i915_sw_fence_await_dma_fence (fence ,
614
- excl ,
615
- timeout ,
582
+ dma_resv_iter_begin (& cursor , resv , write );
583
+ dma_resv_for_each_fence_unlocked (& cursor , f ) {
584
+ pending = i915_sw_fence_await_dma_fence (fence , f , timeout ,
616
585
gfp );
617
- if (pending < 0 )
586
+ if (pending < 0 ) {
618
587
ret = pending ;
619
- else
620
- ret |= pending ;
621
- }
622
-
623
- dma_fence_put (excl );
588
+ break ;
589
+ }
624
590
591
+ ret |= pending ;
592
+ }
593
+ dma_resv_iter_end (& cursor );
625
594
return ret ;
626
595
}
627
596
You can’t perform that action at this time.
0 commit comments