The following figure shows how the display driver communicates with the video miniport driver using IOCTLs.
Diagram illustrating display driver/video miniport driver communication
The display driver calls EngDeviceIoControl with an IOCTL to send a synchronous request to the video miniport driver. GDI uses a single buffer for both input and output to pass the request to the I/O subsystem. The I/O subsystem routes the request to the video port, which processes the request with the video miniport driver.
Some IOCTL requests require the miniport driver to access video registers,and others store or retrieve information from the miniport driver
Accessing the Frame Buffer and Hardware Registers
There are several ways to reduce display driver size.For example, you can implement only those functions that the display driver can perform faster than GDI,and then specify GDI to perform all other operations. GDI often performs a substantial amount of the drawing to linear frame buffers to reduce the sizeof the driver. GDI cannot access banked memory directly; therefore, when the frame buffer is not linearly addressable, the display driver must divide the frame buffer into a series of banks and provide a means for GDI to perform its draw operations to the appropriate bank. See Supporting Banked Frame Buffers for details.
The display driver has direct access to I/O-mapped and memory-mapped video registers.This access allows a display driver to achieve high performance.For example, the driver might need to access video hardware registers to send line-drawing commands at high throughput.
Similarly,for graphics cards, such as the S3, many of the innermost loops in the graphics engine code require reads and writes of several video controller ports (for example, text output in graphics mode, bit block transfers,and line drawing). Rather than requiring the display driver to send an IOCTL to the miniport driver for each request, the display driver is permitted to access the video hardware directly.