diff options
author | Jesse Barnes <jbarnes@virtuousgeek.org> | 2010-03-08 15:42:39 -0800 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2010-03-08 15:42:39 -0800 |
commit | 68629b63740fb6e62c258b8a46669e77660fa4e4 (patch) | |
tree | 23be25a6c01332e2208f3e469e651b39efa7651c /src/i830_dri.c | |
parent | 6df74e61afb7831ebf3fbab8782f46ddccbe262b (diff) |
DRI2: make WaitMSC error handling more consistent with ScheduleSwap
Just make it mirror ScheduleSwap: complete the wait on any error
condition so as not to crash the client if the kernel is misbehaving.
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'src/i830_dri.c')
-rw-r--r-- | src/i830_dri.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/i830_dri.c b/src/i830_dri.c index fc178076..7c595dd9 100644 --- a/src/i830_dri.c +++ b/src/i830_dri.c @@ -862,16 +862,12 @@ I830DRI2ScheduleWaitMSC(ClientPtr client, DrawablePtr draw, CARD64 target_msc, remainder &= 0xffffffff; /* Drawable not visible, return immediately */ - if (pipe == -1) { - DRI2WaitMSCComplete(client, draw, target_msc, 0, 0); - return TRUE; - } + if (pipe == -1) + goto out_complete; wait_info = xcalloc(1, sizeof(DRI2FrameEventRec)); - if (!wait_info) { - DRI2WaitMSCComplete(client, draw, 0, 0, 0); - return TRUE; - } + if (!wait_info) + goto out_complete; wait_info->drawable_id = draw->id; wait_info->client = client; @@ -886,7 +882,7 @@ I830DRI2ScheduleWaitMSC(ClientPtr client, DrawablePtr draw, CARD64 target_msc, if (ret) { xf86DrvMsg(scrn->scrnIndex, X_WARNING, "get vblank counter failed: %s\n", strerror(errno)); - return FALSE; + goto out_complete; } current_msc = vbl.reply.sequence; @@ -914,7 +910,7 @@ I830DRI2ScheduleWaitMSC(ClientPtr client, DrawablePtr draw, CARD64 target_msc, if (ret) { xf86DrvMsg(scrn->scrnIndex, X_WARNING, "get vblank counter failed: %s\n", strerror(errno)); - return FALSE; + goto out_complete; } wait_info->frame = vbl.reply.sequence; @@ -947,13 +943,17 @@ I830DRI2ScheduleWaitMSC(ClientPtr client, DrawablePtr draw, CARD64 target_msc, if (ret) { xf86DrvMsg(scrn->scrnIndex, X_WARNING, "get vblank counter failed: %s\n", strerror(errno)); - return FALSE; + goto out_complete; } wait_info->frame = vbl.reply.sequence; DRI2BlockClient(client, draw); return TRUE; + +out_complete: + DRI2WaitMSCComplete(client, draw, target_msc, 0, 0); + return TRUE; } #endif |