2
votes

I'm writing a driver that needs synchronization with vertical blank interrupt to send some data down the USB pipe.

In user-mode there are Direct X functions available for this like IDXGIOutput::WaitForVBlank and few older ones. I am not able to use them from kernel. I found another interface in Windows 8 SDK: D3DKMTWaitForVerticalBlankEvent which even has a kernel header (the header is in /km/ folder of the SDK), but it requires gdi32.lib which a user-mode library and linking with it cripples the driver.

Is there any way I can wait or get a notification about vertical blank occurence (without polling)?

2

2 Answers

1
votes

Is it acceptable to have a user mode portion of your driver? You could have a helper process in user mode which waits for the VBI, and have that process trigger your KM driver in some way.

1
votes

You could use a named event.

  • In your driver create a named event and a kernel thread to wait on the event before doing real work.
  • In a user-mode helper app/service open the named event and create a thread to call IDXGIOutput::WaitForVBlank then immediately set the named event.

Of course I'd imagine you worked this out long ago and moved on...