diff --git a/.pick_status.json b/.pick_status.json index fb328e5226f..33d35f94261 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -6234,7 +6234,7 @@ "description": "rusticl/gl: only flush objects on import if we get a valid fd", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/gallium/frontends/rusticl/core/gl.rs b/src/gallium/frontends/rusticl/core/gl.rs index 5c632a34430..f06e8394366 100644 --- a/src/gallium/frontends/rusticl/core/gl.rs +++ b/src/gallium/frontends/rusticl/core/gl.rs @@ -255,16 +255,19 @@ impl GLCtxManager { &mut export_in, &mut flush_out, ); - // TODO: use fence_server_sync in ctx inside the queue thread - let fence_fd = FenceFd { fd }; - cl_ctx.devs.iter().for_each(|dev| { - let fence = dev.helper_ctx().import_fence(&fence_fd); - fence.wait(); - }); if err_flush != 0 { err_flush } else { + if fd != -1 { + // TODO: use fence_server_sync in ctx inside the queue thread + let fence_fd = FenceFd { fd }; + cl_ctx.devs.iter().for_each(|dev| { + let fence = dev.helper_ctx().import_fence(&fence_fd); + fence.wait(); + }); + } + egl_export_object_func( disp.cast(), ctx.cast(), @@ -289,16 +292,19 @@ impl GLCtxManager { &mut export_in, &mut flush_out, ); - // TODO: use fence_server_sync in ctx inside the queue thread - let fence_fd = FenceFd { fd }; - cl_ctx.devs.iter().for_each(|dev| { - let fence = dev.helper_ctx().import_fence(&fence_fd); - fence.wait(); - }); if err_flush != 0 { err_flush } else { + if fd != -1 { + // TODO: use fence_server_sync in ctx inside the queue thread + let fence_fd = FenceFd { fd }; + cl_ctx.devs.iter().for_each(|dev| { + let fence = dev.helper_ctx().import_fence(&fence_fd); + fence.wait(); + }); + } + glx_export_object_func( disp.cast(), ctx.cast(),