diff options
author | Leo Liu <[email protected]> | 2016-04-25 13:46:36 -0400 |
---|---|---|
committer | Leo Liu <[email protected]> | 2016-05-16 16:28:51 -0400 |
commit | 69ba9be4d24757eaca263662148df1163bde3d86 (patch) | |
tree | cad3511892d45a582286e2f14f264aff11b02876 /src/gallium/auxiliary | |
parent | 758b1bbaa77e5d8ecdea68067e91b4277b2b72fe (diff) |
vl/dri3: implement flushing for queued events
also place holder for present events handling
Signed-off-by: Leo Liu <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Reviewed-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r-- | src/gallium/auxiliary/vl/vl_winsys_dri3.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/vl/vl_winsys_dri3.c b/src/gallium/auxiliary/vl/vl_winsys_dri3.c index 305bbc68e1a..06c2ec9ebf8 100644 --- a/src/gallium/auxiliary/vl/vl_winsys_dri3.c +++ b/src/gallium/auxiliary/vl/vl_winsys_dri3.c @@ -50,6 +50,38 @@ struct vl_dri3_screen xcb_special_event_t *special_event; }; +static void +dri3_handle_present_event(struct vl_dri3_screen *scrn, + xcb_present_generic_event_t *ge) +{ + switch (ge->evtype) { + case XCB_PRESENT_CONFIGURE_NOTIFY: { + /* TODO */ + break; + } + case XCB_PRESENT_COMPLETE_NOTIFY: { + /* TODO */ + break; + } + case XCB_PRESENT_EVENT_IDLE_NOTIFY: { + /* TODO */ + break; + } + } + free(ge); +} + +static void +dri3_flush_present_events(struct vl_dri3_screen *scrn) +{ + if (scrn->special_event) { + xcb_generic_event_t *ev; + while ((ev = xcb_poll_for_special_event( + scrn->conn, scrn->special_event)) != NULL) + dri3_handle_present_event(scrn, (xcb_present_generic_event_t *)ev); + } +} + static bool dri3_set_drawable(struct vl_dri3_screen *scrn, Drawable drawable) { @@ -96,6 +128,8 @@ dri3_set_drawable(struct vl_dri3_screen *scrn, Drawable drawable) scrn->special_event = xcb_register_for_special_xge(scrn->conn, &xcb_present_id, peid, 0); + dri3_flush_present_events(scrn); + return true; } @@ -157,6 +191,8 @@ vl_dri3_screen_destroy(struct vl_screen *vscreen) assert(vscreen); + dri3_flush_present_events(scrn); + if (scrn->special_event) xcb_unregister_for_special_event(scrn->conn, scrn->special_event); scrn->base.pscreen->destroy(scrn->base.pscreen); |