@@ -583,6 +583,19 @@ static void gd_gl_release_dmabuf(DisplayChangeListener *dcl,
#endif
}
+static void gd_gl_wait_dmabuf(DisplayChangeListener *dcl,
+ QemuDmaBuf *dmabuf)
+{
+#ifdef CONFIG_GBM
+ egl_dmabuf_create_fence(dmabuf);
+ if (dmabuf->fence_fd <= 0) {
+ return;
+ }
+
+ egl_dmabuf_wait_sync(dmabuf);
+#endif
+}
+
/** DisplayState Callbacks (opengl version) **/
static const DisplayChangeListenerOps dcl_gl_area_ops = {
@@ -602,6 +615,7 @@ static const DisplayChangeListenerOps dcl_gl_area_ops = {
.dpy_gl_update = gd_gl_area_scanout_flush,
.dpy_gl_scanout_dmabuf = gd_gl_area_scanout_dmabuf,
.dpy_gl_release_dmabuf = gd_gl_release_dmabuf,
+ .dpy_gl_wait_dmabuf = gd_gl_wait_dmabuf,
.dpy_has_dmabuf = gd_has_dmabuf,
};
@@ -626,6 +640,7 @@ static const DisplayChangeListenerOps dcl_egl_ops = {
.dpy_gl_cursor_position = gd_egl_cursor_position,
.dpy_gl_update = gd_egl_scanout_flush,
.dpy_gl_release_dmabuf = gd_gl_release_dmabuf,
+ .dpy_gl_wait_dmabuf = gd_gl_wait_dmabuf,
.dpy_has_dmabuf = gd_has_dmabuf,
};
Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com> --- ui/gtk.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)