Windows Display Driver Model

From Wikipedia, the free encyclopedia
Jump to: navigation, search

Windows Display Driver Model (WDDM) is the graphic driver architecture for video card drivers running Microsoft Windows versions beginning with Windows Vista.[1]

It is a replacement for the for Windows XP display driver model[2] and is aimed at enabling better performance graphics and new graphics functionality.[1] Display drivers in Windows Vista and later can choose to either adhere to this model or to Windows 2000 Display Driver Model (XDDM).[3] With the removal of XDDM from Windows 8, however, WDDM became the only option.[4]

WDDM provides the functionality required to render the desktop and applications using Desktop Window Manager, a compositing window manager running on top of Direct3D. It also supports new DXGI interfaces required for basic device management and creation. The WDDM specification requires at least Direct3D 9-capable video card and the display driver must implement the device driver interfaces for the Direct3D 9Ex runtime in order to run legacy Direct3D applications; it may optionally implement runtime interfaces for Direct3D 10/10.1 and higher.

Features enabled by the WDDM[edit]

WDDM drivers enable new areas of functionality which were not uniformly provided by earlier display driver models. These include:

Virtualized video memory[edit]

In the context of graphics, virtualization means that individual processes (in user mode) cannot see the memory of adjacent processes even by means of insertion of forged commands in the command stream. WDDM drivers allow video memory to be virtualized,[5] and video data to be paged out of video memory into system RAM. In case the video memory available turns out to be insufficient to store all the video data and textures, currently unused data is moved out to system RAM or to the disk. When the swapped out data is needed, it is fetched back. Virtualization could be supported on previous driver models (such as the XP Driver Model) to some extent, but was the responsibility of the driver, instead of being handled at the runtime level.

Scheduling[edit]

The runtime handles scheduling of concurrent graphics contexts.[6] Each list of commands is put in a queue for execution by the GPU, and it can be preempted by the runtime if a more critical task arrives and if it has not begun execution. This differs from native threads on the CPU where one task cannot be interrupted and therefore can take longer than necessary and make the computer appear less responsive. A hybrid scheduling algorithm between native and light threads with cooperation between the threads would achieve seamless parallelism. It is important to note that scheduling is not a new concept but it was previously the responsibility of individual driver developers. WDDM attempts to unify the experience across different vendors by controlling the execution of GPU tasks.

Cross-process sharing of Direct3D surfaces[edit]

A Direct3D graphics surface is the memory area that contains information about the textured meshes used for rendering a 2D or 3D scene. WDDM allows Direct3D surfaces to be shared across processes.[7] Thus, an application can incorporate a mesh created by another application into the scene it is rendering. Sharing textures between processes before WDDM was difficult, as it would have required copying the data from video memory to system memory and then back to video memory for the new device.

Enhanced fault-tolerance[edit]

If a WDDM driver hangs or encounters a fault, the graphics stack will restart the driver.[1][8] A graphics hardware fault will be intercepted and if necessary the driver will be reset.

Drivers under Windows XP were free to deal with hardware faults as they saw fit either by reporting it to the user or by attempting to recover silently. With a WDDM driver, all hardware faults cause the driver to be reset and the user will be notified by a popup; this unifies the behavior across vendors.

Previous drivers were fully implemented in kernel mode, whereas WDDM is implemented partly in user mode. If the user mode area fails with an unrecoverable error, it will, at the most, cause the application to quit unexpectedly instead of producing a blue screen error as it would in previous driver models.

WDDM also allows the graphics hardware to be reset or unplugged without a proper reboot. In practice, a driver update should not necessitate a reboot.

Limitations[edit]

The new driver model requires the graphics hardware to have Shader Model 2.0 support at least, since the fixed function pipeline is now translated to 2.0 shaders. However, according to Microsoft as of 2009, only about 1-2 percent of the hardware running Windows Vista used the XDDM,[9] with the rest already WDDM capable. It also requires some other hardware features; consequently some SM 2.0-supporting hardware such as the Intel GMA 900 fails the WDDM certification.[10]

One of the limitations of WDDM driver model version 1.0 is that it does not support multiple drivers in a multi-adapter, multi-monitor setup. If a multi-monitor system has more than one graphics adapter powering the monitors, both the adaptors must use the same WDDM driver. If more than one driver is used, Windows will disable one of them.[11] WDDM 1.1 does not have this limitation.[12]

WDDM 1.0/1.1 does not allow some modes that were previously handled by the driver such as spanning mode (stretching the desktop across two monitors)[13][14][dead link] although Dual View is still available.[11][15]

Need for a new display driver model[edit]

