The i810's vblank interrupt does not go to the CPU's interrupt controller IIRC. Therefore you have to poll for vblank by reading the current scanline.
Usually apps that are waiting on vblank can be better served by solving the actual problem rather than trying to use a generic wait For vblank solution. i.e. If you want to blit to the FB and don't want to see tearing, the i810 can pause the DMA stream until a vblank. So issue the wait for vblank before your blit and there is no need for your app to worry about it. Or, if you want the overlay to flip synchronous with vblank... The Hardware already does that for you. The one useful thing to use vblank for it to make sure you get video cadence correct. i.e. you need to have some idea of the refresh rate And the proper time to issue the flip such that you are doing exactly One flip per frame. For that the polling is ok, after an initial Polling setup period you are just checking to see if you need to go Faster or slower. Like this: Detect_refresh() //Some polling going on to figure it out While(1) { draw_frame() if(get_current_line() < X) { wait; //Pause a few lines... Trying to target the middle line } blit_frame() //This is a non tearing blit } So what exactly is the problem you wish to solve? Perhaps there is a Better way than endless polling. -Matt -----Original Message----- From: Ian Romanick [mailto:[EMAIL PROTECTED]] Sent: Friday, December 13, 2002 12:31 PM To: DRI developer's list Subject: Re: [Dri-devel] vblank and i810 On Thu, Dec 12, 2002 at 11:16:44PM -0000, Dave Airlie wrote: > > Well I asked a question on dri-users and Keith said I'd be better asking > here .. > I want to get my OpenGL application to stop flickering on my i815 using a > sync to the vertical refresh, work has apparently started on this for the > radeon and g400, so, > > a) does someone intend working on the i810 driver? > b) if !a, where do I start to work on this, I have a development system > sitting here waiting :-), and I've no fear of X or kernels, I don't believe that anyone plans to do this. Basically, you need to add support to the i810 DRM for DRM_IOCTL_WAIT_VBLANK. There are a couple of places to see how this is used: lib/GL/mesa/src/drv/mga/mgaioctl.c mgaWaitForVBlank lib/GL/mesa/src/drv/radeon/radeon_ioctl.c radeonWaitForVBlank lib/GL/mesa/src/drv/r128/r128_ioctl.c r128WaitForVBlank programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c drmWaitVBlank The work will be in setting up the card to send vblank interrupts and servicint the. I would look at the Radeon driver as a good example of how to do this: programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/radeon_irq.c The i810 driver hasn't been templetized the same was as the Radeon, Rage128, and G400 drivers, so the code for that driver (for Linux) will live in programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810* Intel has technical documentation for the i810 & i815 (but not the i830 or i845) on their website. Go to one of the following and find the link to either i810 or i815 "GMCH Programmer's Reference Manual." http://www.intel.com/design/chipsets/manuals/index.htm?iid=PCG+devleftnav& It shouldn't matter which you get. Interrupt processing /should/ be the same for both. The differences between the two chips WRT 3D graphics is pretty minimal, IIRC. > Do I need a particular branch of the dri CVS tree or will the HEAD do fine? > Do I need an updated X11/GL to support the new IOCTL? (am running XFree86 > 4.2.0) > Can I avoid downloading/building the Xserver, just grab the DRI stuff? Follow the instructions on the DRI compilation guide. > Will this be in 4.3 (I have to do a product and a stable release looks > better to management!). At this point, there's pretty much no chance of that. -- Smile! http://antwrp.gsfc.nasa.gov/apod/ap990315.html ------------------------------------------------------- This sf.net email is sponsored by: With Great Power, Comes Great Responsibility Learn to use your power at OSDN's High Performance Computing Channel http://hpc.devchannel.org/ _______________________________________________ Dri-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dri-devel ------------------------------------------------------- This sf.net email is sponsored by: With Great Power, Comes Great Responsibility Learn to use your power at OSDN's High Performance Computing Channel http://hpc.devchannel.org/ _______________________________________________ Dri-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dri-devel