2

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)?

kurczak
  • 1,521
  • 1
  • 10
  • 18

2 Answers2

1

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.

Stewart
  • 3,978
  • 17
  • 20
  • that's how I do it right now; though I would like to get rid of the overhead of sending IOCTLS down to the driver. I need every microsecond I can get. – kurczak Jun 25 '12 at 14:59
1

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...

dr-stevep
  • 31
  • 3