One of the chief scenarios the Windows Display Driver Model enables is the Desktop Window Manager. Since the desktop and application windows managed by DWM are Direct3D applications, the number of open windows directly affects the amount of video memory required. Because there is no limit on the number of open windows, the video memory available may prove insufficient, necessitating virtualization. As the window contents that DWM composes into the final desktop are generated by different processes, cross-process surface sharing is necessary. Also, because there can be other DirectX applications running alongside DWM on the DWM-managed desktop, they must be able to access the GPU in a shared manner, necessitating scheduling.

Though this is true for Microsoft's implementation of a composited desktop under Windows Vista, on the other hand, a composited desktop need not theoretically require a new display driver model to work as expected. Successful implementations of composited desktops were done before Windows Vista on other platforms such as Quartz, Compiz, WindowFX. The approach Microsoft attempted was to try to make sure WDDM was a unified experience across different GPUs from multiple vendors by standardizing their features and performance. The software features missing from other driver models could be made immaterial by extensions or if a less restrictive or simply different driver model was in place.

History[edit]

WDDM 1.0[edit]

WDDM 1.1[edit]

Windows 7 supports major additions to WDDM known as WDDM 1.1; the details of this new version were unveiled at WinHEC 2008. New features include:[9]

Hardware acceleration of GDI and Direct2D/DirectWrite operations helps reduce memory footprint in Windows 7, because DWM compositing engine no longer needs to keep a system memory copy of all surfaces used by GDI/GDI+, as in Windows Vista.[20][21][22]

DXGI 1.1, Direct3D 11, Direct2D, and DirectWrite were made available with Windows Vista Platform Update; however GDI/GDI+ in Vista continues to rely on software rendering[23] and the Desktop Window Manager continues to use Direct3D 9Ex.[24]

WDDM 1.1 drivers are backward compatible with WDDM 1.0 specification; both 1.0 and 1.1 drivers can be used in Windows Vista with or without the Platform Update.[9]

WDDM 1.2[edit]

Windows 8 includes WDDM 1.2[25][26] and DXGI 1.2.[26][27] New features were first previewed at the Windows BUILD 2011 conference and include performance improvements as well as support for stereoscopic 3D rendering and video playback.

Other major features include preemptive multitasking with finer granularity (DMA buffer, primitive, triangle, pixel, or instruction-level),[28] reduced memory footprint, improved resource sharing, and faster timeout detection and recovery. 16-bit color surface formats (565, 5551, 4444) are mandatory in Windows 8, and Direct3D 11 Video supports YUV 4:4:4/4:2:2/4:2:0/4:1:1 video formats with 8, 10, and 16-bit precision, as well as 4 and 8-bit palettized formats.[29]

WDDM 1.0/1.1 only allows rudimentary task scheduling using "batch queue" granularity; improvements to multitasking, as well as fast context switching and support for virtual memory, were initially expected in versions tentatively named WDDM 2.0 and WDDM 2.1, which were announced at WinHEC 2006.[30][31][32]

WDDM 1.3[edit]

Windows 8.1 includes WDDM1.3[33] and DXGI 1.3.[34] New additions according to preliminary documentation are trim DXGI adapter memory usage, multi-plane overlays, overlapping swap chains and swap chain scaling, select backbuffer subregion for swap chain and lower-latency swap chain presentation. Driver feature additions include wireless displays (Miracast), YUV format ranges, cross-adapter resources and GPU engine enumeration capabilities.

WDDM 2.0[edit]

Direct3D 12 API, announced at Build 2014, will require WDDM 2.0. The new API and driver model will go away with automatic resource-management and pipeline-management tasks and allow developers to take full low-level control of adapter memory and rendering states. WDDM 2.0 allows multithreading parallelism in the user-mode driver and completely removes kernel-mode driver from the DXGI infrastructure, resulting in lower CPU utilization. [35] [36] [37] No release date or supported OS have been announced as of April 2014.

