Microsoft Windows CE Shows Drivers and Hardware
The graphic display style of the Microsoft Windows CE operating system varies greatly in version 2.0. In version 1.0, the graphic design interface (GDI) is directly connected to the display hardware, and GDI and one or more display drivers in version 2.0. Connect, they are connected to the display hardware. This display technology allows Windows CE to use a variety of different display devices without having to have a hardware code program for each device, and new Windows CE GDI combines small steps with multi-purpose. This paper first considers a good feature of a good Windows CE display driver. It discusses the display driver, the device driver interface function that should be executed, the same graphic original engine level, can be used to simplify write display drivers, GDI support devices The driver is also discussed. This thesis then lists the details of each pixel depth supported by Windows CE, and discusss the display hardware because the display driver is the channel between the GDI and the display device, and the hardware support of the driver is displayed, but also supports GDI. Windows CE Display Driver Like the Windows CE, display the driver interface (DDI) for Microsoft Windows NT's DDI subset, if you are not familiar with Windows NT DDI, before writing your Windows CE display driver, Read the display driver section of the Windows NT device driver package. Windows CE uses only the most basic graphics engine and driver functions in Windows NT DDI. The differences in Windows CE and Windows NT have the following details:
Windows CE Display Driver always has the same function, GDI does not query driver capability information; Windows CE Displays the driver does not reject complex operations, which make it back to GDI to make the operation into a simple step because all Windows CE shows all WINDOWS CE display The driver supports the same function, and the GD can decompose complex operation before the first call display driver. The Windows CE display driver is edited into a dynamic link library (.dll file) instead of library function (.lib file). All Windows CE Display Drivers must perform a set of DDI functions, which is initialized by .GDI calls to display drivers and draws to display, in addition to DDI functions, this has a set of VC classes, which calls the Graphic Primary Engine (GPE) class, display driver Use it to make hardware acceleration, standard display driver calling GPE classes and acceleration is based on S3TRIO64 display hardware, if your display hardware uses different video chips, you can change the GPE call mode to suit your hardware capabilities. Note It is optional, you can write your display driver without them, the price is more complex, pay attention to the DDI function, pay attention, the GPE class provided by Microsoft requires your display hardware has a FLAT frame (Frame) Buffer If your display hardware is not, for example, it uses a custom movable window to connect the entire memory, it may not be able to use the GPE class, in order to obtain more details, participate in this article Windows CE display hardware recommendation section, especially It is the Dirty Rec Drivers part. Windows CE Display Driver is different from the usual device driver in many ways, the most important difference is that they do not expose I / O interface. Therefore, they cannot be managed by device manager, so registers never be called by them. As a result, there is no special device file or other file system record, which is coordinated with the active display driver. The mechanism to display the driver load is a use of the display driver's application, and calls the Create DC function dynamic with the display driver name. Link file. This allows Windows CE to load the display driver and initialize to enable the device context to return to the application default display driver, of course, is automatically loaded. DDI Functions The following table lists the DDI function display drivers for displaying and printing drivers, and all display DDI functions listed here should be performed. Print drivers should perform all print DDI functions. However, only the DRVE Enable Drive must be output by the dynamic link library (DLL) display driver. So, only DriversDrive must have a name, other functions can be called at will because they are returned by Drr Enable Driver, and the function pointer outputs to GDI, no matter who is called, always following the prototype defined in the Win DDI.h file.
Function Uses Drvanyblt has extended or transparent bit blocks DRVBitplt usual block to transfer DRV ConstrostControl allows software, hardware control adjustment DRVCopyBits Send GDI design printing segment to print driver DrvcreateDeviceBitMap Design and management bitmap drvdeDeviceBitMap Delete Design Bit Figure DrvdisableDriver Notification Driver GDI no longer needs it, and is ready to uninstall it drvdisablep.d.ev. Notification Driver GDI No longer requires special printing or display device DrvdisableSwrface notification driver GDI no longer requires special drawing surface DriversWriver by the driver output initial Record, return a PDEVDEV for GDI DDI function to returns a PDEV for GDI, which is a physical display device logic indicating a DRVENABLESFACE design a drawing interface, and sending it with PDEV-connected DRVEMDDOC DRVFILLPATH. Brush padding path DrvgetMask For the current display device mode, the display mode, the display mode supported by the display device, the display mode supported by the device, ensuring that GDI does not interfere with Drvpaint with brush painting a specific area DrvpowerHandler call processing, power-on, power down to notify drvawryFont Get font metric information DrvRealizebrush creates a GDI specified parameter brush DrvReamoceColor to map a RGB color, mapped to the device support most likely to get color DRVSEEPALETTE Settings Display Device Tiles Drive DRSEEPOINTERSHAPE Sets new shapes to the cursor and update Display drvStaredoc Send any start print file Information DRVSTARTPAGE Send Any Print New Page Information DRVSHOKEPATH Delete Path DrvTransparentBRT Transparent Block Transfer DrvunRealizeColor to display the color of the display device system to use the GPE class standard display driver Use the Graphics Engine Engineering (GPE) class, when the GPE class can choose Use them can easily handle write to the display driver. If you use the GPE class, you only need to provide the new code you need to speed up the normal operation of the display hardware. The GPE class requires your display hardware to use a FLAT FRAME buffer, that is, the memory must be in a neighboring memory range, correcting the GPE class to use a non-continuous frame buffer. To create a GPE-based display driver, use the following steps: Set a subdirectory for the project; copy files from the standard driver, such as the S3TRIO64 directory, and set the device name in full change, for example S3TRIO64 "change to your device name; change config.cpp to make it put your display device, put it in a linear frame-buffer mode; make the specified hardware accelerate; establish and test these non-accelerator GPEs, will use software Generate an output; add your hardware acceleration mode. GDI provides the support display driver service Windows CE GDI to provide service support display drivers in pre-defined function structures and some independent C function. The predetermined structure provides brush, shearing zone, palette, deletion, and fill paths. Support for transformation, independent C function provides device bitmap and interface support.
Function Structure BRVSHOBJ represents a brush BRVSHOBJ_PVALLOCRBRUSH that performs a solid line or grid delete fill operation, which is a brush allocation memory brushobj_pvgeerbrush, returns a specific brush, returns a pointer, represents the clipping area, CLIPOBJ-BESUM, from the shear area, listing rectangles Function Clipobj-CenumStart To list clipping rectangular setting parameters eNGCreatePitMap to make GDI to process ENGCREATEVICESURFACE for device bitmaps ENGCREATEVICESURFACE Create a display driver Managed device interface ENGDELESURFACE Notification GDI Display Driver No longer need device interface PALOBJ- C getColors Copy the color to the palette PathDAT Storage section Draw PathObj-Benum enumerated by the drawing path PathData Record Pathobj-VenumStart A Drawing Path Returns the Limit Rectangular Area of Drawing Path XLateObj is used to transfer color XLateObj-c Get Palette between palettes to return color display buffer Format Windows CE GDI supports a wide range of color depths and color modes, from one color to adjustable real 32-bit RGB, Each format also supports several pixels, depending on whether it is 1 bit, 2 or 4 digits. All display buffered formats, assume that the display pixel order is from left to right, from top to bottom, ie pixels (0, 0) in the upper left angular pixel (Wisth-1, height-1) in the lower right corner. 1 pixel level format It shows simple black and white, 0 generations black, 1 represents white. The pixel is stored in byte, so that pixels (0, 0) are placed at the highest bit of the first byte of the memory. 2 Pixel position format Although any 4-ENTRY palette is working, the two status format is typically used as a 4-stage grayscale display, and the grayscale is indicated by the following list: 1 bit 0-bit grayscale level 00 Black 01 gray 10 bright gray 11 White 4 pixel position format It is usually a portable format, Frame Buffer can be 2 pixels / one bytes or 1 pixel / one-byte form. If you choose, a pixel / byte mode is executed, the driver will be in the 8-bit / pixel display mode of the 16-color tone plate, each byte is a low byte, and the high byte is 0.8 pixels. Bit format It is a system that can be used to control the palette, which maps the eight-bit value into 24-bit color. Due to operation, compatibility, image quality, Microsoft recommends using the default Windows CE palette. 15 or 16 pixel position format It is a mask format, which is not toned. For 15 or 16-bit pixel pixels, a 15-pixel bit is stored in every two bytes, and the highest bit of each word is wasted. Microsoft recommends pure red, green, and blue matches are as follows:
Color 15-bit (5-5-5RGB) 16-bit (5-6-5RGB) RED0X7C000XF800GREEN0X3E000x07E0BLUE0x001f0x001f In 15-bit / pixel matching, the lower 15-bit containing pixel data, no bit is 0.24 bit / pixel format It is a true color format, each pixel is pairs red, green, and blue each stores 8 bits. This format has its advantages and insufficient, the advantage is that the image quality is good, because each pixel occupies 3 bytes, they don't waste memory, insufficient The point is that the pixel half is in the design of the pixel, which will cause operational consequences when connecting and decoding pixels. 32-bit / pixel format It is another true color format. This format will not make the pixel exceed the DWORD boundary, but the memory utilization efficiency is not high, it has two ways to arrange color channels, one is blue as each pixel The weakening bytes of the world, the other is to use red as the weakest one byte, corresponding to PAL-BGR and PAL-RGB mode, you can extract red, green and blue in each pixel aisle. ColorPal_RGB Maskpal_Bgr MaskRED0x000000FF0X00FF0000GREEN0X0000FF00000000GREEN0X0000FF000000000000FF Windows CE Show Hardware Recommended Microsoft recommends using 10 Windows CE operating system display hardware, which is proven to be operable and make your display driver development easier, even if your hardware is not Recommended, you can still write a full-feature display, driver, or if it is difficult to change hardware design in the later product design, the cost is an effort in the driver and / or reduced operation. Memory layout Microsoft strongly recommends that you display hardware use linear Frame buffers, you can read and write to buffers. All display memory should be continuous, suitable, in addition, it should be a linear junction window to overwrite the entire Frame buffer, when using non-Microsoft recommended hardware, if you choose to use it, you need to be substantial for the GPE class. See the use of the GPE class sector for details. Your display hardware also uses supportable pixel format, storage, and pixel combination, detailed information, and read this paper, display the cache format section. This display hardware FRAME buffer should have the following nature:
From the top to the lower format, pixels (0, 0) in the upper left corner, pixels (Width-1, HEIGHT-1); Frame buffer, memory used to represent one of the words in the display, It should be a set of four-bytes, even with unwrapping lines; the entire Frame buffer must be connected to the CPU without using the CPU to run blank selection. Frame buffer: Do not use Bit-Plaso, it Each color channel or darkness has a separation Frame buffer. DIRTY Rect Buffer If you want to use the GPE class to perform the display driver, your display hardware is not supported (for example, if the Frame buffer is non-linear), then you may consider writing "Dirty Rece Driver". In this mode, the GPE class maintains a bitmap (DIB) in memory, which represents the Frame buffer, when the memory DIB is modified, GPE will notify DIRTY Rect Driver to copy DIB changes or "dirty" Partial to, the display device performs a conversion operation. Direy Rect Drivers takes up the speed of memory and sacrifice, they should only be the last means of support hardware, and when these hardware can meet GPE needs. Accelerating Microsoft recommends that you use the display hardware that can accelerate the following operations, arrangements as follows: solid color fill, special BIT operation, its PB0-Isolid Color is not oxffffff. SRCCopy bit operation; cursor display, if your platform uses cursor; use sub-pixel to draw solid lines; match srccopy bit operations; other image operations are performed by Windows CE devices. Summary In Windows CE 2.0, the display driver has a critical role in visual display technology, coordinated with the design policy mentioned in this paper, showing drivers and display hardware will allow Windows CE-based devices to make full use of new GDI Enhance image display capabilities.