summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2009-08-07 08:33:36 -0400
committerKristian Høgsberg <krh@redhat.com>2009-08-07 08:44:30 -0400
commit2703dce7811fe6955b060c7e9f0c4b297f254ef4 (patch)
treefcc369ed4269ac7d366b0a44c162694e40dac081
parentc3f7b30eda1f87053c58aa14446a940d0bcc5591 (diff)
Track number of crtcs with pending flips
-rw-r--r--src/drmmode_display.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 21e5c5ca..e982a701 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -48,6 +48,7 @@ typedef struct {
drmEventContext event_context;
void *swap_data;
int old_fb_id;
+ int flip_count;
} drmmode_rec, *drmmode_ptr;
typedef struct {
@@ -1142,6 +1143,7 @@ drmmode_do_pageflip(DrawablePtr pDraw, dri_bo *new_front, dri_bo *old_front,
"flip queue failed: %s\n", strerror(errno));
goto error_undo;
}
+ drmmode->flip_count++;
}
pScrn->fbOffset = new_front->offset;
@@ -1173,6 +1175,10 @@ drmmode_page_flip_handler(int fd,
{
drmmode_ptr drmmode = user_data;
+ drmmode->flip_count--;
+ if (drmmode->flip_count > 0)
+ return;
+
drmModeRmFB(drmmode->fd, drmmode->old_fb_id);
DRI2SwapComplete(drmmode->swap_data);