diff options
author | Kristian Høgsberg <krh@redhat.com> | 2009-08-14 11:15:18 -0400 |
---|---|---|
committer | Kristian Høgsberg <krh@redhat.com> | 2009-08-14 11:15:18 -0400 |
commit | b0a167cdc98b94951ba82e2b6649fc74b69d35cb (patch) | |
tree | a382e5b9e3009bc86c39229172513fa29a2cd6fd | |
parent | 45b7a3a64578a56c1e119893d9e77f74946bcea6 (diff) | |
download | wayland-b0a167cdc98b94951ba82e2b6649fc74b69d35cb.tar.gz wayland-b0a167cdc98b94951ba82e2b6649fc74b69d35cb.tar.xz wayland-b0a167cdc98b94951ba82e2b6649fc74b69d35cb.zip |
Always repaint out of vsync callback.
-rw-r--r-- | wayland-system-compositor.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/wayland-system-compositor.c b/wayland-system-compositor.c index dce6d2f..aec318c 100644 --- a/wayland-system-compositor.c +++ b/wayland-system-compositor.c @@ -649,7 +649,7 @@ repaint_output(struct wlsc_output *output) while (&es->link != &ec->surface_list) { wlsc_surface_draw(es); es = container_of(es->link.next, - struct wlsc_surface, link); + struct wlsc_surface, link); } eid = container_of(ec->input_device_list.next, @@ -691,12 +691,21 @@ repaint(void *data) static void wlsc_compositor_schedule_repaint(struct wlsc_compositor *compositor) { - struct wl_event_loop *loop; + struct wlsc_output *output; + int fd; compositor->repaint_needed = 1; - if (!compositor->repaint_on_timeout) { - loop = wl_display_get_event_loop(compositor->wl_display); - wl_event_loop_add_idle(loop, repaint, compositor); + if (compositor->repaint_on_timeout) + return; + + fd = eglGetDisplayFD(compositor->display); + output = container_of(compositor->output_list.next, + struct wlsc_output, link); + while (&output->link != &compositor->output_list) { + drmModePageFlip(fd, output->crtc_id, + output->fb_id[output->current ^ 1], output); + output = container_of(output->link.next, + struct wlsc_output, link); } } |