/* Wait for vertical retrace - taken from the XFree86 Matrox driver */ static void WaitVBL(_THIS) { int count; /* find start of retrace */ mga_waitidle(); while ((mga_in8(0x1FDA) & 0x08)); while (!(mga_in8(0x1FDA) & 0x08)); /* wait until we're past the start */ count = mga_in32(0x1E20) + 2; while (mga_in32(0x1E20) < count); }
static void crtc2_wait_vsync( MatroxDriverData *mdrv ) { int vdisplay = ((dfb_config->matrox_tv_std != DSETV_PAL) ? 480/2 : 576/2) + 1; #ifdef FBIO_WAITFORVSYNC static const int one = 1; FBDev *dfb_fbdev = dfb_system_data(); if (ioctl( dfb_fbdev->fd, FBIO_WAITFORVSYNC, &one )) #endif while ((int)(mga_in32( mdrv->mmio_base, C2VCOUNT ) & 0x00000FFF) != vdisplay) ; }