Problem with video capture DMA

Hello,

I am having a problem with the video capture portion of a DriverWorks based PCI device driver that I maintain. The application requests an overlay surface from DirectDraw, Locks the surface, and passes the lpSurface pointer to the driver. The driver creates a KMemory object for the surface and uses KMemory::SetPageArray() to find the address of the first physical page of the surface. Internally DriverWorks is allocating an MDL and using MmBildMdlForNonPagedPool() to populate it.

This address is then used to program the hardware to DMA the video data into the surface. The DMA repeats automatically for each frame. This works for most video cards. On some PCI-eXpress based video cards, however, this does not work. Is there a recommended method for setting up a DMA that occurs repeatedly? (The hardware does not provide a very good mechanism for the driver to setup the DMA for each frame, it really prefers to be setup once). Is there a special method for setting up DMA between two hardware devices?

Thanks,
Chap

xxxxx@chaptastic.net wrote:

I am having a problem with the video capture portion of a DriverWorks based PCI device driver that I maintain. The application requests an overlay surface from DirectDraw, Locks the surface, and passes the lpSurface pointer to the driver. The driver creates a KMemory object for the surface and uses KMemory::SetPageArray() to find the address of the first physical page of the surface. Internally DriverWorks is allocating an MDL and using MmBildMdlForNonPagedPool() to populate it.

This address is then used to program the hardware to DMA the video data into the surface. The DMA repeats automatically for each frame. This works for most video cards. On some PCI-eXpress based video cards, however, this does not work. Is there a recommended method for setting up a DMA that occurs repeatedly? (The hardware does not provide a very good mechanism for the driver to setup the DMA for each frame, it really prefers to be setup once). Is there a special method for setting up DMA between two hardware devices?

There is, in fact, no guarantee that device-to-device DMA will work at
all. It wasn’t designed for that use. Many people have “gotten away
with it” for a very long time, but some of the older graphics chips
would not allow arbitrary memory transfers while the drawing engine was
active.

Does the PCI Express standard even require that the root complex route
bus-mastered data from a PCI device to a PCI Express device? I tried to
look that up, but I find the PCI Express specification to be incredibly
opaque.

Having said all that, however, I am surprised you had trouble. What do
you actually see? Nothing at all?

By the way, I wanted to comment on your spelling of “PCI-eXpress”. You
need to be cautious about that X, because you might be tempted to
abbreviate that as “PCI-X”. However, PCI-X is a very different bus –
an extension to PCI, but still a parallel bus. I have not seen a
universally accepted abbreviation for PCI Express, although “PCIe” seems
to have some favor.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.