dri: Only issue a warning for an "impossible" flip return 5 times

As it appears that some kernels do indeed return the "wrong" value,
issuing a warning 60 times a second is a cruel and unusual punishment.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=32680
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2011-01-03 16:52:07 +00:00
parent d729ef02f2
commit 0ad6d6e1a6
1 changed files with 13 additions and 4 deletions

View File

@ -802,10 +802,19 @@ void I830DRI2FlipEventHandler(unsigned int frame, unsigned int tv_sec,
* causing wrong (msc, ust) return values and possible visual corruption.
*/
if ((frame < flip->frame) && (flip->frame - frame < 5)) {
xf86DrvMsg(scrn->scrnIndex, X_WARNING,
"%s: Pageflip completion has impossible msc %d < target_msc %d\n",
__func__, frame, flip->frame);
/* All-Zero values signal failure of timestamping to client. */
static int limit = 5;
/* XXX we are currently hitting this path with older
* kernels, so make it quieter.
*/
if (limit) {
xf86DrvMsg(scrn->scrnIndex, X_WARNING,
"%s: Pageflip completion has impossible msc %d < target_msc %d\n",
__func__, frame, flip->frame);
limit--;
}
/* All-0 values signal timestamping failure. */
frame = tv_sec = tv_usec = 0;
}