From 6cf8a5f721a9334e3bd228eb7c5501153966f930 Mon Sep 17 00:00:00 2001 From: Bryce Harrington Date: Tue, 15 Feb 2011 22:30:18 -0800 Subject: Quell excessively verbose vblank counter failed error messages Certain error situations can result in the following printed to Xorg.0.log at a high enough rate to make log file size a problem. (WW) intel(0): I830DRI2GetMSC:1062 get vblank counter failed: Invalid argument (WW) intel(0): I830DRI2ScheduleWaitMSC:1118 get vblank counter failed: Invalid argument Following in the tradition of commit 0ad6d6e1, limit the warnings to be output 5 times, then quell the remainder. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34322 Ref.: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/710594 Signed-off-by: Bryce Harrington Signed-off-by: Chris Wilson (cherry picked from commit 9599fde65a0d8b7e7c85199346f7b620bdd8388d) Signed-off-by: Owain G. Ainsworth --- src/intel_dri.c | 48 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 16 deletions(-) (limited to 'src/intel_dri.c') diff --git a/src/intel_dri.c b/src/intel_dri.c index 3d0b730c..ff8f0aaf 100644 --- a/src/intel_dri.c +++ b/src/intel_dri.c @@ -991,10 +991,14 @@ I830DRI2GetMSC(DrawablePtr draw, CARD64 *ust, CARD64 *msc) ret = drmWaitVBlank(intel->drmSubFD, &vbl); if (ret) { - xf86DrvMsg(scrn->scrnIndex, X_WARNING, - "%s:%d get vblank counter failed: %s\n", - __FUNCTION__, __LINE__, - strerror(errno)); + static int limit = 5; + if (limit) { + xf86DrvMsg(scrn->scrnIndex, X_WARNING, + "%s:%d get vblank counter failed: %s\n", + __FUNCTION__, __LINE__, + strerror(errno)); + limit--; + } return FALSE; } @@ -1047,10 +1051,14 @@ I830DRI2ScheduleWaitMSC(ClientPtr client, DrawablePtr draw, CARD64 target_msc, vbl.request.sequence = 0; ret = drmWaitVBlank(intel->drmSubFD, &vbl); if (ret) { - xf86DrvMsg(scrn->scrnIndex, X_WARNING, - "%s:%d get vblank counter failed: %s\n", - __FUNCTION__, __LINE__, - strerror(errno)); + static int limit = 5; + if (limit) { + xf86DrvMsg(scrn->scrnIndex, X_WARNING, + "%s:%d get vblank counter failed: %s\n", + __FUNCTION__, __LINE__, + strerror(errno)); + limit--; + } goto out_complete; } @@ -1077,10 +1085,14 @@ I830DRI2ScheduleWaitMSC(ClientPtr client, DrawablePtr draw, CARD64 target_msc, vbl.request.signal = (unsigned long)wait_info; ret = drmWaitVBlank(intel->drmSubFD, &vbl); if (ret) { - xf86DrvMsg(scrn->scrnIndex, X_WARNING, - "%s:%d get vblank counter failed: %s\n", - __FUNCTION__, __LINE__, - strerror(errno)); + static int limit = 5; + if (limit) { + xf86DrvMsg(scrn->scrnIndex, X_WARNING, + "%s:%d get vblank counter failed: %s\n", + __FUNCTION__, __LINE__, + strerror(errno)); + limit--; + } goto out_complete; } @@ -1112,10 +1124,14 @@ I830DRI2ScheduleWaitMSC(ClientPtr client, DrawablePtr draw, CARD64 target_msc, vbl.request.signal = (unsigned long)wait_info; ret = drmWaitVBlank(intel->drmSubFD, &vbl); if (ret) { - xf86DrvMsg(scrn->scrnIndex, X_WARNING, - "%s:%d get vblank counter failed: %s\n", - __FUNCTION__, __LINE__, - strerror(errno)); + static int limit = 5; + if (limit) { + xf86DrvMsg(scrn->scrnIndex, X_WARNING, + "%s:%d get vblank counter failed: %s\n", + __FUNCTION__, __LINE__, + strerror(errno)); + limit--; + } goto out_complete; } -- cgit v1.2.3