The Video Miniport Driver Interface

Certain operations, such as hardware initialization and memory mapping, require action by the Windows NT I/O subsystem. These operations are done by the video miniport driver, which must be specific to the video hardware.

To send synchronous requests to the video miniport driver, the display driver makes a call to GDI’s EngDeviceIoControl routine with an IOCTL. GDI, using one buffer for both input and output, passes the request to the Windows NT I/O subsystem. There, the video port driver and the video miniport driver that have been paired with the display driver work together to process the request as necessary.

Some IOCTL requests require the miniport driver to access video registers, and some store or retrieve information from the miniport driver’s data structures. Normally, no requests actually require the video driver to perform drawing operations.

Figure 4.2 shows the driver’s communication with the miniport driver by way of IOCTLs.

Figure 4.2 Display Driver/Video Miniport Driver Communication

In general, and unless modularity dictates otherwise, the display driver handles drawing and other time-critical operations. Sending an IOCTL to the miniport driver to perform a time-critical function can degrade system performance.

The display driver calls on the video miniport driver to support infrequently requested operations. This includes all hardware initialization and detection, memory mapping, ensuring that register outputs occur in close proximity, and responding to interrupts. The video miniport driver generally handles mode set interaction with the video adapter card. It should also be used to handle multiple hardware types and to minimize hardware-type dependency in the display driver. The video miniport can map the video register into the display driver’s address space. I/O ports are directly addressable.

These rules are not hard and fast; the balance between modularity and performance is the key. For example, the hardware pointer code for the VGA driver resides in the miniport. This promotes modularity, so the same display driver can handle both the Video Seven VRAM, which has a hardware pointer, and the ET4000, which does not.

See the Graphics Drivers Reference for descriptions of system-defined video IOCTLs. You can extend the interface between the display driver and the video miniport driver by adding private IOCTLs, which must be formatted as described in the Kernel-Mode Drivers Reference. If you need to write a new IOCTL, please contact Microsoft Technical Support.

For information on video miniport design, see Video Miniport Drivers.