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

Slides:



Advertisements
Similar presentations
System Integration and Performance
Advertisements

I/O Organization popo.
Categories of I/O Devices
Device Drivers. Linux Device Drivers Linux supports three types of hardware device: character, block and network –character devices: R/W without buffering.
1 Operating Systems Input/Output Management. 2 What is the I/O System A collection of devices that different sub- systems of a computer use to communicate.
Threads, SMP, and Microkernels
INPUT-OUTPUT ORGANIZATION
Input and Output CS 215 Lecture #20.
1/1/ / faculty of Electrical Engineering eindhoven university of technology Architectures of Digital Information Systems Part 1: Interrupts and DMA dr.ir.
Lecture 19 Page 1 CS 111 Online Protecting Operating Systems Resources How do we use these various tools to protect actual OS resources? Memory? Files?
1/1/ / faculty of Electrical Engineering eindhoven university of technology Introduction Part 3: Input/output and co-processors dr.ir. A.C. Verschueren.
Chapter 6 Limited Direct Execution
Computer Systems/Operating Systems - Class 8
Operating Systems High Level View Chapter 1,2. Who is the User? End Users Application Programmers System Programmers Administrators.
Home: Phones OFF Please Unix Kernel Parminder Singh Kang Home:
Chapter 7 Interupts DMA Channels Context Switching.
1 Last Class: Introduction Operating system = interface between user & architecture Importance of OS OS history: Change is only constant User-level Applications.
MCDST : Supporting Users and Troubleshooting a Microsoft Windows XP Operating System Chapter 9: Troubleshooting Power Management and I/O Devices.
Mehmet Can Vuran, Instructor University of Nebraska-Lincoln Acknowledgement: Overheads adapted from those provided by the authors of the textbook.
1 I/O Management in Representative Operating Systems.
Threads CS 416: Operating Systems Design, Spring 2001 Department of Computer Science Rutgers University
1 Today I/O Systems Storage. 2 I/O Devices Many different kinds of I/O devices Software that controls them: device drivers.
1 Threads Chapter 4 Reading: 4.1,4.4, Process Characteristics l Unit of resource ownership - process is allocated: n a virtual address space to.
EET Advanced Digital Display Adapters. A vital part to the system provides the visual part of the Human/Computer interface In boot process, goes.
1 OS & Computer Architecture Modern OS Functionality (brief review) Architecture Basics Hardware Support for OS Features.
Operating Systems Concepts 1. A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random access memory.
I/O Tanenbaum, ch. 5 p. 329 – 427 Silberschatz, ch. 13 p
INPUT-OUTPUT ORGANIZATION
Input/Output. Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower.
Chapter 3.1:Operating Systems Concepts 1. A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random access.
Computer Organization
Interconnection Structures
System Calls 1.
Chapter 10: Input / Output Devices Dr Mohamed Menacer Taibah University
Input and Output Computer Organization and Assembly Language: Module 9.
MICROPROCESSOR INPUT/OUTPUT
ATA Miniport Nuts and Bolts
1 Chapter Overview Configuring and Troubleshooting the Display Configuring Power Management Configuring Operating System Settings Configuring and Troubleshooting.
Architecture Support for OS CSCI 444/544 Operating Systems Fall 2008.
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Principles of I/0 hardware.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
Chapter 4 Memory Management Virtual Memory.
11 INSTALLING AND MANAGING HARDWARE Chapter 6. Chapter 6: Installing and Managing Hardware2 INSTALLING AND MANAGING HARDWARE  Install hardware in a Microsoft.
1 Threads, SMP, and Microkernels Chapter Multithreading Operating system supports multiple threads of execution within a single process MS-DOS.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
Operating Systems CSE 411 CPU Management Sept Lecture 10 Instructor: Bhuvan Urgaonkar.
Chapter 13 – I/O Systems (Pgs ). Devices  Two conflicting properties A. Growing uniformity in interfaces (both h/w and s/w): e.g., USB, TWAIN.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
1 Lecture 1: Computer System Structures We go over the aspects of computer architecture relevant to OS design  overview  input and output (I/O) organization.
Goodbye SMI - ACPI and Graphics Driver/System Firmware Interface Paul Blinzer Staff Engineer ATI Research, Inc.
Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower than CPU.
بسم الله الرحمن الرحيم MEMORY AND I/O.
I/O Software CS 537 – Introduction to Operating Systems.
COMP091 – Operating Systems 1 Memory Management. Memory Management Terms Physical address –Actual address as seen by memory unit Logical address –Address.
Interrupts and Exception Handling. Execution We are quite aware of the Fetch, Execute process of the control unit of the CPU –Fetch and instruction as.
Kernel Design & Implementation
Architectures of Digital Information Systems Part 1: Interrupts and DMA dr.ir. A.C. Verschueren Eindhoven University of Technology Section of Digital.
Chapter Objectives In this chapter, you will learn:
CS 6560: Operating Systems Design
Chapter 2: System Structures
Computer-System Architecture
Module 2: Computer-System Structures
Operating Systems Chapter 5: Input/Output Management
Threads Chapter 4.
Module 2: Computer-System Structures
Module 2: Computer-System Structures
Module 2: Computer-System Structures
Chapter 13: I/O Systems “The two main jobs of a computer are I/O and [CPU] processing. In many cases, the main job is I/O, and the [CPU] processing is.
Presentation transcript:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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.

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

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

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.

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

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

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

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

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

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

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

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

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

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

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?

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