From 0ad6d6e1a678de7d8c2d4cd7c734887e1deb2f9b Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 3 Jan 2011 16:52:07 +0000 Subject: 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 --- src/intel_dri.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/intel_dri.c b/src/intel_dri.c index b577c7d9..70963693 100644 --- a/src/intel_dri.c +++ b/src/intel_dri.c @@ -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; } -- cgit v1.2.3