diff options
-rw-r--r-- | src/glx/dri3_glx.c | 20 | ||||
-rw-r--r-- | src/glx/dri3_priv.h | 6 |
2 files changed, 24 insertions, 2 deletions
diff --git a/src/glx/dri3_glx.c b/src/glx/dri3_glx.c index e3fc4de..753b8d8 100644 --- a/src/glx/dri3_glx.c +++ b/src/glx/dri3_glx.c @@ -271,8 +271,11 @@ static void dri3_update_num_back(struct dri3_drawable *priv) { priv->num_back = 1; - if (priv->flipping) + if (priv->flipping) { + if (!priv->is_pixmap && !(priv->present_capabilities & XCB_PRESENT_CAPABILITY_ASYNC)) + priv->num_back++; priv->num_back++; + } if (priv->swap_interval == 0) priv->num_back++; } @@ -976,6 +979,9 @@ dri3_update_drawable(__DRIdrawable *driDrawable, void *loaderPrivate) xcb_get_geometry_reply_t *geom_reply; xcb_void_cookie_t cookie; xcb_generic_error_t *error; + xcb_present_query_capabilities_cookie_t present_capabilities_cookie; + xcb_present_query_capabilities_reply_t *present_capabilities_reply; + /* Try to select for input on the window. * @@ -994,6 +1000,8 @@ dri3_update_drawable(__DRIdrawable *driDrawable, void *loaderPrivate) XCB_PRESENT_EVENT_MASK_COMPLETE_NOTIFY| XCB_PRESENT_EVENT_MASK_IDLE_NOTIFY); + present_capabilities_cookie = xcb_present_query_capabilities(c, priv->base.xDrawable); + /* Create an XCB event queue to hold present events outside of the usual * application event queue */ @@ -1023,6 +1031,16 @@ dri3_update_drawable(__DRIdrawable *driDrawable, void *loaderPrivate) error = xcb_request_check(c, cookie); + present_capabilities_reply = xcb_present_query_capabilities_reply(c, + present_capabilities_cookie, + NULL); + + if (present_capabilities_reply) { + priv->present_capabilities = present_capabilities_reply->capabilities; + free(present_capabilities_reply); + } else + priv->present_capabilities = 0; + if (error) { if (error->error_code != BadWindow) { free(error); diff --git a/src/glx/dri3_priv.h b/src/glx/dri3_priv.h index 248fa28..bdfe224 100644 --- a/src/glx/dri3_priv.h +++ b/src/glx/dri3_priv.h @@ -147,7 +147,7 @@ struct dri3_context __DRIcontext *driContext; }; -#define DRI3_MAX_BACK 3 +#define DRI3_MAX_BACK 4 #define DRI3_BACK_ID(i) (i) #define DRI3_FRONT_ID (DRI3_MAX_BACK) @@ -172,6 +172,10 @@ struct dri3_drawable { uint8_t is_pixmap; uint8_t flipping; + /* Present extension capabilities + */ + uint32_t present_capabilities; + /* SBC numbers are tracked by using the serial numbers * in the present request and complete events */ |