Presentation is loading. Please wait.

Presentation is loading. Please wait.

Changes To The Display Driver Interface In Windows ® XP Erick Smith Development Lead Base OS Drivers Team Microsoft Corporation.

Similar presentations


Presentation on theme: "Changes To The Display Driver Interface In Windows ® XP Erick Smith Development Lead Base OS Drivers Team Microsoft Corporation."— Presentation transcript:

1 Changes To The Display Driver Interface In Windows ® XP Erick Smith Development Lead Base OS Drivers Team Microsoft Corporation

2

3 Agenda Discussion of new video port services Discussion of new video port services Things you can do today Things you can do today  Improve driver quality  Implement I2C Interface How current features work How current features work  Power Management is commonly misunderstood  Terminal Server Session Space What’s coming in the future What’s coming in the future Things we’d like feedback on Things we’d like feedback on

4 Dual View Support Windows XP now includes support for dual view Windows XP now includes support for dual view  Single accelerator, multiple independent outputs Implementation is similar to Windows 9x Implementation is similar to Windows 9x The driver is responsible for making decisions The driver is responsible for making decisions  How to divide memory  How to share limited resources, overlay, mouse How to handle bandwidth limitations How to handle bandwidth limitations

5 Dual View (cont) VideoPortCreateSecondaryDisplay VideoPortCreateSecondaryDisplay  Will return a HwDeviceExtension  VIDEO_DUALVIEW_REMOVABLE Typically you’ll want to store a pointer back to the primary DeviceExtension Typically you’ll want to store a pointer back to the primary DeviceExtension The system will now expose another surface that can be attached to the desktop The system will now expose another surface that can be attached to the desktop The system treats Dual View the same way it treats multi-mon The system treats Dual View the same way it treats multi-mon

6 New DMA Support Command buffers Command buffers  Static one time allocation  Buffer is allocated by the driver in memory accessible by the hardware device  Usually faster then packed based DMA Packed based DMA Packed based DMA  New functions in Windows XP  Used when the memory is not allocated by the driver  The memory may not be visible to the hardware device  Use these functions when it makes sense

7 AGP AGP code redesigned for Windows XP AGP code redesigned for Windows XP Existing interface remains unchanged Existing interface remains unchanged Enhanced Interface to Set AGP Rate Enhanced Interface to Set AGP Rate  VideoPortQueryServices  VIDEO_PORT_AGP_INTERFACE_2 Please don’t try to touch AGP registers yourself Please don’t try to touch AGP registers yourself  AgpSetRate

8 AGP (Disabling Features) We have heard numerous reports of AGP compatibility problems We have heard numerous reports of AGP compatibility problems We have introduced a mechanism where you can selectively disable features We have introduced a mechanism where you can selectively disable features  AGP Transfer Speeds  AGP Side Band Addressing Features can be disabled globally for a given part, or based on AGP/Video chipset combinations Features can be disabled globally for a given part, or based on AGP/Video chipset combinations

9 VESA Support Windows XP supports VESA modes Windows XP supports VESA modes This benefits both setup and safe mode This benefits both setup and safe mode We will try to use the following VESA features We will try to use the following VESA features  Function 00: Get VESA Information  Function 01: Get Mode Information  Function 02: Set Mode  Function 03: Return Current Mode  Function 05: Display Window Control  Function 06: Set Scan Line Length  Function 09: Set Palette

10 VESA Support Please support these VESA functions! Please support these VESA functions! WHQL will start testing for these WHQL will start testing for these

11 New Int10 Support Buffer passing is now supported! Buffer passing is now supported! Features exposed via an interface Features exposed via an interface Discussion of Design Discussion of Design  Multiple Address Spaces  Transfer Buffers VideoPortQueryServices VideoPortQueryServices  VideoPortServicesInt10

