File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -112,8 +112,6 @@ static void ivpu_bo_unbind_locked(struct ivpu_bo *bo)
112
112
113
113
ivpu_dbg_bo (vdev , bo , "unbind" );
114
114
115
- /* TODO: dma_unmap */
116
-
117
115
if (bo -> mmu_mapped ) {
118
116
drm_WARN_ON (& vdev -> drm , !bo -> ctx );
119
117
drm_WARN_ON (& vdev -> drm , !bo -> vpu_addr );
@@ -127,6 +125,18 @@ static void ivpu_bo_unbind_locked(struct ivpu_bo *bo)
127
125
bo -> vpu_addr = 0 ;
128
126
bo -> ctx = NULL ;
129
127
}
128
+
129
+ if (bo -> base .base .import_attach )
130
+ return ;
131
+
132
+ dma_resv_lock (bo -> base .base .resv , NULL );
133
+ if (bo -> base .sgt ) {
134
+ dma_unmap_sgtable (vdev -> drm .dev , bo -> base .sgt , DMA_BIDIRECTIONAL , 0 );
135
+ sg_free_table (bo -> base .sgt );
136
+ kfree (bo -> base .sgt );
137
+ bo -> base .sgt = NULL ;
138
+ }
139
+ dma_resv_unlock (bo -> base .base .resv );
130
140
}
131
141
132
142
static void ivpu_bo_unbind (struct ivpu_bo * bo )
You can’t perform that action at this time.
0 commit comments