sna/dri: Swallow error from GetMSC

Just ignore the error return from WaitVBlank and make up a value for
last MSC/SBC similar to an unattached Drawable.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55395
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2012-09-29 16:41:00 +01:00
parent a873f6d354
commit 33f6f75378
1 changed files with 10 additions and 11 deletions

View File

@ -2065,30 +2065,29 @@ sna_dri_get_msc(DrawablePtr draw, CARD64 *ust, CARD64 *msc)
{
struct sna *sna = to_sna_from_drawable(draw);
drmVBlank vbl;
int pipe = sna_dri_get_pipe(draw);
int pipe;
DBG(("%s(pipe=%d)\n", __FUNCTION__, pipe));
*ust = *msc = 0;
/* Drawable not displayed, make up a value */
if (pipe == -1) {
*ust = 0;
*msc = 0;
pipe = sna_dri_get_pipe(draw);
if (pipe == -1)
return TRUE;
}
VG_CLEAR(vbl);
vbl.request.type = DRM_VBLANK_RELATIVE | pipe_select(pipe);
vbl.request.sequence = 0;
if (sna_wait_vblank(sna, &vbl)) {
if (sna_wait_vblank(sna, &vbl) == 0) {
*ust = ((CARD64)vbl.reply.tval_sec * 1000000) + vbl.reply.tval_usec;
*msc = vbl.reply.sequence;
DBG(("%s: msc=%llu, ust=%llu\n", __FUNCTION__,
(long long)*msc, (long long)*ust));
} else {
DBG(("%s: query failed on pipe %d, ret=%d\n",
__FUNCTION__, pipe, errno));
return FALSE;
}
*ust = ((CARD64)vbl.reply.tval_sec * 1000000) + vbl.reply.tval_usec;
*msc = vbl.reply.sequence;
DBG(("%s: msc=%llu, ust=%llu\n", __FUNCTION__,
(long long)*msc, (long long)*ust));
return TRUE;
}