12 New Int10 New Functions New Functions  Int10AllocateBuffer  Int10Freebuffer  Int10ReadMemory  Int10WriteMemory  Int10CallBios Only the VGA can use this new interface Only the VGA can use this new interface  VideoPortInt10 has always been limited to VGA device Please don’t use this interface unless absolutely required Please don’t use this interface unless absolutely required

13 Power Management (ACPI) Lid close Lid close  The LCD is powered down when the lid is closed Display Dimming Display Dimming  The LCD is dimmed when running on battery power No driver changes required No driver changes required System BIOS must support ACPI video extensions System BIOS must support ACPI video extensions

14 Power Management (cont) Please implement these methods Please implement these methods  LCD._BCL  LCD._BCM  LCD._PSx Let us do the work Let us do the work

15 Display Driver Watchdog Display driver often gets stuck waiting on a hardware event which never occurs Display driver often gets stuck waiting on a hardware event which never occurs  The user perceives this as a hung machine  The user has no idea what happened and reboots  The user has no information about how to resolve the problem Windows XP actively tries to detect a hung display driver Windows XP actively tries to detect a hung display driver  Instead of just a hung machine, the user will be notified which driver is at fault  Negligible performance impact

16 Quality Driver quality is very important Driver quality is very important  Our data indicates a high percentage of Windows 2000 crashes are related to display driver failures Run checked builds Run checked builds Run driver verifier, run stress Run driver verifier, run stress Upgrade issues Upgrade issues  Don’t make assumptions about registry locations Don’t use illegal imports Don’t use illegal imports  Only import from the videoprt

17 Important Things To Remember Limit non-paged pool usage Limit non-paged pool usage  Limit what you store in your device extension  Device extension is stored in non-page pool  Make sure you mark pageable miniport functions as pageable Limit code size Limit code size  The less code you write the less bugs you’ll have  The less code you write the less bugs you’ll have  The smaller the code the less likely the chances of taking a page fault

18 Please Support All Windows Architectures Make your driver portable Make your driver portable  Please support IA-64 Don’t assume that pointers are the same size as ULONG Don’t assume that pointers are the same size as ULONG  ULONG_PTR Make sure data accesses are naturally aligned Make sure data accesses are naturally aligned  Can be a performance win on X86 as well

19 Please Support All Windows Architectures Please don’t use “Asm” Please don’t use “Asm”  If you do use assembly, make sure you actually get a speed win from it Remember that your device won’t necessarily have access to all of memory Remember that your device won’t necessarily have access to all of memory  Don’t use ExAllocatePool to allocate memory which your device will access  Use one of our DMA functions

20 DDC-CI Monitor vendors want to ship monitor drivers Monitor vendors want to ship monitor drivers  Control the monitor via applet  Adjust brightness/contrast  Adjust positioning  Other value add features They need access to the I2C bus to access the monitor They need access to the I2C bus to access the monitor Please support the I2C interface Please support the I2C interface  Defined in i2cgpio.h

21 DDC-CI (cont) Current interface exposes internal I2C interface Current interface exposes internal I2C interface  Often times there is a second i2c bus for the monitor We have extended the interface We have extended the interface  pInterface->Version = 2;  pInterface->InterfaceSpecificData = pdo; VideoPortGetAssociatedDeviceID VideoPortGetAssociatedDeviceID In the future, the system will provide a default monitor driver so the user can control display placement, etc. In the future, the system will provide a default monitor driver so the user can control display placement, etc.

22 Explanation Of Windows 2000 Power Management Commonly misunderstood Commonly misunderstood Windows does most of the work Windows does most of the work The most the driver ever has to do is repost the device The most the driver ever has to do is repost the device The hardware must support PCI Power Management The hardware must support PCI Power Management  Must support D3 cold

23 Power Management Example (1 of 2) System decides to go into sleep state System decides to go into sleep state Query Power IRPs sent Query Power IRPs sent  Video miniport will have a chance to fail the power request Power System sends notification to Win32k Power System sends notification to Win32k Win32k calls drivers DrvAssertMode function Win32k calls drivers DrvAssertMode function  Passes in a FALSE indicating the driver stop driving the hardware

