uint32_t connector_id;
drmModeCrtcPtr original_crtc;
+ int vblank_pending;
+ int page_flip_pending;
+
struct gbm_surface *surface;
struct gbm_bo *cursor_bo[2];
int current_cursor;
struct weston_surface *surface;
struct weston_surface *pending_surface;
+ struct drm_output *output;
+
struct drm_compositor *compositor;
struct wl_listener destroy_listener;
return;
}
+ output->page_flip_pending = 1;
+
/*
* Now, update all the sprite surfaces
*/
weston_log("vblank event request failed: %d: %s\n",
ret, strerror(errno));
}
+
+ s->output = output;
+ output->vblank_pending = 1;
}
return;
{
struct drm_sprite *s = (struct drm_sprite *)data;
struct drm_compositor *c = s->compositor;
+ struct drm_output *output = s->output;
+ uint32_t msecs;
+
+ output->vblank_pending = 0;
if (s->surface) {
weston_buffer_post_release(s->surface->buffer);
s->fb_id = s->pending_fb_id;
s->pending_fb_id = 0;
}
+
+ if (!output->page_flip_pending) {
+ msecs = sec * 1000 + usec / 1000;
+ weston_output_finish_frame(&output->base, msecs);
+ }
}
static void
struct drm_output *output = (struct drm_output *) data;
uint32_t msecs;
+ output->page_flip_pending = 0;
+
if (output->current) {
if (output->current->is_client_buffer)
gbm_bo_destroy(output->current->bo);
output->current = output->next;
output->next = NULL;
- msecs = sec * 1000 + usec / 1000;
- weston_output_finish_frame(&output->base, msecs);
+ if (!output->vblank_pending) {
+ msecs = sec * 1000 + usec / 1000;
+ weston_output_finish_frame(&output->base, msecs);
+ }
}
static int