summaryrefslogtreecommitdiffstats
path: root/src/loader/loader_dri3_helper.c
diff options
context:
space:
mode:
authorDaniel Stone <[email protected]>2018-02-21 10:39:34 +0000
committerDaniel Stone <[email protected]>2018-02-21 21:57:38 +0000
commiteef890b7b1216443bd75382f7f602e26338a7899 (patch)
treeadab3f3cd92b314a470b6f9492d5f657f18a8384 /src/loader/loader_dri3_helper.c
parenta6f1952814c96f9d04360337e58cb30df02038f9 (diff)
x11/dri3: Store raw present completion mode
The DRI3 drawable info struct currently stores a boolean for whether the last completed operation was a flip or not. As we need to track the full completion mode for handling suboptimal returns, change the 'flipping' field to the raw present completion mode from the server. Signed-off-by: Daniel Stone <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
Diffstat (limited to 'src/loader/loader_dri3_helper.c')
-rw-r--r--src/loader/loader_dri3_helper.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/loader/loader_dri3_helper.c b/src/loader/loader_dri3_helper.c
index cb947c58728..426966a786a 100644
--- a/src/loader/loader_dri3_helper.c
+++ b/src/loader/loader_dri3_helper.c
@@ -196,7 +196,7 @@ dri3_fence_await(xcb_connection_t *c, struct loader_dri3_drawable *draw,
static void
dri3_update_num_back(struct loader_dri3_drawable *draw)
{
- if (draw->flipping)
+ if (draw->last_present_mode == XCB_PRESENT_COMPLETE_MODE_FLIP)
draw->num_back = 3;
else
draw->num_back = 2;
@@ -369,14 +369,8 @@ dri3_handle_present_event(struct loader_dri3_drawable *draw,
draw->recv_sbc = (draw->send_sbc & 0xffffffff00000000LL) | ce->serial;
if (draw->recv_sbc > draw->send_sbc)
draw->recv_sbc -= 0x100000000;
- switch (ce->mode) {
- case XCB_PRESENT_COMPLETE_MODE_FLIP:
- draw->flipping = true;
- break;
- case XCB_PRESENT_COMPLETE_MODE_COPY:
- draw->flipping = false;
- break;
- }
+
+ draw->last_present_mode = ce->mode;
if (draw->vtable->show_fps)
draw->vtable->show_fps(draw, ce->ust);