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 @@ -322,12 +322,6 @@ static int virtio_gpu_plane_prepare_fb(struct drm_plane *plane,
322322 return 0 ;
323323
324324 obj = new_state -> fb -> obj [0 ];
325- if (obj -> import_attach ) {
326- ret = virtio_gpu_prepare_imported_obj (plane , new_state , obj );
327- if (ret )
328- return ret ;
329- }
330-
331325 if (bo -> dumb || obj -> import_attach ) {
332326 vgplane_st -> fence = virtio_gpu_fence_alloc (vgdev ,
333327 vgdev -> fence_drv .context ,
@@ -336,7 +330,21 @@ static int virtio_gpu_plane_prepare_fb(struct drm_plane *plane,
336330 return - ENOMEM ;
337331 }
338332
333+ if (obj -> import_attach ) {
334+ ret = virtio_gpu_prepare_imported_obj (plane , new_state , obj );
335+ if (ret )
336+ goto err_fence ;
337+ }
338+
339339 return 0 ;
340+
341+ err_fence :
342+ if (vgplane_st -> fence ) {
343+ dma_fence_put (& vgplane_st -> fence -> f );
344+ vgplane_st -> fence = NULL ;
345+ }
346+
347+ return ret ;
340348}
341349
342350static void virtio_gpu_cleanup_imported_obj (struct drm_gem_object * obj )
You can’t perform that action at this time.
0 commit comments