int (*get_rotation_capability)(struct wl_egl_window *, void *);
void (*set_frontbuffer_callback)(struct wl_egl_window *, void *, int);
void (*set_window_serial_callback)(struct wl_egl_window *, void *, unsigned int);
+ int (*create_render_sync_fd)(struct wl_egl_window *, void *);
};
static struct tizen_private* tizen_private_create()
private->get_rotation_capability = NULL;
private->set_window_serial_callback = NULL;
private->set_frontbuffer_callback = NULL;
+ private->create_render_sync_fd = NULL;
}
return private;
if (private->set_window_serial_callback)
private->set_window_serial_callback(egl_window, egl_window->driver_private,
serial);
-}
\ No newline at end of file
+}
+
+int
+wl_egl_window_tizen_create_render_sync_fd(struct wl_egl_window *egl_window)
+{
+ struct tizen_private *private = NULL;
+
+ if (egl_window == NULL) {
+ WL_EGL_ERR("egl_window is NULL");
+ return -1;
+ }
+
+ private = egl_window->driver_private;
+ if (private == NULL) {
+ WL_EGL_ERR("wl_egl_window(%p) dirver_private is NULL", egl_window);
+ return -1;
+ }
+
+ if (private->create_render_sync_fd)
+ return private->create_render_sync_fd(egl_window, egl_window->driver_private);
+
+ return -1;
+}
wl_egl_window_tizen_set_window_serial(struct wl_egl_window *egl_window,
unsigned int serial);
+/* temporary APIs for testing sync feature */
+/**
+ * Create a sync fence fd that can tell render done.
+ *
+ * If eglSwapBuffers works async, it returns fd which tells
+ * when the render job is finished.
+ * This fd can wait asynchronously via poll or select.
+ *
+ * Important *
+ * This requires the following premise:
+ * - After ddk calls libplpl-egl's tpl_surface_dequeue_buffer to get the buffer,
+ * and until it calls tpl_surface_enqueue_buffer,
+ * it is called the gpu rendering job interval.
+ * - Therefore, when using the dma_buf implicit fence,
+ * there is no guarantee that the rendering job is finished
+ * with the fence obtained through this API.
+ *
+ * The fence_fd obtained through this function is one-time available,
+ * can not be reused, so caller must close it when finished using it.
+ *
+ * @param egl_window handle to wl_egl_window.
+ * @return sync fd on success, -1 on failure.
+ */
+int
+wl_egl_window_tizen_create_render_sync_fd(struct wl_egl_window *egl_window);
+
#ifdef __cplusplus
}
#endif