About Windows NT® Display Drivers

A Windows NT display driver is a DLL whose primary responsibility is rendering. Applications call Win32 functions with device-independent graphics requests. GDI interprets these instructions and calls the display driver. The display driver translates device-independent graphics commands into commands the video hardware needs to draw graphics on the screen.

Each display driver is paired with a kernel-mode video miniport driver. The miniport driver normally handles operations that must interact with other NT kernel components. Figure 4.1 shows the display driver and the other components required for graphics video display.

Figure 4.1    The Display Driver and other Graphics Video Components

Because the display is among the most time-critical parts of any system, and because of the wide variety in video hardware capabilities, the display driver also accesses the hardware directly. This access and the wide scope of capabilities within GDI offer considerable latitude in implementing the various functions of a display driver:

·By default, GDI handles drawing operations on standard format bitmaps, as in hardware that includes a frame buffer. A driver can hook out and implement any of the drawing functions for which the hardware offers special support. For less time-critical operations and more complex operations not supported by the video adapter, the driver can punt functions back to GDI and allow GDI to do the work.

·For especially time-critical operations, the display driver designer has direct access to video hardware registers. For example, the VGA display driver for x86 systems uses optimized assembly code to implement direct access to hardware registers for some drawing and text operations.

The display driver should not perform resource management, such as hardware detection and configuration, or physical device memory mapping. These are functions of the video miniport driver.

As shown in Figure 4.1, Windows NT display drivers are concerned with two software interfaces:

1.The DDI interface, which is the set of functions that the display driver can hook, and that GDI can call in order to process graphics commands.

2.The GDI callbacks, generally referred to as “Eng” callbacks, which are help routines provided by GDI for the display driver’s use.

Required, conditionally required, and optional DDI function support specific to display drivers is described in DDI Support in Display Drivers. DDI function support common to both display drivers and printer drivers is described in Supporting the DDI, which is in Part 1 of this book. Part 1 also provides information on GDI operation and the service functions available to graphics drivers. Reference pages for the DDI and GDI functions can be found in the Graphics Driver Reference.