summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-07-12 11:50:24 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2011-07-12 11:51:58 +0100
commit644b1a903301531e1fb59f27952c15e87888c4c6 (patch)
treedb3dd1313da2d5c95a146146f8fd52c1d70a894a
parent32f42358140ee812984149ae52b0df3dfd1778c3 (diff)
dri: Always initialise resource members of DRI2FrameEvent
As we now attempt to always decouple the lists upon freeing the frame event, we need to initialise them along all code paths. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/intel_dri.c6
-rw-r--r--src/sna/sna_dri.c14
2 files changed, 20 insertions, 0 deletions
diff --git a/src/intel_dri.c b/src/intel_dri.c
index 0b284524..5ea7c2ca 100644
--- a/src/intel_dri.c
+++ b/src/intel_dri.c
@@ -1336,6 +1336,12 @@ I830DRI2ScheduleWaitMSC(ClientPtr client, DrawablePtr draw, CARD64 target_msc,
wait_info->client = client;
wait_info->type = DRI2_WAITMSC;
+ if (!i830_dri2_add_frame_event(wait_info)) {
+ free(wait_info);
+ wait_info = NULL;
+ goto out_complete;
+ }
+
/* Get current count */
vbl.request.type = DRM_VBLANK_RELATIVE;
if (pipe > 0)
diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c
index 30233acb..40c9875f 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -1395,6 +1395,14 @@ blit:
info->sna = sna;
info->type = DRI2_ASYNC_FLIP;
info->pipe = pipe;
+ info->client = client;
+
+ if (!sna_dri_add_frame_event(info)) {
+ DBG(("%s: failed to hook up frame event\n", __FUNCTION__));
+ free(info);
+ info = NULL;
+ goto exchange;
+ }
info->count = sna_do_pageflip(sna, back_priv->pixmap,
info, pipe,
@@ -1565,6 +1573,12 @@ sna_dri_schedule_wait_msc(ClientPtr client, DrawablePtr draw, CARD64 target_msc,
info->drawable_id = draw->id;
info->client = client;
info->type = DRI2_WAITMSC;
+ if (!sna_dri_add_frame_event(info)) {
+ DBG(("%s: failed to hook up frame event\n", __FUNCTION__));
+ free(info);
+ info = NULL;
+ goto out_complete;
+ }
/*
* If divisor is zero, or current_msc is smaller than target_msc,