Compartilhar via


Display Driver Registry Settings (Compact 2013)

August 22, 2016

The following information describes the registry keys for the display driver, removable display adapter, Microsoft® ClearType®, and screen rotation.

Registry Keys for Display Drivers

When a run-time image contains a display driver, it is loaded by GWES at system startup.

By default, GWES loads a driver named Ddi.dll. To change the name of the default display driver, use the HKEY_LOCAL_MACHINE\System\GDI\Drivers\Display registry key to override the default display driver DLL name.

The registry key should be placed in your Platform.reg file.

For the sample drivers provided, this information is in the %_WINCEROOT%\Public\Common\OAK\Files\Common.reg file and is included for each display type associated with a BSP_DISPLAY_NAME environment variable.

You can include a registry key that provides additional information about the driver. This information is not used by the GDI but it can be useful to applications.

This information can also be useful to the driver when it supports, for example, multiple resolutions, which a user can select from Control Panel applications that you provide. In this case, the driver could examine the registry to determine which resolution to set when the display driver loads.

The following example shows a registry key for a native display driver that supports a Color Graphix Voyager display device.

The key stores the native device driver's DLL name, screen size, and color depth.

[HKEY_LOCAL_MACHINE\Drivers\Display\PCARDVGA]
    Dll="PCARDVGA.DLL"
    CxScreen=Dword:280
    CyScreen=Dword:F0
    Bpp=Dword:8

For PCI-based display controllers, PCI bus template information should be provided. This is used by the PCI bus driver when enumerating the PCI bus and is populated in the registry's instance tree, along with configuration information.

When loaded by GWES, the display driver receives instance information and should not need to scan the PCI bus to locate itself or read PCI configuration information from the hardware.

For more information about PCI templates, see PCI Bus Drivers.

GWES Registry Settings

To retrieve the default contrast value, GWES reads the HKEY_CURRENT_USER\ControlPanel\Keybd\Contrast registry key.

During a resume operation, GWES executes the CONTRAST_CMD_GET command followed by the CONTRAST_CMD_SET command so the hardware refreshes its contrast settings.

Implement both escape codes in your display driver.

During suspend and resume operations, video frame buffer data can be lost if RAM is not powered during suspension.

As a result, the primary display and other video surfaces, such as bitmaps and icons, can appear to be useless after resuming operation. To address this problem, GWES provides four options that can be selected through a registry key. You can only choose the registry settings.

The following table shows the selectable registry subkeys of the HKEY_LOCAL_MACHINE\SYSTEM\GWE registry key.

Subkey

Value

Description

"PORepaint"

dword:0

The display driver handles all actions.

GWES takes no action and assumes that the hardware maintains the display surface data in RAM or that other factors intervene to ensure the data is not lost.

"PORepaint"

dword:1

GWES should save and restore the bits.

GWES saves the primary display surface, which resides in video memory, in system memory that is maintained during suspend operation. After resuming, the primary surface is restored.

Because other surfaces can be allocated in video memory, blit operations are faster, even though the primary surface is restored.

Other surfaces, such as bitmaps and icons, might contain useless data when the screen is refreshed. To resolve this, set PORepaint equal to DWORD:3.

"PORepaint"

dword:2

GWES should invalidate and repaint.

GWES assumes that all display surfaces reside in system memory, exceptfor the primary surface, which can be in video memory.

After resuming, GWES searches the list of windows and invalidates each.

Because the surfaces are assumed to be in system memory or at least in some form of nonvolatile storage, the invalidation process restores the video RAM contents with a new image.

This process can be slow.

"PORepaint"

dword:3

GWES invokes DRVESC_SAVEVIDEOMEM at suspend time.

GWES and the driver must save video memory. This option allows the driver to save other nonprimary video surface data, which resides in video RAM, to some other location.

After suspending, GWES makes a DrvEscape call to retrieve the display driver to save all video surfaces, including the primary surface, into a nonvolatile location (for example, system RAM).

After resuming, GWES makes another DrvEscape call to the display driver to restore the contents of the video RAM.

The mechanism for storing and the storage location are the decisions of the display driver. GWES does not save the surface data directly.

Registry Keys for Removable Display Adapters

When a secondary display adapter is provided on removable hardware, the display driver is typically implemented as two drivers:

  • A built-in driver that exposes the built-in DDI
  • A stream interface driver that exposes the stream interfaces

The stream driver must initialize the registry with the keys that allow it to be detected and loaded.

When the device is inserted, the Device Manager initiates a detection sequence to determine which driver should service the card.

If the device has a Plug and Play identifier, it is used to determine which driver to load. Otherwise, the Device Manager tries the detection functions for all device drivers that are installed on the system until one of them reports that it recognizes the device.

After the correct driver is located, the Device Manager loads the driver whose name is provided as the registry key, with the detection function that succeeded in detecting the device.

The following code example shows how the Device Manager loads the driver, registers its special device file name, and calls the driver's XXX_Init (Device Manager) function.

 [HKEY_LOCAL_MACHINE\Drivers\VoyagerVGA]
    Dll="VOYAGER.DLL"
    Prefix="VGA"
    Index=Dword:1

[HKEY_LOCAL_MACHINE\Drivers\Detect\60]
    Dll="VOYAGER.DLL"
    Entry="DetectVGA"

Some applications need additional registry keys to use secondary display adapters. During initialization, the driver should update the HKEY_LOCAL_MACHINE\Drivers\Display\Active registry key with the information appropriate for its driver.

This information includes details about the built-in driver DLL name, as well as BufferMode and Tapmode information.

For removable display adapters, this initialization should take place when the adapter is connected to the system and the Device Manager calls the stream interface's XXX_Init function.

The following code example shows how this process is performed.

[HKEY_LOCAL_MACHINE\Drivers\Display\Active\Voyager]
    Dll="PCARDVGA.DLL"
    BufferMode=Dword:0
    Tapmode=Dword:0

The following table shows the four available values for BufferMode.

Value

Description

bmNotShared

There is no common frame buffer.

bmTopHalf

The top half of the secondary display is shown on the system's built-in LCD display.

bmSquashed

A scaled-down version of the secondary display is shown on the system's built-in LCD display.

bmOff

The system's built-in display is turned off while the driver is active.

The following table shows the three available values for Tapmode.

Value

Description

tmNone

The display driver performs no conversion of tap coordinates.

tmScaled

The display driver scales tap coordinates to match the secondary display's resolution.

tmUndefined

The display driver reports tap coordinates of (0,0) but still reports tap events.

ClearType Registry Keys

The following registry keys must be set to enable ClearType across an OS.

Registry key

Description

HKEY_LOCAL_MACHINE\SYSTEM\GDI\ClearTypeSettings
"Enabled"=dword:1

Enables ClearType for all applications.

HKEY_LOCAL_MACHINE\SYSTEM\GDI\Gamma

Sets the contrast.

Screen Rotation Registry Keys

Use the HKEY_LOCAL_MACHINE\SYSTEM\GDI\ROTATION registry key to set the angle of rotation.

The following registry key example shows how to set the angle of rotation.

[HKEY_LOCAL_MACHINE\SYSTEM\GDI\ROTATION]
    "Angle"=dword:0

The following table shows the values you can use in the Angle registry subkey.

Value

Description

0

No rotation.

5A

90 degrees rotated clockwise.

B4

180 degrees rotated clockwise.

10E

270 degrees rotated clockwise.

See Also

Other Resources

Display Drivers