Waiting for vertical refresh on Intel 965 and 945 chips in recent git

Michel Dänzer michel at tungstengraphics.com
Thu Jun 7 23:23:05 PDT 2007


On Thu, 2007-06-07 at 18:00 +0100, Simon Farnsworth wrote:
> 
> In the 7.2 release, I could use the DRM directly to wait for vertical
> blanking, using the DRM_IOCTL_WAIT_VBLANK ioctl. The intel driver has
> been changed to only enable the interrupt if 3D is in use, so I reworked
> my code to use the GLX_SGI_video_sync extension to wait for VBlank.
> 
> I am now finding that the OpenGL based wait for VBlank also fails if the
> window I create to get an OpenGL context is fully obscured;
> glXWaitVideoSyncSGI returns 5 (GLX_BAD_CONTEXT). My code automatically
> falls back to trying the DRM method, but DRM_IOCTL_WAIT_VBLANK returns
> 16 (EBUSY).

Yes, this is because the X server DRI layer now counts DRI windows
according to visibility, to allow e.g. page flipping to work with
multiple windows as long as only one of them is visible. So the intel
driver can't tell the difference between a window being invisible and it
not existing at all and disables the vblank interrupts.

> Is there any way for me to wait for VBlank that doesn't depend on having
> a window at the top of the stack?

I'm afraid not without code changes.

> We're willing to custom patch anything to make this work (from the
> kernel upwards).

I guess the simplest solution for you right now would be to disable the
code in the intel driver that disables the vblank interrupts.

There's been some discussion on and off the dri-devel list about a
generic solution for the DRM to only enable the vblank interrupts when
needed and keep them disabled otherwise. If you're interested in working
on that, we can discuss the current ideas there.


-- 
Earthling Michel Dänzer           |          http://tungstengraphics.com
Libre software enthusiast         |          Debian, X and DRI developer




More information about the xorg mailing list