24 Power Management Example (2 of 2) System Power IRP is sent to videoprt System Power IRP is sent to videoprt  Video Port sends Device Power IRPs  Device Power IRP is forwarded to video miniport Video Miniport needs only to make sure the device goes into the requested power state Video Miniport needs only to make sure the device goes into the requested power state  The driver does not have to worry about saving and restoring frame buffer, etc.

25 Session Space Terminal Server Terminal Server  One win32k session for each user  Miniport should not try to call back into display drive, or access display driver memory  Don’t cache pointers in the miniport Fast User Switching Fast User Switching  Multiple copies of the display driver will be trying to communicate with the video miniport  Don’t cache state in miniport

26 User Space Kernel Space Process 1 Process 2 Kernel Memory is consistent across all processes

27 User Space Kernel Space Session Space User 1 User 2 User 1 User 2 P1P2 P1 P2

28 User Space Kernel Space User 1 User 2 User 1 DispDrv User 2 DispDrv P1P2 P1 P2 Video Miniport

29 Problem Dual Driver Model Problems with dual driver model Problems with dual driver model  Tough to share data structures between two drivers  The entire display driver is paged  Can’t acquire spin locks, etc. in display driver  Can’t freely call between display driver and miniport  Terminal server session space

30 Solution Single Driver Combine the drivers Combine the drivers Benefits Benefits  One single binary  No distinction between display driver and miniport  All data structures can be shared  All code can be marked paged or non-paged as needed Legacy drivers will continue to be supported Legacy drivers will continue to be supported  New features only exposed to new model  Supported for backward compatibility only

31 Universal Graphics Adapter (UGA) Raising the bar Raising the bar  Improved baseline graphics support Provides evolutionary path away from VGA Provides evolutionary path away from VGA  Allows for the removal of IO ports No hardware changes required No hardware changes required  Existing device can be UGA device with addition of UGA firmware  Must not rely on VGA register access

32 UGA Implementation UGA Firmware is interpreted UGA Firmware is interpreted  Firmware code is written in C UGA Firmware Features UGA Firmware Features  High resolution drawing support  Power Management  Detailed device information OS no longer assumes a VGA is present OS no longer assumes a VGA is present  OS assumes there is a UGA device  There is a translation layer from UGA to VGA for backward compatibility We are ready to work with you today We are ready to work with you today

33 OpenGL Issues Lots of extra code for driver writer Lots of extra code for driver writer  Would driver writers prefer to only support D3D DDI? Power Management Power Management  ICD’s typically give direct control of HW to application  We don’t have a way to stop the application from touching HW We can’t guarantee that command buffers aren’t corrupted We can’t guarantee that command buffers aren’t corrupted

34 Rotation Rotation is a required feature for tablet PC Rotation is a required feature for tablet PC How it should be implemented How it should be implemented How the modes should be exposed How the modes should be exposed

35 Hotkey Support We would like to remove hotkey support altogether We would like to remove hotkey support altogether  We would add an applet which would allow the same functionality  Perhaps even a system “hotkey” Do we need to support the OEM “hotkey”? Do we need to support the OEM “hotkey”?  If so, can we just acknowledge it and do the work ourselves? Can we remove BIOS from the loop? Can we remove BIOS from the loop?

36 What Can You Do Next? Include VESA support in video BIOS Include VESA support in video BIOS Talk to us about UGA Talk to us about UGA Support Dual View Support Dual View Support I2C interface Support I2C interface Build robust/portable drivers Build robust/portable drivers Please provide us feedback on issues Please provide us feedback on issues

37


Download ppt "Changes To The Display Driver Interface In Windows ® XP Erick Smith Development Lead Base OS Drivers Team Microsoft Corporation."

Similar presentations


Ads by Google