File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -635,6 +635,18 @@ static const struct drm_gem_object_funcs qaic_gem_funcs = {
635
635
.vm_ops = & drm_vm_ops ,
636
636
};
637
637
638
+ static void qaic_init_bo (struct qaic_bo * bo , bool reinit )
639
+ {
640
+ if (reinit ) {
641
+ bo -> sliced = false;
642
+ reinit_completion (& bo -> xfer_done );
643
+ } else {
644
+ init_completion (& bo -> xfer_done );
645
+ }
646
+ complete_all (& bo -> xfer_done );
647
+ INIT_LIST_HEAD (& bo -> slices );
648
+ }
649
+
638
650
static struct qaic_bo * qaic_alloc_init_bo (void )
639
651
{
640
652
struct qaic_bo * bo ;
@@ -643,9 +655,7 @@ static struct qaic_bo *qaic_alloc_init_bo(void)
643
655
if (!bo )
644
656
return ERR_PTR (- ENOMEM );
645
657
646
- INIT_LIST_HEAD (& bo -> slices );
647
- init_completion (& bo -> xfer_done );
648
- complete_all (& bo -> xfer_done );
658
+ qaic_init_bo (bo , false);
649
659
650
660
return bo ;
651
661
}
@@ -1880,9 +1890,7 @@ void release_dbc(struct qaic_device *qdev, u32 dbc_id)
1880
1890
list_for_each_entry_safe (bo , bo_temp , & dbc -> bo_lists , bo_list ) {
1881
1891
qaic_free_slices_bo (bo );
1882
1892
qaic_unprepare_bo (qdev , bo );
1883
- bo -> sliced = false;
1884
- INIT_LIST_HEAD (& bo -> slices );
1885
- init_completion (& bo -> xfer_done );
1893
+ qaic_init_bo (bo , true);
1886
1894
list_del (& bo -> bo_list );
1887
1895
}
1888
1896
You can’t perform that action at this time.
0 commit comments