References[edit]

  1. ^ a b c "Windows Vista Display Driver Model". MSDN. Microsoft. July 2006. Retrieved 9 December 2013. 
  2. ^ "XPDM vs. WDDM". MSDN. Microsoft. 16 November 2013. Retrieved 16 December 2013. 
  3. ^ "Windows 2000 Display Driver Model (XDDM) Design Guide". Windows Dev Center - Hardware. Microsoft. 16 November 2013. Retrieved 9 December 2013. 
  4. ^ "Roadmap for Developing Drivers for the Windows 2000 Display Driver Model (XDDM)". Windows Dev Center - Hardware. Microsoft. 16 November 2013. Retrieved 16 December 2013. "XDDM and VGA drivers will not compile on Windows 8 and later versions" 
  5. ^ "Graphics Memory Reporting through WDDM". MSDN. Microsoft. 9 January 2007. Retrieved 9 December 2013. 
  6. ^ Schechter, Greg (2 April 2006). "The role of the Windows Display Driver Model in the DWM". Greg Schechter's Blog. Microsoft. Retrieved 9 December 2013. 
  7. ^ "Cross Process Resource Sharing". MSDN. Microsoft. 10 December 2009. Retrieved 9 December 2013. 
  8. ^ "Timeout Detection and Recovery of GPUs through WDDM". Timeout Detection and Recovery: Microsoft. Retrieved 4 September 2011. 
  9. ^ a b c d "Graphics Guide for Windows 7". Microsoft. 12 June 2009. 
  10. ^ Intel excuse for no GMA900 WDDM driver: no "HW Scheduler" no driver, Beyond3D, October 26, 2006.
  11. ^ a b "MultiMonitor Support and Windows Vista". Retrieved 20 October 2007. 
  12. ^ Blythe, David. "Working With the Windows 7 Graphics Architecture". WinHEC 2008. Microsoft. Retrieved 9 December 2013. 
  13. ^ Are there Control Panel features that were available under Windows XP that are no longer available on Windows Vista?
  14. ^ Stretched Desktop or Spanning Mode Not Available in Catalyst Control Center Under Windows Vista
  15. ^ "Description of DualView in Windows XP (Revision 1.5)". Support. Microsoft. 15 January 2006. Retrieved 9 December 2013. 
  16. ^ "GDI Hardware Acceleration". MSDN. Microsoft. Retrieved 14 June 2009. 
  17. ^ "DXVA-HD DDI". MSDN. Microsoft. Retrieved 13 June 2009. 
  18. ^ "Overlay DDI". MSDN. Microsoft. Retrieved 13 June 2009. 
  19. ^ "Multiple Monitors and Video Present Networks". MSDN. Microsoft. Retrieved 14 July 2010. 
  20. ^ Schechter, Greg (3 May 2006). "Redirecting GDI, DirectX, and WPF applications". Greg Schechter's Blog. Microsoft. Retrieved 9 December 2013. 
  21. ^ Chitre, Ameet (25 August 2009). "Engineering Windows 7 Graphics Performance". In Sinofsky, Steven. Engineering Windows 7. Microsoft. Retrieved 9 December 2013. 
  22. ^ Mulcahy, Tom (11 February 2009). "Windows And Video Memory". Zemblanity. Microsoft. Retrieved 9 December 2013. 
  23. ^ Olsen, Thomas (29 October 2008). "Introducing the Microsoft Direct2D API". Tom's Blog. Microsoft. Retrieved 9 December 2013. 
  24. ^ Mark Lawrence (25 November 2009). "Internet Explorer announces to use DirectWrite & Direct2D (comment from Microsoft official)". 
  25. ^ "Windows Developer Preview - New for Display devices". MSDN. Microsoft. 16 November 2013. Retrieved 9 December 2013. 
  26. ^ a b "Windows Display Driver Model Enhancements in Windows Developer Preview". MSDN. Microsoft. 28 September 2012. Retrieved 9 December 2013. 
  27. ^ "DXGI 1.2 Improvements". MSDN. Microsoft. 16 November 2013. Retrieved 9 December 2013. 
  28. ^ "DXGI_Graphics_Preemption_Granularity Enumeration". MSDN. Microsoft. 16 November 2013. Retrieved 9 December 2013. 
  29. ^ "DXGI_FORMAT enumeration". MSDN. Microsoft. 16 November 2013. Retrieved 9 December 2013. 
  30. ^ Al-Kady, Nabeel. "Display Driver Logistics And Testing". WinHEC 2006. Microsoft. Retrieved 9 December 2013. 
  31. ^ Pronovost, Steve. "Windows Display Driver Model (WDDM) v2 And Beyond". WinHEC 2006. Microsoft. Retrieved 9 December 2013. 
  32. ^ Dan Warne (June 1, 2006). "Windows graphics system to be overhauled". APC Magazine. Retrieved 2 June 2006. 
  33. ^ "What's new for Windows 8.1 Preview display drivers (WDDM 1.3)". MSDN. Microsoft. 16 November 2013. Retrieved 9 December 2013. 
  34. ^ "DXGI 1.3 Improvements". MSDN. Microsoft. 16 November 2013. Retrieved 9 December 2013. 
  35. ^ http://channel9.msdn.com/Events/Build/2014/3-564 Max McMullen. Direct3D 12 API Preview. Build 2014, session 3-564
  36. ^ Moreton, Henry (2014-03-20). "DirectX 12: A Major Stride for Gaming | NVIDIA Blog". Blogs.nvidia.com. Retrieved 2014-03-26. 
  37. ^ "DirectX 12 - DirectX Developer Blog - Site Home - MSDN Blogs". Blogs.msdn.com. 2014-03-20. Retrieved 2014-03-26.