uint32_t flags;
int allocated;
int reuse;
+ int usable;
struct wl_tbm_queue *wl_tbm_queue;
struct wl_list link;
if (queue_info->is_active && queue_info->active_flush) {
wl_list_for_each_reverse(buffer, &queue_info->attach_bufs, link) {
- if (!buffer->allocated) {
+ if (!buffer->allocated && buffer->usable) {
if (_wayland_tbm_client_is_valid_attach_bufs(queue_info, buffer)) {
surface = buffer->tbm_surface;
/* ref.. pair of __wayland_tbm_client_surface_free_cb */
tbm_surface_queue_flush(queue_info->tbm_queue);
}
+static void
+handle_tbm_queue_buffer_usable(void *data,
+ struct wl_tbm_queue *wl_tbm_queue,
+ struct wl_buffer *wl_buffer)
+{
+ struct wayland_tbm_surface_queue *queue_info =
+ (struct wayland_tbm_surface_queue *)data;
+ struct wayland_tbm_buffer *buffer;
+
+ WL_TBM_RETURN_IF_FAIL(wl_buffer != NULL);
+
+ wl_list_for_each(buffer, &queue_info->attach_bufs, link) {
+ if (buffer->wl_buffer == wl_buffer)
+ buffer->usable = 1;
+ }
+
+#ifdef DEBUG_TRACE
+ WL_TBM_TRACE("pid:%d wl_buffer:%p tbm_surface:%p",
+ getpid(), buffer->wl_buffer, buffer->tbm_surface);
+#endif
+
+ return;
+}
+
const struct wl_tbm_queue_listener wl_tbm_queue_listener = {
handle_tbm_queue_buffer_attached,
handle_tbm_queue_active,
handle_tbm_queue_deactive,
- handle_tbm_queue_flush
+ handle_tbm_queue_flush,
+ handle_tbm_queue_buffer_usable,
};
static struct wayland_tbm_surface_queue *
return 0;
}
-
return 1;
}
+int
+wayland_tbm_server_client_queue_send_buffer_usable(struct wayland_tbm_client_queue *cqueue,
+ struct wl_resource *wl_buffer)
+{
+ WL_TBM_RETURN_VAL_IF_FAIL(cqueue != NULL, 0);
+ WL_TBM_RETURN_VAL_IF_FAIL(wl_buffer != NULL, 0);
+
+ wl_tbm_queue_send_buffer_usable(cqueue->wl_tbm_queue, wl_buffer);
+
+ return 1;
+}
+
struct wl_resource *
wayland_tbm_server_client_queue_export_buffer2(
struct wayland_tbm_client_queue *cqueue,