i810 driver vblank bug

Yuan Austin yuanshengquan at gmail.com
Mon Aug 28 03:35:13 PDT 2006


Hi,

i915 drm version 1.5 adds two ioctls to enable/disable vblank
interrupt of pipe A&B, and it is disabled by default. There are
several lines of initialization code in i810 2D driver to enable
vblank interrupt to make sure DRI applications can get vblank
interrupt on time. The issue is that 2D driver will bypass the
initialization code due to one conditional expression in
i830_driver.c:I830BIOSEnterVT:

#ifdef XF86DRI
   if (pI830->directRenderingEnabled) {
      if (!pI830->starting) {
         ScreenPtr pScreen = pScrn->pScreen;
         drmI830Sarea *sarea = (drmI830Sarea *) DRIGetSAREAPrivate(pScreen);
         int i;

         I830DRIResume(screenInfo.screens[scrnIndex]);
         I830DRISetVBlankInterrupt (pScrn, TRUE);
........
#endif

Because pI830->starting is true when I830BIOSEnterVT is called by
I830BIOSScreenInit, the I830DRISetVBlankInterrupt will be skipped,
then vblank will be disabled until one VT switch occurs. The disabled
vblank interrupt will cause DRI applications vblank waiting timeout
before copying back buffer to frontbuffer, and an error message will
pop up(Mesa i915 driver:
intelCopyBuffer->driWaitForVBlank->do_wait->drmWaitVBlank):
do_wait: drmWaitVBlank returned -1, IRQs don't seem to be working correctly.
Try running with LIBGL_THROTTLE_REFRESH and LIBL_SYNC_REFRESH unset.

A small patch can fix this issue:

--- ./i830_driver.old.c 2006-08-27 15:46:53.000000000 -0400
+++ ./i830_driver.c     2006-08-27 21:12:09.000000000 -0400
@@ -8097,7 +8097,9 @@

         DPRINTF(PFX, "calling dri unlock\n");
         DRIUnlock(screenInfo.screens[pScrn->scrnIndex]);
-      }
+      } else
+         I830DRISetVBlankInterrupt (pScrn, TRUE);
+
       pI830->LockHeld = 0;
    }
#endif


Thanks
Austin



More information about the xorg mailing list