Partager via


How to Profile and Optimize a Display Driver (Windows CE 5.0)

Send Feedback

Windows CE and Platform Builder ship with a number of tools that can help you improve the performance of your display driver.

  • Profiling tools, such as Monte Carlo profiling, help you understand which functions in your run-time image are most heavily used.
  • Performance tools, such as DispPerf.exe, provide you with time-oriented measurements of your run-time image's operations.

For more information, see Monte Carlo Profiling and Display Driver Performance Profiling.

You can use these tools to determine which functions in your system are most frequently called during a usage scenario, and to provide metrics for the specific raster operations in your display driver.

The following table shows the steps to profile a graphics application and optimize a specific color conversion in the FLAT display driver.

These steps work on any display-based device and they assume that you are already familiar with the process of building a run-time image and downloading it to a target device.

Select the check box next to each step to track your progress.

  Step Topic
1. Create an empty display-based operating OS. Creating an Empty Display-Based OS
2. Clone the FLAT display driver.

The FLAT display driver is included in your OS design by default. By cloning it, you can make private modifications to the driver without affecting the performance or stability of other OS designs that might be using the public driver code for the FLAT driver.

To clone the FLAT display driver

  • In OSDesignView, clone the Catalog item <OS design> Catalog Items\Device Drivers\Display\VGA Linear (Flat) Framebuffer.
  • In the Clone Catalog Item - ddi_flat dialog box, select ddi_flat_lib and choose OK.
  • In the Clone Catalog Item - gpe dialog box, select gpe_lib, emulrotate, and genblt. Clear the checkboxes for the other cloneable libraries, then choose OK.
Cloning a Catalog Item
3. Enable Monte Carlo profiling for your configuration. Enabling Monte Carlo Profiling of a Configuration
4. Activate the instrumentation code for profiling your display driver with DispPerf.exe by setting the environment variable DO_DISPPERF = 1.

As with all sample display drivers shipped with Windows CE, the FLAT driver is already instrumented to support DispPerf, the display driver performance profiling tool.

Typically, the code to support DispPerf within the FLAT driver is turned off, but setting DO_DISPPERF = 1 turns it on.

For more information, see Display Driver Performance Profiling.

Setting or Clearing an Environment Variable
5. Create an application that uses your OS design's graphics routines, providing a target for profiling your display driver. Creating a Target Application for Profiling the FLAT Display Driver
6. Within your OS design, create a project for the application that gathers the profiling data for the display driver, DispPerf.exe. Building DispPerf.exe
7. Build a release configuration for your run-time image. From the Build OS menu, choose Sysgen. Building a Run-Time Image
8. When the build is complete, configure your download and debugging connections. Configuring a Connection for Downloading and Debugging
9. Download the run-time image to your device. Downloading a Run-Time Image
10. After your run-time image is loaded, begin profiling ProfApp.exe to obtain a set of performance data. Obtaining a Performance Profile for a Display Driver
11. Analyze the profiling and performance data to find heavily used functions that can be optimized. Display Device Performance Profile Analysis
12. From the Target menu in Platform Builder, choose Detach Device to return to the Platform Builder IDE. Not applicable.
13. Add a function to the BitBlt emulation library to improve the performance of the FLAT display driver when running ProfApp.exe on your run-time image.

For more information see BitBlT Emulation Library Functions.

Optimizing a GPE Emulation Function
14. From the Build OS menu, choose Sysgen. Not applicable.
15. After your run-time image is rebuilt, download it onto your device and rerun the profiling steps to obtain a set of post-optimization profiling and performance data. Downloading a Run-Time Image

Obtaining a Performance Profile for a Display Driver

16. Evaluate the results of the optimization. Optimized GPE Emulation Function Analysis

**Note   **If your project and run-time images build but exhibit unexpected behavior, verify that the settings you made for your projects and platform run-time images were all made for the release configuration of your run-time image.

See Also

Display Driver Performance | How-to Topics | Display Driver Samples | Developing a Device Driver

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.